From 99750800699bca40c32b6c7698c1103f5ee138ae Mon Sep 17 00:00:00 2001 From: Samet Altunsoy Date: Thu, 14 Dec 2023 20:52:41 +0300 Subject: [PATCH 01/48] feat: multiple y axes pass idx to valueFormatter in tooltip --- .../chart-elements/AreaChart/AreaChart.tsx | 80 +++++++++++++----- .../chart-elements/LineChart/LineChart.tsx | 84 +++++++++++++------ .../chart-elements/common/ChartTooltip.tsx | 2 +- src/lib/inputTypes.ts | 2 +- .../chart-elements/AreaChart.stories.tsx | 19 +++++ .../chart-elements/LineChart.stories.tsx | 19 +++++ 6 files changed, 157 insertions(+), 49 deletions(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 15a9b038d..44d3ca35e 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -32,13 +32,14 @@ import { themeColorRange, tremorTwMerge, } from "lib"; -import { CurveType } from "../../../lib/inputTypes"; +import { CurveType, HorizontalPosition } from "../../../lib/inputTypes"; export interface AreaChartProps extends BaseChartProps { stack?: boolean; curveType?: CurveType; connectNulls?: boolean; showGradient?: boolean; + orientations?: HorizontalPosition[]; } interface ActiveDot { @@ -78,6 +79,7 @@ const AreaChart = React.forwardRef((props, ref) customTooltip, rotateLabelX, tickGap = 5, + orientations, ...other } = props; const CustomTooltip = customTooltip; @@ -188,27 +190,58 @@ const AreaChart = React.forwardRef((props, ref) dy={rotateLabelX?.verticalShift} height={rotateLabelX?.xAxisHeight} /> - + {orientations ? ( + categories.map((_, idx) => ( + valueFormatter(value, idx)} + allowDecimals={allowDecimals} + orientation={orientations[idx]} + yAxisId={idx} + key={idx} + /> + )) + ) : ( + + )} ((props, ref) ); })} - {categories.map((category) => ( + {categories.map((category, idx) => ( ((props, ref) animationDuration={animationDuration} stackId={stack ? "a" : undefined} connectNulls={connectNulls} + yAxisId={orientations ? idx : undefined} /> ))} {onValueChange diff --git a/src/components/chart-elements/LineChart/LineChart.tsx b/src/components/chart-elements/LineChart/LineChart.tsx index 90b707a50..2b7650163 100644 --- a/src/components/chart-elements/LineChart/LineChart.tsx +++ b/src/components/chart-elements/LineChart/LineChart.tsx @@ -31,11 +31,12 @@ import { themeColorRange, tremorTwMerge, } from "lib"; -import { CurveType } from "../../../lib/inputTypes"; +import { CurveType, HorizontalPosition } from "../../../lib/inputTypes"; export interface LineChartProps extends BaseChartProps { curveType?: CurveType; connectNulls?: boolean; + orientations?: HorizontalPosition[]; } interface ActiveDot { @@ -73,6 +74,7 @@ const LineChart = React.forwardRef((props, ref) customTooltip, rotateLabelX, tickGap = 5, + orientations, ...other } = props; const CustomTooltip = customTooltip; @@ -184,27 +186,59 @@ const LineChart = React.forwardRef((props, ref) dy={rotateLabelX?.verticalShift} height={rotateLabelX?.xAxisHeight} /> - + {orientations ? ( + categories.map((_, idx) => ( + valueFormatter(value, idx)} + allowDecimals={allowDecimals} + orientation={orientations[idx] ?? "left"} + yAxisId={idx} + key={idx} + /> + )) + ) : ( + + )} + ((props, ref) } /> ) : null} - {categories.map((category) => ( + {categories.map((category, idx) => ( ((props, ref) isAnimationActive={showAnimation} animationDuration={animationDuration} connectNulls={connectNulls} + yAxisId={orientations ? idx : undefined} /> ))} {onValueChange - ? categories.map((category) => ( + ? categories.map((category, idx) => ( ((props, ref) const { name } = props; onCategoryClick(name); }} + yAxisId={orientations ? idx : undefined} /> )) : null} diff --git a/src/components/chart-elements/common/ChartTooltip.tsx b/src/components/chart-elements/common/ChartTooltip.tsx index 4596d70f9..92d425249 100644 --- a/src/components/chart-elements/common/ChartTooltip.tsx +++ b/src/components/chart-elements/common/ChartTooltip.tsx @@ -117,7 +117,7 @@ const ChartTooltip = ({ {filteredPayload.map(({ value, name }: { value: number; name: string }, idx: number) => ( diff --git a/src/lib/inputTypes.ts b/src/lib/inputTypes.ts index b306ee355..b9bf8d72a 100644 --- a/src/lib/inputTypes.ts +++ b/src/lib/inputTypes.ts @@ -1,5 +1,5 @@ export type ValueFormatter = { - (value: number): string; + (value: number, index?: number): string; }; export type CurveType = "linear" | "natural" | "monotone" | "step"; diff --git a/src/stories/chart-elements/AreaChart.stories.tsx b/src/stories/chart-elements/AreaChart.stories.tsx index a1bfb8af6..30e46feb4 100644 --- a/src/stories/chart-elements/AreaChart.stories.tsx +++ b/src/stories/chart-elements/AreaChart.stories.tsx @@ -44,6 +44,10 @@ export const Stacked: Story = { }, }; +export const RightOrientation: Story = { + args: { categories: ["Sales"], orientations: ["right"] }, +}; + export const ValueFormatter: Story = { args: { valueFormatter: valueFormatter, yAxisWidth: 60 }, }; @@ -113,6 +117,21 @@ export const ConnectNullsFalse: Story = { args: { data: simpleBaseChartDataWithNulls, connectNulls: false }, }; +export const MultipleYAxes: Story = { + args: { + orientations: ["left", "right"], + valueFormatter: (value, index) => { + switch (index) { + case 0: + default: + return `${value} S`; + case 1: + return `${value} P`; + } + }, + }, +}; + export const Animation: Story = { args: { showAnimation: true }, }; diff --git a/src/stories/chart-elements/LineChart.stories.tsx b/src/stories/chart-elements/LineChart.stories.tsx index 865f5fe77..df3a51e3d 100644 --- a/src/stories/chart-elements/LineChart.stories.tsx +++ b/src/stories/chart-elements/LineChart.stories.tsx @@ -38,6 +38,10 @@ export const DefaultNegativeValues: Story = { }, }; +export const RightOrientation: Story = { + args: { categories: ["Sales"], orientations: ["right"] }, +}; + export const ValueFormatter: Story = { args: { valueFormatter: valueFormatter, yAxisWidth: 60 }, }; @@ -102,6 +106,21 @@ export const ConnectNullsFalse: Story = { args: { data: simpleBaseChartDataWithNulls, connectNulls: false }, }; +export const MultipleYAxes: Story = { + args: { + orientations: ["left", "right"], + valueFormatter: (value, index) => { + switch (index) { + case 0: + default: + return `${value} S`; + case 1: + return `${value} P`; + } + }, + }, +}; + export const Animation: Story = { args: { showAnimation: true }, }; From 61aa26e91482e2a494076cc444d1efe79ef148d4 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:31:01 +0800 Subject: [PATCH 02/48] changes release info --- .github/workflows/release.yaml | 1 - package.json | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c7ba213e6..f268d631d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,6 +27,5 @@ jobs: run: npm run build - name: release env: - NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release diff --git a/package.json b/package.json index ee6faff6d..2a630d61b 100644 --- a/package.json +++ b/package.json @@ -139,8 +139,12 @@ ] } ], - "@semantic-release/npm", - "@semantic-release/github" + [ + "@semantic-release/github", + { + "githubUrl": "git+ssh://git@github.com/upsolve-labs/tremor2axis.git" + } + ] ] } } From 8d9ea3923f47781818f1f19eef5ecbd027fe86b4 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:34:45 +0800 Subject: [PATCH 03/48] updates release info --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a630d61b..a0cac81e6 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,8 @@ ], "types": "dist/index.d.ts", "publishConfig": { - "access": "public" + "access": "restricted", + "registry": "https://npm.pkg.github.com/" }, "release": { "branches": [ From 5dae796ab1d0978711ef5b93b060c04e527c5304 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:37:56 +0800 Subject: [PATCH 04/48] updated package info --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a0cac81e6..35c742559 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@tremor/react", + "name": "@upsolve-labs/tremor2axis", "version": "0.0.0-development", "description": "The React library to build dashboards faster.", "scripts": { @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/tremorlabs/tremor.git" + "url": "https://github.com/Upsolve-Labs/tremor2axis" }, "author": "tremor", "license": "Apache 2.0", From 670ea8d9f99fdda288e1bcae8d837ff0e2650fb3 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:44:53 +0800 Subject: [PATCH 05/48] adjusted url --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 35c742559..f8ca6d0f8 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ [ "@semantic-release/github", { - "githubUrl": "git+ssh://git@github.com/upsolve-labs/tremor2axis.git" + "githubUrl": "https://github.com/Upsolve-Labs/tremor2axis" } ] ] From 6a8dcd20b80dd0971ce2b6c15a74494c42e781bc Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:50:18 +0800 Subject: [PATCH 06/48] adjusted permissions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f8ca6d0f8..ac29c4e6d 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ ], "types": "dist/index.d.ts", "publishConfig": { - "access": "restricted", + "access": "public", "registry": "https://npm.pkg.github.com/" }, "release": { From 74a74b7d460b50cc4e8566d5f76dfe4e85f377f1 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:53:49 +0800 Subject: [PATCH 07/48] adjusts permissions --- .github/workflows/release.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f268d631d..e15c95c16 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,6 +11,11 @@ jobs: release: name: Release runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance steps: - name: checkout uses: actions/checkout@v2.4.2 From cfae7fa5ebf8e0a582e16bede12deab1f2cad95c Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 10:59:18 +0800 Subject: [PATCH 08/48] resets url --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac29c4e6d..a0c99ea1c 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ [ "@semantic-release/github", { - "githubUrl": "https://github.com/Upsolve-Labs/tremor2axis" + "githubUrl": "git+ssh://git@github.com/upsolve-labs/tremor2axis.git" } ] ] From ccf7ed8cb6e976ed83fd774c61aa78d463240014 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 12:01:53 +0800 Subject: [PATCH 09/48] updates publish info --- .github/workflows/release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e15c95c16..0215685ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,3 +34,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release + - name: publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npm publish From 5749ca6514138baa0572d98172cbfabae09fc56d Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 13:12:13 +0800 Subject: [PATCH 10/48] manually building --- .gitignore | 1 - dist/assets/ArrowDownHeadIcon.cjs | 1 + dist/assets/ArrowDownHeadIcon.d.ts | 5 + dist/assets/ArrowDownHeadIcon.js | 1 + dist/assets/ArrowDownIcon.cjs | 1 + dist/assets/ArrowDownIcon.d.ts | 5 + dist/assets/ArrowDownIcon.js | 1 + dist/assets/ArrowDownRightIcon.cjs | 1 + dist/assets/ArrowDownRightIcon.d.ts | 5 + dist/assets/ArrowDownRightIcon.js | 1 + dist/assets/ArrowLeftHeadIcon.cjs | 1 + dist/assets/ArrowLeftHeadIcon.d.ts | 5 + dist/assets/ArrowLeftHeadIcon.js | 1 + dist/assets/ArrowRightHeadIcon.cjs | 1 + dist/assets/ArrowRightHeadIcon.d.ts | 5 + dist/assets/ArrowRightHeadIcon.js | 1 + dist/assets/ArrowRightIcon.cjs | 1 + dist/assets/ArrowRightIcon.d.ts | 5 + dist/assets/ArrowRightIcon.js | 1 + dist/assets/ArrowUpHeadIcon.cjs | 1 + dist/assets/ArrowUpHeadIcon.d.ts | 5 + dist/assets/ArrowUpHeadIcon.js | 1 + dist/assets/ArrowUpIcon.cjs | 1 + dist/assets/ArrowUpIcon.d.ts | 5 + dist/assets/ArrowUpIcon.js | 1 + dist/assets/ArrowUpRightIcon.cjs | 1 + dist/assets/ArrowUpRightIcon.d.ts | 5 + dist/assets/ArrowUpRightIcon.js | 1 + dist/assets/CalendarIcon.cjs | 1 + dist/assets/CalendarIcon.d.ts | 5 + dist/assets/CalendarIcon.js | 1 + dist/assets/ChevronLeftFill.cjs | 1 + dist/assets/ChevronLeftFill.d.ts | 5 + dist/assets/ChevronLeftFill.js | 1 + dist/assets/ChevronRightFill.cjs | 1 + dist/assets/ChevronRightFill.d.ts | 5 + dist/assets/ChevronRightFill.js | 1 + dist/assets/DoubleArrowLeftHeadIcon.cjs | 1 + dist/assets/DoubleArrowLeftHeadIcon.d.ts | 5 + dist/assets/DoubleArrowLeftHeadIcon.js | 1 + dist/assets/DoubleArrowRightHeadIcon.cjs | 1 + dist/assets/DoubleArrowRightHeadIcon.d.ts | 5 + dist/assets/DoubleArrowRightHeadIcon.js | 1 + dist/assets/ExclamationFilledIcon.cjs | 1 + dist/assets/ExclamationFilledIcon.d.ts | 5 + dist/assets/ExclamationFilledIcon.js | 1 + dist/assets/EyeIcon.cjs | 1 + dist/assets/EyeIcon.d.ts | 5 + dist/assets/EyeIcon.js | 1 + dist/assets/EyeOffIcon.cjs | 1 + dist/assets/EyeOffIcon.d.ts | 5 + dist/assets/EyeOffIcon.js | 1 + dist/assets/LoadingSpinner.cjs | 1 + dist/assets/LoadingSpinner.d.ts | 5 + dist/assets/LoadingSpinner.js | 1 + dist/assets/MinusIcon.cjs | 1 + dist/assets/MinusIcon.d.ts | 5 + dist/assets/MinusIcon.js | 1 + dist/assets/PlusIcon.cjs | 1 + dist/assets/PlusIcon.d.ts | 5 + dist/assets/PlusIcon.js | 1 + dist/assets/SearchIcon.cjs | 1 + dist/assets/SearchIcon.d.ts | 5 + dist/assets/SearchIcon.js | 1 + dist/assets/XCircleIcon.cjs | 1 + dist/assets/XCircleIcon.d.ts | 5 + dist/assets/XCircleIcon.js | 1 + dist/assets/XIcon.cjs | 1 + dist/assets/XIcon.d.ts | 5 + dist/assets/XIcon.js | 1 + dist/assets/index.d.ts | 22 + .../chart-elements/AreaChart/AreaChart.cjs | 2 + .../chart-elements/AreaChart/AreaChart.d.ts | 11 + .../chart-elements/AreaChart/AreaChart.js | 2 + .../chart-elements/AreaChart/index.d.ts | 2 + .../chart-elements/BarChart/BarChart.cjs | 2 + .../chart-elements/BarChart/BarChart.d.ts | 9 + .../chart-elements/BarChart/BarChart.js | 2 + .../chart-elements/BarChart/index.d.ts | 2 + .../chart-elements/DonutChart/DonutChart.cjs | 2 + .../chart-elements/DonutChart/DonutChart.d.ts | 24 + .../chart-elements/DonutChart/DonutChart.js | 2 + .../DonutChart/DonutChartTooltip.cjs | 1 + .../DonutChart/DonutChartTooltip.d.ts | 8 + .../DonutChart/DonutChartTooltip.js | 1 + .../chart-elements/DonutChart/index.d.ts | 2 + .../chart-elements/DonutChart/inputParser.cjs | 1 + .../DonutChart/inputParser.d.ts | 3 + .../chart-elements/DonutChart/inputParser.js | 1 + .../chart-elements/LineChart/LineChart.cjs | 2 + .../chart-elements/LineChart/LineChart.d.ts | 9 + .../chart-elements/LineChart/LineChart.js | 2 + .../chart-elements/LineChart/index.d.ts | 2 + .../ScatterChart/ScatterChart.cjs | 2 + .../ScatterChart/ScatterChart.d.ts | 48 ++ .../ScatterChart/ScatterChart.js | 2 + .../ScatterChart/ScatterChartTooltip.cjs | 1 + .../ScatterChart/ScatterChartTooltip.d.ts | 22 + .../ScatterChart/ScatterChartTooltip.js | 1 + .../chart-elements/ScatterChart/index.d.ts | 2 + .../common/BaseAnimationTimingProps.d.ts | 5 + .../chart-elements/common/BaseChartProps.d.ts | 42 ++ .../chart-elements/common/ChartLegend.cjs | 1 + .../chart-elements/common/ChartLegend.d.ts | 4 + .../chart-elements/common/ChartLegend.js | 1 + .../chart-elements/common/ChartTooltip.cjs | 1 + .../chart-elements/common/ChartTooltip.d.ts | 20 + .../chart-elements/common/ChartTooltip.js | 1 + .../common/CustomTooltipProps.d.ts | 6 + .../chart-elements/common/NoData.cjs | 1 + .../chart-elements/common/NoData.d.ts | 6 + .../chart-elements/common/NoData.js | 1 + .../chart-elements/common/index.d.ts | 2 + .../chart-elements/common/utils.cjs | 1 + .../chart-elements/common/utils.d.ts | 6 + .../components/chart-elements/common/utils.js | 1 + dist/components/chart-elements/index.d.ts | 7 + dist/components/icon-elements/Badge/Badge.cjs | 2 + .../components/icon-elements/Badge/Badge.d.ts | 10 + dist/components/icon-elements/Badge/Badge.js | 2 + .../components/icon-elements/Badge/index.d.ts | 2 + .../components/icon-elements/Badge/styles.cjs | 1 + .../icon-elements/Badge/styles.d.ts | 14 + dist/components/icon-elements/Badge/styles.js | 1 + .../icon-elements/BadgeDelta/BadgeDelta.cjs | 2 + .../icon-elements/BadgeDelta/BadgeDelta.d.ts | 10 + .../icon-elements/BadgeDelta/BadgeDelta.js | 2 + .../icon-elements/BadgeDelta/index.d.ts | 2 + .../icon-elements/BadgeDelta/styles.cjs | 1 + .../icon-elements/BadgeDelta/styles.d.ts | 29 + .../icon-elements/BadgeDelta/styles.js | 1 + dist/components/icon-elements/Icon/Icon.cjs | 2 + dist/components/icon-elements/Icon/Icon.d.ts | 14 + dist/components/icon-elements/Icon/Icon.js | 2 + dist/components/icon-elements/Icon/index.d.ts | 2 + dist/components/icon-elements/Icon/styles.cjs | 1 + .../components/icon-elements/Icon/styles.d.ts | 29 + dist/components/icon-elements/Icon/styles.js | 1 + dist/components/icon-elements/index.d.ts | 3 + dist/components/index.d.ts | 8 + dist/components/input-elements/BaseInput.cjs | 2 + dist/components/input-elements/BaseInput.d.ts | 15 + dist/components/input-elements/BaseInput.js | 2 + .../input-elements/Button/Button.cjs | 2 + .../input-elements/Button/Button.d.ts | 25 + .../input-elements/Button/Button.js | 2 + .../input-elements/Button/index.d.ts | 2 + .../input-elements/Button/styles.cjs | 1 + .../input-elements/Button/styles.d.ts | 56 ++ .../input-elements/Button/styles.js | 1 + .../input-elements/Calendar/Calendar.cjs | 2 + .../input-elements/Calendar/Calendar.d.ts | 9 + .../input-elements/Calendar/Calendar.js | 2 + .../input-elements/Calendar/NavButton.cjs | 1 + .../input-elements/Calendar/NavButton.d.ts | 7 + .../input-elements/Calendar/NavButton.js | 1 + .../input-elements/Calendar/index.d.ts | 1 + .../input-elements/DatePicker/DatePicker.cjs | 2 + .../input-elements/DatePicker/DatePicker.d.ts | 24 + .../input-elements/DatePicker/DatePicker.js | 2 + .../DatePicker/datePickerUtils.cjs | 1 + .../DatePicker/datePickerUtils.d.ts | 1 + .../DatePicker/datePickerUtils.js | 1 + .../input-elements/DatePicker/index.d.ts | 2 + .../DateRangePicker/DateRangePicker.cjs | 2 + .../DateRangePicker/DateRangePicker.d.ts | 30 + .../DateRangePicker/DateRangePicker.js | 2 + .../DateRangePicker/DateRangePickerItem.cjs | 2 + .../DateRangePicker/DateRangePickerItem.d.ts | 8 + .../DateRangePicker/DateRangePickerItem.js | 2 + .../DateRangePicker/dateRangePickerUtils.cjs | 1 + .../DateRangePicker/dateRangePickerUtils.d.ts | 12 + .../DateRangePicker/dateRangePickerUtils.js | 1 + .../input-elements/DateRangePicker/index.d.ts | 4 + .../MultiSelect/MultiSelect.cjs | 2 + .../MultiSelect/MultiSelect.d.ts | 17 + .../input-elements/MultiSelect/MultiSelect.js | 2 + .../MultiSelect/MultiSelectItem.cjs | 2 + .../MultiSelect/MultiSelectItem.d.ts | 6 + .../MultiSelect/MultiSelectItem.js | 2 + .../input-elements/MultiSelect/index.d.ts | 4 + .../NumberInput/NumberInput.cjs | 2 + .../NumberInput/NumberInput.d.ts | 10 + .../input-elements/NumberInput/NumberInput.js | 2 + .../input-elements/NumberInput/index.d.ts | 2 + .../SearchSelect/SearchSelect.cjs | 2 + .../SearchSelect/SearchSelect.d.ts | 19 + .../SearchSelect/SearchSelect.js | 2 + .../SearchSelect/SearchSelectItem.cjs | 2 + .../SearchSelect/SearchSelectItem.d.ts | 7 + .../SearchSelect/SearchSelectItem.js | 2 + .../input-elements/SearchSelect/index.d.ts | 4 + .../input-elements/Select/Select.cjs | 2 + .../input-elements/Select/Select.d.ts | 17 + .../input-elements/Select/Select.js | 2 + .../input-elements/Select/SelectItem.cjs | 2 + .../input-elements/Select/SelectItem.d.ts | 7 + .../input-elements/Select/SelectItem.js | 2 + .../input-elements/Select/index.d.ts | 4 + .../input-elements/Switch/Switch.cjs | 2 + .../input-elements/Switch/Switch.d.ts | 17 + .../input-elements/Switch/Switch.js | 2 + .../input-elements/Switch/index.d.ts | 2 + dist/components/input-elements/Tabs/Tab.cjs | 2 + dist/components/input-elements/Tabs/Tab.d.ts | 6 + dist/components/input-elements/Tabs/Tab.js | 2 + .../input-elements/Tabs/TabGroup.cjs | 2 + .../input-elements/Tabs/TabGroup.d.ts | 9 + .../input-elements/Tabs/TabGroup.js | 2 + .../input-elements/Tabs/TabList.cjs | 2 + .../input-elements/Tabs/TabList.d.ts | 11 + .../components/input-elements/Tabs/TabList.js | 2 + .../input-elements/Tabs/TabPanel.cjs | 2 + .../input-elements/Tabs/TabPanel.d.ts | 3 + .../input-elements/Tabs/TabPanel.js | 2 + .../input-elements/Tabs/TabPanels.cjs | 2 + .../input-elements/Tabs/TabPanels.d.ts | 3 + .../input-elements/Tabs/TabPanels.js | 2 + .../components/input-elements/Tabs/index.d.ts | 8 + .../input-elements/TextInput/TextInput.cjs | 2 + .../input-elements/TextInput/TextInput.d.ts | 23 + .../input-elements/TextInput/TextInput.js | 2 + .../input-elements/TextInput/index.d.ts | 2 + .../input-elements/Textarea/Textarea.cjs | 2 + .../input-elements/Textarea/Textarea.d.ts | 11 + .../input-elements/Textarea/Textarea.js | 2 + .../input-elements/Textarea/index.d.ts | 2 + dist/components/input-elements/index.d.ts | 11 + .../components/input-elements/selectUtils.cjs | 1 + .../input-elements/selectUtils.d.ts | 10 + dist/components/input-elements/selectUtils.js | 1 + .../layout-elements/Accordion/Accordion.cjs | 2 + .../layout-elements/Accordion/Accordion.d.ts | 10 + .../layout-elements/Accordion/Accordion.js | 2 + .../Accordion/AccordionBody.cjs | 2 + .../Accordion/AccordionBody.d.ts | 3 + .../Accordion/AccordionBody.js | 2 + .../Accordion/AccordionHeader.cjs | 2 + .../Accordion/AccordionHeader.d.ts | 3 + .../Accordion/AccordionHeader.js | 2 + .../Accordion/AccordionList.cjs | 2 + .../Accordion/AccordionList.d.ts | 6 + .../Accordion/AccordionList.js | 2 + .../layout-elements/Accordion/index.d.ts | 6 + dist/components/layout-elements/Card/Card.cjs | 1 + .../components/layout-elements/Card/Card.d.ts | 8 + dist/components/layout-elements/Card/Card.js | 1 + .../layout-elements/Card/index.d.ts | 2 + .../layout-elements/Dialog/Dialog.cjs | 1 + .../layout-elements/Dialog/Dialog.d.ts | 16 + .../layout-elements/Dialog/Dialog.js | 1 + .../layout-elements/Dialog/DialogPanel.cjs | 1 + .../layout-elements/Dialog/DialogPanel.d.ts | 4 + .../layout-elements/Dialog/DialogPanel.js | 1 + .../layout-elements/Dialog/index.d.ts | 2 + .../layout-elements/Divider/Divider.cjs | 1 + .../layout-elements/Divider/Divider.d.ts | 3 + .../layout-elements/Divider/Divider.js | 1 + .../layout-elements/Divider/index.d.ts | 1 + dist/components/layout-elements/Flex/Flex.cjs | 1 + .../components/layout-elements/Flex/Flex.d.ts | 10 + dist/components/layout-elements/Flex/Flex.js | 1 + .../layout-elements/Flex/index.d.ts | 2 + dist/components/layout-elements/Grid/Col.cjs | 1 + dist/components/layout-elements/Grid/Col.d.ts | 9 + dist/components/layout-elements/Grid/Col.js | 1 + dist/components/layout-elements/Grid/Grid.cjs | 1 + .../components/layout-elements/Grid/Grid.d.ts | 10 + dist/components/layout-elements/Grid/Grid.js | 1 + .../layout-elements/Grid/index.d.ts | 4 + .../layout-elements/Grid/styles.cjs | 1 + .../layout-elements/Grid/styles.d.ts | 11 + .../components/layout-elements/Grid/styles.js | 1 + dist/components/layout-elements/index.d.ts | 6 + dist/components/list-elements/List/List.cjs | 1 + dist/components/list-elements/List/List.d.ts | 3 + dist/components/list-elements/List/List.js | 1 + .../list-elements/List/ListItem.cjs | 1 + .../list-elements/List/ListItem.d.ts | 3 + .../components/list-elements/List/ListItem.js | 1 + dist/components/list-elements/List/index.d.ts | 2 + dist/components/list-elements/Table/Table.cjs | 1 + .../components/list-elements/Table/Table.d.ts | 3 + dist/components/list-elements/Table/Table.js | 1 + .../list-elements/Table/TableBody.cjs | 1 + .../list-elements/Table/TableBody.d.ts | 3 + .../list-elements/Table/TableBody.js | 1 + .../list-elements/Table/TableCell.cjs | 1 + .../list-elements/Table/TableCell.d.ts | 3 + .../list-elements/Table/TableCell.js | 1 + .../list-elements/Table/TableFoot.cjs | 1 + .../list-elements/Table/TableFoot.d.ts | 3 + .../list-elements/Table/TableFoot.js | 1 + .../list-elements/Table/TableFooterCell.cjs | 1 + .../list-elements/Table/TableFooterCell.d.ts | 3 + .../list-elements/Table/TableFooterCell.js | 1 + .../list-elements/Table/TableHead.cjs | 1 + .../list-elements/Table/TableHead.d.ts | 3 + .../list-elements/Table/TableHead.js | 1 + .../list-elements/Table/TableHeaderCell.cjs | 1 + .../list-elements/Table/TableHeaderCell.d.ts | 3 + .../list-elements/Table/TableHeaderCell.js | 1 + .../list-elements/Table/TableRow.cjs | 1 + .../list-elements/Table/TableRow.d.ts | 3 + .../list-elements/Table/TableRow.js | 1 + .../components/list-elements/Table/index.d.ts | 8 + dist/components/list-elements/index.d.ts | 2 + .../SparkAreaChart/SparkAreaChart.cjs | 2 + .../SparkAreaChart/SparkAreaChart.d.ts | 11 + .../SparkAreaChart/SparkAreaChart.js | 2 + .../spark-elements/SparkAreaChart/index.d.ts | 2 + .../SparkBarChart/SparkBarChart.cjs | 2 + .../SparkBarChart/SparkBarChart.d.ts | 8 + .../SparkBarChart/SparkBarChart.js | 2 + .../spark-elements/SparkBarChart/index.d.ts | 2 + .../SparkLineChart/SparkLineChart.cjs | 2 + .../SparkLineChart/SparkLineChart.d.ts | 9 + .../SparkLineChart/SparkLineChart.js | 2 + .../spark-elements/SparkLineChart/index.d.ts | 2 + .../common/BaseSparkChartProps.d.ts | 22 + dist/components/spark-elements/index.d.ts | 3 + dist/components/text-elements/Bold/Bold.cjs | 1 + dist/components/text-elements/Bold/Bold.d.ts | 3 + dist/components/text-elements/Bold/Bold.js | 1 + dist/components/text-elements/Bold/index.d.ts | 1 + .../text-elements/Callout/Callout.cjs | 1 + .../text-elements/Callout/Callout.d.ts | 9 + .../text-elements/Callout/Callout.js | 1 + .../text-elements/Callout/index.d.ts | 2 + .../text-elements/Italic/Italic.cjs | 1 + .../text-elements/Italic/Italic.d.ts | 3 + .../components/text-elements/Italic/Italic.js | 1 + .../text-elements/Italic/index.d.ts | 1 + .../text-elements/Legend/Legend.cjs | 1 + .../text-elements/Legend/Legend.d.ts | 22 + .../components/text-elements/Legend/Legend.js | 1 + .../text-elements/Legend/index.d.ts | 2 + .../text-elements/Metric/Metric.cjs | 1 + .../text-elements/Metric/Metric.d.ts | 7 + .../components/text-elements/Metric/Metric.js | 1 + .../text-elements/Metric/index.d.ts | 2 + .../text-elements/Subtitle/Subtitle.cjs | 1 + .../text-elements/Subtitle/Subtitle.d.ts | 7 + .../text-elements/Subtitle/Subtitle.js | 1 + .../text-elements/Subtitle/index.d.ts | 2 + dist/components/text-elements/Text/Text.cjs | 1 + dist/components/text-elements/Text/Text.d.ts | 7 + dist/components/text-elements/Text/Text.js | 1 + dist/components/text-elements/Text/index.d.ts | 2 + dist/components/text-elements/Title/Title.cjs | 1 + .../components/text-elements/Title/Title.d.ts | 7 + dist/components/text-elements/Title/Title.js | 1 + .../components/text-elements/Title/index.d.ts | 2 + dist/components/text-elements/index.d.ts | 8 + .../util-elements/Tooltip/Tooltip.cjs | 1 + .../util-elements/Tooltip/Tooltip.d.ts | 27 + .../util-elements/Tooltip/Tooltip.js | 1 + .../util-elements/Tooltip/index.d.ts | 2 + dist/components/util-elements/index.d.ts | 1 + .../vis-elements/BarList/BarList.cjs | 1 + .../vis-elements/BarList/BarList.d.ts | 26 + .../vis-elements/BarList/BarList.js | 1 + .../vis-elements/BarList/index.d.ts | 2 + .../vis-elements/CategoryBar/CategoryBar.cjs | 2 + .../vis-elements/CategoryBar/CategoryBar.d.ts | 12 + .../vis-elements/CategoryBar/CategoryBar.js | 2 + .../vis-elements/CategoryBar/index.d.ts | 2 + .../vis-elements/DeltaBar/DeltaBar.cjs | 2 + .../vis-elements/DeltaBar/DeltaBar.d.ts | 9 + .../vis-elements/DeltaBar/DeltaBar.js | 2 + .../vis-elements/DeltaBar/index.d.ts | 2 + .../vis-elements/DeltaBar/styles.cjs | 1 + .../vis-elements/DeltaBar/styles.d.ts | 6 + .../vis-elements/DeltaBar/styles.js | 1 + .../vis-elements/MarkerBar/MarkerBar.cjs | 2 + .../vis-elements/MarkerBar/MarkerBar.d.ts | 13 + .../vis-elements/MarkerBar/MarkerBar.js | 2 + .../vis-elements/MarkerBar/index.d.ts | 2 + .../vis-elements/ProgressBar/ProgressBar.cjs | 2 + .../vis-elements/ProgressBar/ProgressBar.d.ts | 11 + .../vis-elements/ProgressBar/ProgressBar.js | 2 + .../vis-elements/ProgressBar/index.d.ts | 2 + .../ProgressCircle/ProgressCircle.cjs | 1 + .../ProgressCircle/ProgressCircle.d.ts | 15 + .../ProgressCircle/ProgressCircle.js | 1 + .../vis-elements/ProgressCircle/index.d.ts | 2 + .../vis-elements/Tracker/Tracker.cjs | 2 + .../vis-elements/Tracker/Tracker.d.ts | 13 + .../vis-elements/Tracker/Tracker.js | 2 + .../vis-elements/Tracker/index.d.ts | 2 + dist/components/vis-elements/index.d.ts | 7 + dist/contexts/BaseColorContext.cjs | 1 + dist/contexts/BaseColorContext.d.ts | 3 + dist/contexts/BaseColorContext.js | 1 + dist/contexts/IndexContext.cjs | 1 + dist/contexts/IndexContext.d.ts | 3 + dist/contexts/IndexContext.js | 1 + dist/contexts/RootStylesContext.cjs | 1 + dist/contexts/RootStylesContext.d.ts | 3 + dist/contexts/RootStylesContext.js | 1 + dist/contexts/SelectedValueContext.cjs | 1 + dist/contexts/SelectedValueContext.d.ts | 7 + dist/contexts/SelectedValueContext.js | 1 + dist/contexts/index.d.ts | 4 + dist/hooks/index.d.ts | 2 + dist/hooks/useInternalState.cjs | 1 + dist/hooks/useInternalState.d.ts | 3 + dist/hooks/useInternalState.js | 1 + dist/hooks/useOnWindowResize.cjs | 1 + dist/hooks/useOnWindowResize.d.ts | 4 + dist/hooks/useOnWindowResize.js | 1 + dist/index.cjs | 1 + dist/index.d.ts | 660 ++++++++++++++++++ dist/index.js | 1 + dist/lib/constants.cjs | 1 + dist/lib/constants.d.ts | 16 + dist/lib/constants.js | 1 + dist/lib/index.d.ts | 5 + dist/lib/inputTypes.cjs | 1 + dist/lib/inputTypes.d.ts | 25 + dist/lib/inputTypes.js | 1 + dist/lib/theme.cjs | 1 + dist/lib/theme.d.ts | 24 + dist/lib/theme.js | 1 + dist/lib/tremorTwMerge.cjs | 1 + dist/lib/tremorTwMerge.d.ts | 1 + dist/lib/tremorTwMerge.js | 1 + dist/lib/utils.cjs | 1 + dist/lib/utils.d.ts | 25 + dist/lib/utils.js | 1 + 430 files changed, 2482 insertions(+), 1 deletion(-) create mode 100644 dist/assets/ArrowDownHeadIcon.cjs create mode 100644 dist/assets/ArrowDownHeadIcon.d.ts create mode 100644 dist/assets/ArrowDownHeadIcon.js create mode 100644 dist/assets/ArrowDownIcon.cjs create mode 100644 dist/assets/ArrowDownIcon.d.ts create mode 100644 dist/assets/ArrowDownIcon.js create mode 100644 dist/assets/ArrowDownRightIcon.cjs create mode 100644 dist/assets/ArrowDownRightIcon.d.ts create mode 100644 dist/assets/ArrowDownRightIcon.js create mode 100644 dist/assets/ArrowLeftHeadIcon.cjs create mode 100644 dist/assets/ArrowLeftHeadIcon.d.ts create mode 100644 dist/assets/ArrowLeftHeadIcon.js create mode 100644 dist/assets/ArrowRightHeadIcon.cjs create mode 100644 dist/assets/ArrowRightHeadIcon.d.ts create mode 100644 dist/assets/ArrowRightHeadIcon.js create mode 100644 dist/assets/ArrowRightIcon.cjs create mode 100644 dist/assets/ArrowRightIcon.d.ts create mode 100644 dist/assets/ArrowRightIcon.js create mode 100644 dist/assets/ArrowUpHeadIcon.cjs create mode 100644 dist/assets/ArrowUpHeadIcon.d.ts create mode 100644 dist/assets/ArrowUpHeadIcon.js create mode 100644 dist/assets/ArrowUpIcon.cjs create mode 100644 dist/assets/ArrowUpIcon.d.ts create mode 100644 dist/assets/ArrowUpIcon.js create mode 100644 dist/assets/ArrowUpRightIcon.cjs create mode 100644 dist/assets/ArrowUpRightIcon.d.ts create mode 100644 dist/assets/ArrowUpRightIcon.js create mode 100644 dist/assets/CalendarIcon.cjs create mode 100644 dist/assets/CalendarIcon.d.ts create mode 100644 dist/assets/CalendarIcon.js create mode 100644 dist/assets/ChevronLeftFill.cjs create mode 100644 dist/assets/ChevronLeftFill.d.ts create mode 100644 dist/assets/ChevronLeftFill.js create mode 100644 dist/assets/ChevronRightFill.cjs create mode 100644 dist/assets/ChevronRightFill.d.ts create mode 100644 dist/assets/ChevronRightFill.js create mode 100644 dist/assets/DoubleArrowLeftHeadIcon.cjs create mode 100644 dist/assets/DoubleArrowLeftHeadIcon.d.ts create mode 100644 dist/assets/DoubleArrowLeftHeadIcon.js create mode 100644 dist/assets/DoubleArrowRightHeadIcon.cjs create mode 100644 dist/assets/DoubleArrowRightHeadIcon.d.ts create mode 100644 dist/assets/DoubleArrowRightHeadIcon.js create mode 100644 dist/assets/ExclamationFilledIcon.cjs create mode 100644 dist/assets/ExclamationFilledIcon.d.ts create mode 100644 dist/assets/ExclamationFilledIcon.js create mode 100644 dist/assets/EyeIcon.cjs create mode 100644 dist/assets/EyeIcon.d.ts create mode 100644 dist/assets/EyeIcon.js create mode 100644 dist/assets/EyeOffIcon.cjs create mode 100644 dist/assets/EyeOffIcon.d.ts create mode 100644 dist/assets/EyeOffIcon.js create mode 100644 dist/assets/LoadingSpinner.cjs create mode 100644 dist/assets/LoadingSpinner.d.ts create mode 100644 dist/assets/LoadingSpinner.js create mode 100644 dist/assets/MinusIcon.cjs create mode 100644 dist/assets/MinusIcon.d.ts create mode 100644 dist/assets/MinusIcon.js create mode 100644 dist/assets/PlusIcon.cjs create mode 100644 dist/assets/PlusIcon.d.ts create mode 100644 dist/assets/PlusIcon.js create mode 100644 dist/assets/SearchIcon.cjs create mode 100644 dist/assets/SearchIcon.d.ts create mode 100644 dist/assets/SearchIcon.js create mode 100644 dist/assets/XCircleIcon.cjs create mode 100644 dist/assets/XCircleIcon.d.ts create mode 100644 dist/assets/XCircleIcon.js create mode 100644 dist/assets/XIcon.cjs create mode 100644 dist/assets/XIcon.d.ts create mode 100644 dist/assets/XIcon.js create mode 100644 dist/assets/index.d.ts create mode 100644 dist/components/chart-elements/AreaChart/AreaChart.cjs create mode 100644 dist/components/chart-elements/AreaChart/AreaChart.d.ts create mode 100644 dist/components/chart-elements/AreaChart/AreaChart.js create mode 100644 dist/components/chart-elements/AreaChart/index.d.ts create mode 100644 dist/components/chart-elements/BarChart/BarChart.cjs create mode 100644 dist/components/chart-elements/BarChart/BarChart.d.ts create mode 100644 dist/components/chart-elements/BarChart/BarChart.js create mode 100644 dist/components/chart-elements/BarChart/index.d.ts create mode 100644 dist/components/chart-elements/DonutChart/DonutChart.cjs create mode 100644 dist/components/chart-elements/DonutChart/DonutChart.d.ts create mode 100644 dist/components/chart-elements/DonutChart/DonutChart.js create mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs create mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts create mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.js create mode 100644 dist/components/chart-elements/DonutChart/index.d.ts create mode 100644 dist/components/chart-elements/DonutChart/inputParser.cjs create mode 100644 dist/components/chart-elements/DonutChart/inputParser.d.ts create mode 100644 dist/components/chart-elements/DonutChart/inputParser.js create mode 100644 dist/components/chart-elements/LineChart/LineChart.cjs create mode 100644 dist/components/chart-elements/LineChart/LineChart.d.ts create mode 100644 dist/components/chart-elements/LineChart/LineChart.js create mode 100644 dist/components/chart-elements/LineChart/index.d.ts create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.cjs create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.d.ts create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.js create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts create mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js create mode 100644 dist/components/chart-elements/ScatterChart/index.d.ts create mode 100644 dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts create mode 100644 dist/components/chart-elements/common/BaseChartProps.d.ts create mode 100644 dist/components/chart-elements/common/ChartLegend.cjs create mode 100644 dist/components/chart-elements/common/ChartLegend.d.ts create mode 100644 dist/components/chart-elements/common/ChartLegend.js create mode 100644 dist/components/chart-elements/common/ChartTooltip.cjs create mode 100644 dist/components/chart-elements/common/ChartTooltip.d.ts create mode 100644 dist/components/chart-elements/common/ChartTooltip.js create mode 100644 dist/components/chart-elements/common/CustomTooltipProps.d.ts create mode 100644 dist/components/chart-elements/common/NoData.cjs create mode 100644 dist/components/chart-elements/common/NoData.d.ts create mode 100644 dist/components/chart-elements/common/NoData.js create mode 100644 dist/components/chart-elements/common/index.d.ts create mode 100644 dist/components/chart-elements/common/utils.cjs create mode 100644 dist/components/chart-elements/common/utils.d.ts create mode 100644 dist/components/chart-elements/common/utils.js create mode 100644 dist/components/chart-elements/index.d.ts create mode 100644 dist/components/icon-elements/Badge/Badge.cjs create mode 100644 dist/components/icon-elements/Badge/Badge.d.ts create mode 100644 dist/components/icon-elements/Badge/Badge.js create mode 100644 dist/components/icon-elements/Badge/index.d.ts create mode 100644 dist/components/icon-elements/Badge/styles.cjs create mode 100644 dist/components/icon-elements/Badge/styles.d.ts create mode 100644 dist/components/icon-elements/Badge/styles.js create mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs create mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts create mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.js create mode 100644 dist/components/icon-elements/BadgeDelta/index.d.ts create mode 100644 dist/components/icon-elements/BadgeDelta/styles.cjs create mode 100644 dist/components/icon-elements/BadgeDelta/styles.d.ts create mode 100644 dist/components/icon-elements/BadgeDelta/styles.js create mode 100644 dist/components/icon-elements/Icon/Icon.cjs create mode 100644 dist/components/icon-elements/Icon/Icon.d.ts create mode 100644 dist/components/icon-elements/Icon/Icon.js create mode 100644 dist/components/icon-elements/Icon/index.d.ts create mode 100644 dist/components/icon-elements/Icon/styles.cjs create mode 100644 dist/components/icon-elements/Icon/styles.d.ts create mode 100644 dist/components/icon-elements/Icon/styles.js create mode 100644 dist/components/icon-elements/index.d.ts create mode 100644 dist/components/index.d.ts create mode 100644 dist/components/input-elements/BaseInput.cjs create mode 100644 dist/components/input-elements/BaseInput.d.ts create mode 100644 dist/components/input-elements/BaseInput.js create mode 100644 dist/components/input-elements/Button/Button.cjs create mode 100644 dist/components/input-elements/Button/Button.d.ts create mode 100644 dist/components/input-elements/Button/Button.js create mode 100644 dist/components/input-elements/Button/index.d.ts create mode 100644 dist/components/input-elements/Button/styles.cjs create mode 100644 dist/components/input-elements/Button/styles.d.ts create mode 100644 dist/components/input-elements/Button/styles.js create mode 100644 dist/components/input-elements/Calendar/Calendar.cjs create mode 100644 dist/components/input-elements/Calendar/Calendar.d.ts create mode 100644 dist/components/input-elements/Calendar/Calendar.js create mode 100644 dist/components/input-elements/Calendar/NavButton.cjs create mode 100644 dist/components/input-elements/Calendar/NavButton.d.ts create mode 100644 dist/components/input-elements/Calendar/NavButton.js create mode 100644 dist/components/input-elements/Calendar/index.d.ts create mode 100644 dist/components/input-elements/DatePicker/DatePicker.cjs create mode 100644 dist/components/input-elements/DatePicker/DatePicker.d.ts create mode 100644 dist/components/input-elements/DatePicker/DatePicker.js create mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.cjs create mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.d.ts create mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.js create mode 100644 dist/components/input-elements/DatePicker/index.d.ts create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.cjs create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.js create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts create mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.js create mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs create mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts create mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js create mode 100644 dist/components/input-elements/DateRangePicker/index.d.ts create mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.cjs create mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.d.ts create mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.js create mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.cjs create mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts create mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.js create mode 100644 dist/components/input-elements/MultiSelect/index.d.ts create mode 100644 dist/components/input-elements/NumberInput/NumberInput.cjs create mode 100644 dist/components/input-elements/NumberInput/NumberInput.d.ts create mode 100644 dist/components/input-elements/NumberInput/NumberInput.js create mode 100644 dist/components/input-elements/NumberInput/index.d.ts create mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.cjs create mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.d.ts create mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.js create mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.cjs create mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts create mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.js create mode 100644 dist/components/input-elements/SearchSelect/index.d.ts create mode 100644 dist/components/input-elements/Select/Select.cjs create mode 100644 dist/components/input-elements/Select/Select.d.ts create mode 100644 dist/components/input-elements/Select/Select.js create mode 100644 dist/components/input-elements/Select/SelectItem.cjs create mode 100644 dist/components/input-elements/Select/SelectItem.d.ts create mode 100644 dist/components/input-elements/Select/SelectItem.js create mode 100644 dist/components/input-elements/Select/index.d.ts create mode 100644 dist/components/input-elements/Switch/Switch.cjs create mode 100644 dist/components/input-elements/Switch/Switch.d.ts create mode 100644 dist/components/input-elements/Switch/Switch.js create mode 100644 dist/components/input-elements/Switch/index.d.ts create mode 100644 dist/components/input-elements/Tabs/Tab.cjs create mode 100644 dist/components/input-elements/Tabs/Tab.d.ts create mode 100644 dist/components/input-elements/Tabs/Tab.js create mode 100644 dist/components/input-elements/Tabs/TabGroup.cjs create mode 100644 dist/components/input-elements/Tabs/TabGroup.d.ts create mode 100644 dist/components/input-elements/Tabs/TabGroup.js create mode 100644 dist/components/input-elements/Tabs/TabList.cjs create mode 100644 dist/components/input-elements/Tabs/TabList.d.ts create mode 100644 dist/components/input-elements/Tabs/TabList.js create mode 100644 dist/components/input-elements/Tabs/TabPanel.cjs create mode 100644 dist/components/input-elements/Tabs/TabPanel.d.ts create mode 100644 dist/components/input-elements/Tabs/TabPanel.js create mode 100644 dist/components/input-elements/Tabs/TabPanels.cjs create mode 100644 dist/components/input-elements/Tabs/TabPanels.d.ts create mode 100644 dist/components/input-elements/Tabs/TabPanels.js create mode 100644 dist/components/input-elements/Tabs/index.d.ts create mode 100644 dist/components/input-elements/TextInput/TextInput.cjs create mode 100644 dist/components/input-elements/TextInput/TextInput.d.ts create mode 100644 dist/components/input-elements/TextInput/TextInput.js create mode 100644 dist/components/input-elements/TextInput/index.d.ts create mode 100644 dist/components/input-elements/Textarea/Textarea.cjs create mode 100644 dist/components/input-elements/Textarea/Textarea.d.ts create mode 100644 dist/components/input-elements/Textarea/Textarea.js create mode 100644 dist/components/input-elements/Textarea/index.d.ts create mode 100644 dist/components/input-elements/index.d.ts create mode 100644 dist/components/input-elements/selectUtils.cjs create mode 100644 dist/components/input-elements/selectUtils.d.ts create mode 100644 dist/components/input-elements/selectUtils.js create mode 100644 dist/components/layout-elements/Accordion/Accordion.cjs create mode 100644 dist/components/layout-elements/Accordion/Accordion.d.ts create mode 100644 dist/components/layout-elements/Accordion/Accordion.js create mode 100644 dist/components/layout-elements/Accordion/AccordionBody.cjs create mode 100644 dist/components/layout-elements/Accordion/AccordionBody.d.ts create mode 100644 dist/components/layout-elements/Accordion/AccordionBody.js create mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.cjs create mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.d.ts create mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.js create mode 100644 dist/components/layout-elements/Accordion/AccordionList.cjs create mode 100644 dist/components/layout-elements/Accordion/AccordionList.d.ts create mode 100644 dist/components/layout-elements/Accordion/AccordionList.js create mode 100644 dist/components/layout-elements/Accordion/index.d.ts create mode 100644 dist/components/layout-elements/Card/Card.cjs create mode 100644 dist/components/layout-elements/Card/Card.d.ts create mode 100644 dist/components/layout-elements/Card/Card.js create mode 100644 dist/components/layout-elements/Card/index.d.ts create mode 100644 dist/components/layout-elements/Dialog/Dialog.cjs create mode 100644 dist/components/layout-elements/Dialog/Dialog.d.ts create mode 100644 dist/components/layout-elements/Dialog/Dialog.js create mode 100644 dist/components/layout-elements/Dialog/DialogPanel.cjs create mode 100644 dist/components/layout-elements/Dialog/DialogPanel.d.ts create mode 100644 dist/components/layout-elements/Dialog/DialogPanel.js create mode 100644 dist/components/layout-elements/Dialog/index.d.ts create mode 100644 dist/components/layout-elements/Divider/Divider.cjs create mode 100644 dist/components/layout-elements/Divider/Divider.d.ts create mode 100644 dist/components/layout-elements/Divider/Divider.js create mode 100644 dist/components/layout-elements/Divider/index.d.ts create mode 100644 dist/components/layout-elements/Flex/Flex.cjs create mode 100644 dist/components/layout-elements/Flex/Flex.d.ts create mode 100644 dist/components/layout-elements/Flex/Flex.js create mode 100644 dist/components/layout-elements/Flex/index.d.ts create mode 100644 dist/components/layout-elements/Grid/Col.cjs create mode 100644 dist/components/layout-elements/Grid/Col.d.ts create mode 100644 dist/components/layout-elements/Grid/Col.js create mode 100644 dist/components/layout-elements/Grid/Grid.cjs create mode 100644 dist/components/layout-elements/Grid/Grid.d.ts create mode 100644 dist/components/layout-elements/Grid/Grid.js create mode 100644 dist/components/layout-elements/Grid/index.d.ts create mode 100644 dist/components/layout-elements/Grid/styles.cjs create mode 100644 dist/components/layout-elements/Grid/styles.d.ts create mode 100644 dist/components/layout-elements/Grid/styles.js create mode 100644 dist/components/layout-elements/index.d.ts create mode 100644 dist/components/list-elements/List/List.cjs create mode 100644 dist/components/list-elements/List/List.d.ts create mode 100644 dist/components/list-elements/List/List.js create mode 100644 dist/components/list-elements/List/ListItem.cjs create mode 100644 dist/components/list-elements/List/ListItem.d.ts create mode 100644 dist/components/list-elements/List/ListItem.js create mode 100644 dist/components/list-elements/List/index.d.ts create mode 100644 dist/components/list-elements/Table/Table.cjs create mode 100644 dist/components/list-elements/Table/Table.d.ts create mode 100644 dist/components/list-elements/Table/Table.js create mode 100644 dist/components/list-elements/Table/TableBody.cjs create mode 100644 dist/components/list-elements/Table/TableBody.d.ts create mode 100644 dist/components/list-elements/Table/TableBody.js create mode 100644 dist/components/list-elements/Table/TableCell.cjs create mode 100644 dist/components/list-elements/Table/TableCell.d.ts create mode 100644 dist/components/list-elements/Table/TableCell.js create mode 100644 dist/components/list-elements/Table/TableFoot.cjs create mode 100644 dist/components/list-elements/Table/TableFoot.d.ts create mode 100644 dist/components/list-elements/Table/TableFoot.js create mode 100644 dist/components/list-elements/Table/TableFooterCell.cjs create mode 100644 dist/components/list-elements/Table/TableFooterCell.d.ts create mode 100644 dist/components/list-elements/Table/TableFooterCell.js create mode 100644 dist/components/list-elements/Table/TableHead.cjs create mode 100644 dist/components/list-elements/Table/TableHead.d.ts create mode 100644 dist/components/list-elements/Table/TableHead.js create mode 100644 dist/components/list-elements/Table/TableHeaderCell.cjs create mode 100644 dist/components/list-elements/Table/TableHeaderCell.d.ts create mode 100644 dist/components/list-elements/Table/TableHeaderCell.js create mode 100644 dist/components/list-elements/Table/TableRow.cjs create mode 100644 dist/components/list-elements/Table/TableRow.d.ts create mode 100644 dist/components/list-elements/Table/TableRow.js create mode 100644 dist/components/list-elements/Table/index.d.ts create mode 100644 dist/components/list-elements/index.d.ts create mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs create mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts create mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js create mode 100644 dist/components/spark-elements/SparkAreaChart/index.d.ts create mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs create mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts create mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.js create mode 100644 dist/components/spark-elements/SparkBarChart/index.d.ts create mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs create mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts create mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.js create mode 100644 dist/components/spark-elements/SparkLineChart/index.d.ts create mode 100644 dist/components/spark-elements/common/BaseSparkChartProps.d.ts create mode 100644 dist/components/spark-elements/index.d.ts create mode 100644 dist/components/text-elements/Bold/Bold.cjs create mode 100644 dist/components/text-elements/Bold/Bold.d.ts create mode 100644 dist/components/text-elements/Bold/Bold.js create mode 100644 dist/components/text-elements/Bold/index.d.ts create mode 100644 dist/components/text-elements/Callout/Callout.cjs create mode 100644 dist/components/text-elements/Callout/Callout.d.ts create mode 100644 dist/components/text-elements/Callout/Callout.js create mode 100644 dist/components/text-elements/Callout/index.d.ts create mode 100644 dist/components/text-elements/Italic/Italic.cjs create mode 100644 dist/components/text-elements/Italic/Italic.d.ts create mode 100644 dist/components/text-elements/Italic/Italic.js create mode 100644 dist/components/text-elements/Italic/index.d.ts create mode 100644 dist/components/text-elements/Legend/Legend.cjs create mode 100644 dist/components/text-elements/Legend/Legend.d.ts create mode 100644 dist/components/text-elements/Legend/Legend.js create mode 100644 dist/components/text-elements/Legend/index.d.ts create mode 100644 dist/components/text-elements/Metric/Metric.cjs create mode 100644 dist/components/text-elements/Metric/Metric.d.ts create mode 100644 dist/components/text-elements/Metric/Metric.js create mode 100644 dist/components/text-elements/Metric/index.d.ts create mode 100644 dist/components/text-elements/Subtitle/Subtitle.cjs create mode 100644 dist/components/text-elements/Subtitle/Subtitle.d.ts create mode 100644 dist/components/text-elements/Subtitle/Subtitle.js create mode 100644 dist/components/text-elements/Subtitle/index.d.ts create mode 100644 dist/components/text-elements/Text/Text.cjs create mode 100644 dist/components/text-elements/Text/Text.d.ts create mode 100644 dist/components/text-elements/Text/Text.js create mode 100644 dist/components/text-elements/Text/index.d.ts create mode 100644 dist/components/text-elements/Title/Title.cjs create mode 100644 dist/components/text-elements/Title/Title.d.ts create mode 100644 dist/components/text-elements/Title/Title.js create mode 100644 dist/components/text-elements/Title/index.d.ts create mode 100644 dist/components/text-elements/index.d.ts create mode 100644 dist/components/util-elements/Tooltip/Tooltip.cjs create mode 100644 dist/components/util-elements/Tooltip/Tooltip.d.ts create mode 100644 dist/components/util-elements/Tooltip/Tooltip.js create mode 100644 dist/components/util-elements/Tooltip/index.d.ts create mode 100644 dist/components/util-elements/index.d.ts create mode 100644 dist/components/vis-elements/BarList/BarList.cjs create mode 100644 dist/components/vis-elements/BarList/BarList.d.ts create mode 100644 dist/components/vis-elements/BarList/BarList.js create mode 100644 dist/components/vis-elements/BarList/index.d.ts create mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.cjs create mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.d.ts create mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.js create mode 100644 dist/components/vis-elements/CategoryBar/index.d.ts create mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.cjs create mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.d.ts create mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.js create mode 100644 dist/components/vis-elements/DeltaBar/index.d.ts create mode 100644 dist/components/vis-elements/DeltaBar/styles.cjs create mode 100644 dist/components/vis-elements/DeltaBar/styles.d.ts create mode 100644 dist/components/vis-elements/DeltaBar/styles.js create mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.cjs create mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.d.ts create mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.js create mode 100644 dist/components/vis-elements/MarkerBar/index.d.ts create mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.cjs create mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.d.ts create mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.js create mode 100644 dist/components/vis-elements/ProgressBar/index.d.ts create mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs create mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts create mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.js create mode 100644 dist/components/vis-elements/ProgressCircle/index.d.ts create mode 100644 dist/components/vis-elements/Tracker/Tracker.cjs create mode 100644 dist/components/vis-elements/Tracker/Tracker.d.ts create mode 100644 dist/components/vis-elements/Tracker/Tracker.js create mode 100644 dist/components/vis-elements/Tracker/index.d.ts create mode 100644 dist/components/vis-elements/index.d.ts create mode 100644 dist/contexts/BaseColorContext.cjs create mode 100644 dist/contexts/BaseColorContext.d.ts create mode 100644 dist/contexts/BaseColorContext.js create mode 100644 dist/contexts/IndexContext.cjs create mode 100644 dist/contexts/IndexContext.d.ts create mode 100644 dist/contexts/IndexContext.js create mode 100644 dist/contexts/RootStylesContext.cjs create mode 100644 dist/contexts/RootStylesContext.d.ts create mode 100644 dist/contexts/RootStylesContext.js create mode 100644 dist/contexts/SelectedValueContext.cjs create mode 100644 dist/contexts/SelectedValueContext.d.ts create mode 100644 dist/contexts/SelectedValueContext.js create mode 100644 dist/contexts/index.d.ts create mode 100644 dist/hooks/index.d.ts create mode 100644 dist/hooks/useInternalState.cjs create mode 100644 dist/hooks/useInternalState.d.ts create mode 100644 dist/hooks/useInternalState.js create mode 100644 dist/hooks/useOnWindowResize.cjs create mode 100644 dist/hooks/useOnWindowResize.d.ts create mode 100644 dist/hooks/useOnWindowResize.js create mode 100644 dist/index.cjs create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/lib/constants.cjs create mode 100644 dist/lib/constants.d.ts create mode 100644 dist/lib/constants.js create mode 100644 dist/lib/index.d.ts create mode 100644 dist/lib/inputTypes.cjs create mode 100644 dist/lib/inputTypes.d.ts create mode 100644 dist/lib/inputTypes.js create mode 100644 dist/lib/theme.cjs create mode 100644 dist/lib/theme.d.ts create mode 100644 dist/lib/theme.js create mode 100644 dist/lib/tremorTwMerge.cjs create mode 100644 dist/lib/tremorTwMerge.d.ts create mode 100644 dist/lib/tremorTwMerge.js create mode 100644 dist/lib/utils.cjs create mode 100644 dist/lib/utils.d.ts create mode 100644 dist/lib/utils.js diff --git a/.gitignore b/.gitignore index fc740099e..261960448 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules -dist .DS_Store storybook-static package-lock.json diff --git a/dist/assets/ArrowDownHeadIcon.cjs b/dist/assets/ArrowDownHeadIcon.cjs new file mode 100644 index 000000000..c72e8f62f --- /dev/null +++ b/dist/assets/ArrowDownHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}; diff --git a/dist/assets/ArrowDownHeadIcon.d.ts b/dist/assets/ArrowDownHeadIcon.d.ts new file mode 100644 index 000000000..43612cc39 --- /dev/null +++ b/dist/assets/ArrowDownHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowDownHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowDownHeadIcon; diff --git a/dist/assets/ArrowDownHeadIcon.js b/dist/assets/ArrowDownHeadIcon.js new file mode 100644 index 000000000..60458ee57 --- /dev/null +++ b/dist/assets/ArrowDownHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))};export{r as default}; diff --git a/dist/assets/ArrowDownIcon.cjs b/dist/assets/ArrowDownIcon.cjs new file mode 100644 index 000000000..8211f75a3 --- /dev/null +++ b/dist/assets/ArrowDownIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))}; diff --git a/dist/assets/ArrowDownIcon.d.ts b/dist/assets/ArrowDownIcon.d.ts new file mode 100644 index 000000000..c363446e3 --- /dev/null +++ b/dist/assets/ArrowDownIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowDownIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowDownIcon; diff --git a/dist/assets/ArrowDownIcon.js b/dist/assets/ArrowDownIcon.js new file mode 100644 index 000000000..b88a6f827 --- /dev/null +++ b/dist/assets/ArrowDownIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))};export{r as default}; diff --git a/dist/assets/ArrowDownRightIcon.cjs b/dist/assets/ArrowDownRightIcon.cjs new file mode 100644 index 000000000..b094aa9bf --- /dev/null +++ b/dist/assets/ArrowDownRightIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))}; diff --git a/dist/assets/ArrowDownRightIcon.d.ts b/dist/assets/ArrowDownRightIcon.d.ts new file mode 100644 index 000000000..23b82cec1 --- /dev/null +++ b/dist/assets/ArrowDownRightIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowDownRightIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowDownRightIcon; diff --git a/dist/assets/ArrowDownRightIcon.js b/dist/assets/ArrowDownRightIcon.js new file mode 100644 index 000000000..c658a7410 --- /dev/null +++ b/dist/assets/ArrowDownRightIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))};export{r as default}; diff --git a/dist/assets/ArrowLeftHeadIcon.cjs b/dist/assets/ArrowLeftHeadIcon.cjs new file mode 100644 index 000000000..11da8c4fa --- /dev/null +++ b/dist/assets/ArrowLeftHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))}; diff --git a/dist/assets/ArrowLeftHeadIcon.d.ts b/dist/assets/ArrowLeftHeadIcon.d.ts new file mode 100644 index 000000000..7f5dd0401 --- /dev/null +++ b/dist/assets/ArrowLeftHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowLeftHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowLeftHeadIcon; diff --git a/dist/assets/ArrowLeftHeadIcon.js b/dist/assets/ArrowLeftHeadIcon.js new file mode 100644 index 000000000..38af406a7 --- /dev/null +++ b/dist/assets/ArrowLeftHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))};export{r as default}; diff --git a/dist/assets/ArrowRightHeadIcon.cjs b/dist/assets/ArrowRightHeadIcon.cjs new file mode 100644 index 000000000..6751a61dd --- /dev/null +++ b/dist/assets/ArrowRightHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))}; diff --git a/dist/assets/ArrowRightHeadIcon.d.ts b/dist/assets/ArrowRightHeadIcon.d.ts new file mode 100644 index 000000000..81b62f30c --- /dev/null +++ b/dist/assets/ArrowRightHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowRightHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowRightHeadIcon; diff --git a/dist/assets/ArrowRightHeadIcon.js b/dist/assets/ArrowRightHeadIcon.js new file mode 100644 index 000000000..5cfcd3964 --- /dev/null +++ b/dist/assets/ArrowRightHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))};export{r as default}; diff --git a/dist/assets/ArrowRightIcon.cjs b/dist/assets/ArrowRightIcon.cjs new file mode 100644 index 000000000..781d941b8 --- /dev/null +++ b/dist/assets/ArrowRightIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}; diff --git a/dist/assets/ArrowRightIcon.d.ts b/dist/assets/ArrowRightIcon.d.ts new file mode 100644 index 000000000..3d49d01c2 --- /dev/null +++ b/dist/assets/ArrowRightIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowRightIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowRightIcon; diff --git a/dist/assets/ArrowRightIcon.js b/dist/assets/ArrowRightIcon.js new file mode 100644 index 000000000..b94686307 --- /dev/null +++ b/dist/assets/ArrowRightIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpHeadIcon.cjs b/dist/assets/ArrowUpHeadIcon.cjs new file mode 100644 index 000000000..87d9bc663 --- /dev/null +++ b/dist/assets/ArrowUpHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))}; diff --git a/dist/assets/ArrowUpHeadIcon.d.ts b/dist/assets/ArrowUpHeadIcon.d.ts new file mode 100644 index 000000000..36f4a93f3 --- /dev/null +++ b/dist/assets/ArrowUpHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowUpHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowUpHeadIcon; diff --git a/dist/assets/ArrowUpHeadIcon.js b/dist/assets/ArrowUpHeadIcon.js new file mode 100644 index 000000000..311187f75 --- /dev/null +++ b/dist/assets/ArrowUpHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpIcon.cjs b/dist/assets/ArrowUpIcon.cjs new file mode 100644 index 000000000..dddda2604 --- /dev/null +++ b/dist/assets/ArrowUpIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))}; diff --git a/dist/assets/ArrowUpIcon.d.ts b/dist/assets/ArrowUpIcon.d.ts new file mode 100644 index 000000000..29eafd8ba --- /dev/null +++ b/dist/assets/ArrowUpIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowUpIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowUpIcon; diff --git a/dist/assets/ArrowUpIcon.js b/dist/assets/ArrowUpIcon.js new file mode 100644 index 000000000..0423fb2e5 --- /dev/null +++ b/dist/assets/ArrowUpIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpRightIcon.cjs b/dist/assets/ArrowUpRightIcon.cjs new file mode 100644 index 000000000..38bb56285 --- /dev/null +++ b/dist/assets/ArrowUpRightIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))}; diff --git a/dist/assets/ArrowUpRightIcon.d.ts b/dist/assets/ArrowUpRightIcon.d.ts new file mode 100644 index 000000000..0c9bc33ba --- /dev/null +++ b/dist/assets/ArrowUpRightIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ArrowUpRightIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ArrowUpRightIcon; diff --git a/dist/assets/ArrowUpRightIcon.js b/dist/assets/ArrowUpRightIcon.js new file mode 100644 index 000000000..ca81a63ec --- /dev/null +++ b/dist/assets/ArrowUpRightIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))};export{r as default}; diff --git a/dist/assets/CalendarIcon.cjs b/dist/assets/CalendarIcon.cjs new file mode 100644 index 000000000..aa8be6bc2 --- /dev/null +++ b/dist/assets/CalendarIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));module.exports=t=>{var r=e.__rest(t,[]);return a.default.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),a.default.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))}; diff --git a/dist/assets/CalendarIcon.d.ts b/dist/assets/CalendarIcon.d.ts new file mode 100644 index 000000000..0d56ab56f --- /dev/null +++ b/dist/assets/CalendarIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const CalendarIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default CalendarIcon; diff --git a/dist/assets/CalendarIcon.js b/dist/assets/CalendarIcon.js new file mode 100644 index 000000000..9c03cd8b5 --- /dev/null +++ b/dist/assets/CalendarIcon.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import a from"react";const t=t=>{var r=e(t,[]);return a.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};export{t as default}; diff --git a/dist/assets/ChevronLeftFill.cjs b/dist/assets/ChevronLeftFill.cjs new file mode 100644 index 000000000..7c59e53c7 --- /dev/null +++ b/dist/assets/ChevronLeftFill.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))}; diff --git a/dist/assets/ChevronLeftFill.d.ts b/dist/assets/ChevronLeftFill.d.ts new file mode 100644 index 000000000..f49f06f16 --- /dev/null +++ b/dist/assets/ChevronLeftFill.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ChevronLeftFill: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ChevronLeftFill; diff --git a/dist/assets/ChevronLeftFill.js b/dist/assets/ChevronLeftFill.js new file mode 100644 index 000000000..b3373066f --- /dev/null +++ b/dist/assets/ChevronLeftFill.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),e.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))};export{r as default}; diff --git a/dist/assets/ChevronRightFill.cjs b/dist/assets/ChevronRightFill.cjs new file mode 100644 index 000000000..d122731cc --- /dev/null +++ b/dist/assets/ChevronRightFill.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))}; diff --git a/dist/assets/ChevronRightFill.d.ts b/dist/assets/ChevronRightFill.d.ts new file mode 100644 index 000000000..66517e709 --- /dev/null +++ b/dist/assets/ChevronRightFill.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ChevronRightFill: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ChevronRightFill; diff --git a/dist/assets/ChevronRightFill.js b/dist/assets/ChevronRightFill.js new file mode 100644 index 000000000..fcb71f82f --- /dev/null +++ b/dist/assets/ChevronRightFill.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),e.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))};export{r as default}; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.cjs b/dist/assets/DoubleArrowLeftHeadIcon.cjs new file mode 100644 index 000000000..fbaeb0588 --- /dev/null +++ b/dist/assets/DoubleArrowLeftHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))}; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.d.ts b/dist/assets/DoubleArrowLeftHeadIcon.d.ts new file mode 100644 index 000000000..076c001b1 --- /dev/null +++ b/dist/assets/DoubleArrowLeftHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const DoubleArrowLeftHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default DoubleArrowLeftHeadIcon; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.js b/dist/assets/DoubleArrowLeftHeadIcon.js new file mode 100644 index 000000000..88f422c53 --- /dev/null +++ b/dist/assets/DoubleArrowLeftHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))};export{r as default}; diff --git a/dist/assets/DoubleArrowRightHeadIcon.cjs b/dist/assets/DoubleArrowRightHeadIcon.cjs new file mode 100644 index 000000000..1b3372e81 --- /dev/null +++ b/dist/assets/DoubleArrowRightHeadIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))}; diff --git a/dist/assets/DoubleArrowRightHeadIcon.d.ts b/dist/assets/DoubleArrowRightHeadIcon.d.ts new file mode 100644 index 000000000..323418b14 --- /dev/null +++ b/dist/assets/DoubleArrowRightHeadIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const DoubleArrowRightHeadIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default DoubleArrowRightHeadIcon; diff --git a/dist/assets/DoubleArrowRightHeadIcon.js b/dist/assets/DoubleArrowRightHeadIcon.js new file mode 100644 index 000000000..7ce2f404d --- /dev/null +++ b/dist/assets/DoubleArrowRightHeadIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};export{r as default}; diff --git a/dist/assets/ExclamationFilledIcon.cjs b/dist/assets/ExclamationFilledIcon.cjs new file mode 100644 index 000000000..265820234 --- /dev/null +++ b/dist/assets/ExclamationFilledIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))}; diff --git a/dist/assets/ExclamationFilledIcon.d.ts b/dist/assets/ExclamationFilledIcon.d.ts new file mode 100644 index 000000000..60229f1f9 --- /dev/null +++ b/dist/assets/ExclamationFilledIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const ExclamationFilledIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default ExclamationFilledIcon; diff --git a/dist/assets/ExclamationFilledIcon.js b/dist/assets/ExclamationFilledIcon.js new file mode 100644 index 000000000..0003a70a3 --- /dev/null +++ b/dist/assets/ExclamationFilledIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))};export{r as default}; diff --git a/dist/assets/EyeIcon.cjs b/dist/assets/EyeIcon.cjs new file mode 100644 index 000000000..669ef5b8c --- /dev/null +++ b/dist/assets/EyeIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var C=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),r.default.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))}; diff --git a/dist/assets/EyeIcon.d.ts b/dist/assets/EyeIcon.d.ts new file mode 100644 index 000000000..1f1551480 --- /dev/null +++ b/dist/assets/EyeIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const EyeIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default EyeIcon; diff --git a/dist/assets/EyeIcon.js b/dist/assets/EyeIcon.js new file mode 100644 index 000000000..85aa0584f --- /dev/null +++ b/dist/assets/EyeIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var C=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),e.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))};export{r as default}; diff --git a/dist/assets/EyeOffIcon.cjs b/dist/assets/EyeOffIcon.cjs new file mode 100644 index 000000000..5bfa4473d --- /dev/null +++ b/dist/assets/EyeOffIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var C=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),r.default.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))}; diff --git a/dist/assets/EyeOffIcon.d.ts b/dist/assets/EyeOffIcon.d.ts new file mode 100644 index 000000000..158706c66 --- /dev/null +++ b/dist/assets/EyeOffIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const EyeOffIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default EyeOffIcon; diff --git a/dist/assets/EyeOffIcon.js b/dist/assets/EyeOffIcon.js new file mode 100644 index 000000000..ae89ea554 --- /dev/null +++ b/dist/assets/EyeOffIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import C from"react";const e=e=>{var r=t(e,[]);return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),C.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};export{e as default}; diff --git a/dist/assets/LoadingSpinner.cjs b/dist/assets/LoadingSpinner.cjs new file mode 100644 index 000000000..96d8fde14 --- /dev/null +++ b/dist/assets/LoadingSpinner.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),r.default.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))}; diff --git a/dist/assets/LoadingSpinner.d.ts b/dist/assets/LoadingSpinner.d.ts new file mode 100644 index 000000000..bf2a7001f --- /dev/null +++ b/dist/assets/LoadingSpinner.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const LoadingSpinner: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default LoadingSpinner; diff --git a/dist/assets/LoadingSpinner.js b/dist/assets/LoadingSpinner.js new file mode 100644 index 000000000..ae0e7f1ba --- /dev/null +++ b/dist/assets/LoadingSpinner.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";const r=r=>{var a=e(r,[]);return t.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),t.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};export{r as default}; diff --git a/dist/assets/MinusIcon.cjs b/dist/assets/MinusIcon.cjs new file mode 100644 index 000000000..e19b73e35 --- /dev/null +++ b/dist/assets/MinusIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M20 12H4"}))}; diff --git a/dist/assets/MinusIcon.d.ts b/dist/assets/MinusIcon.d.ts new file mode 100644 index 000000000..4000a1700 --- /dev/null +++ b/dist/assets/MinusIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const MinusIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default MinusIcon; diff --git a/dist/assets/MinusIcon.js b/dist/assets/MinusIcon.js new file mode 100644 index 000000000..2bc156e08 --- /dev/null +++ b/dist/assets/MinusIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),e.createElement("path",{d:"M20 12H4"}))};export{r as default}; diff --git a/dist/assets/PlusIcon.cjs b/dist/assets/PlusIcon.cjs new file mode 100644 index 000000000..c9f769311 --- /dev/null +++ b/dist/assets/PlusIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M12 4v16m8-8H4"}))}; diff --git a/dist/assets/PlusIcon.d.ts b/dist/assets/PlusIcon.d.ts new file mode 100644 index 000000000..bee5c6677 --- /dev/null +++ b/dist/assets/PlusIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const PlusIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default PlusIcon; diff --git a/dist/assets/PlusIcon.js b/dist/assets/PlusIcon.js new file mode 100644 index 000000000..dc1c8b33b --- /dev/null +++ b/dist/assets/PlusIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),e.createElement("path",{d:"M12 4v16m8-8H4"}))};export{r as default}; diff --git a/dist/assets/SearchIcon.cjs b/dist/assets/SearchIcon.cjs new file mode 100644 index 000000000..5e97f58a4 --- /dev/null +++ b/dist/assets/SearchIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))}; diff --git a/dist/assets/SearchIcon.d.ts b/dist/assets/SearchIcon.d.ts new file mode 100644 index 000000000..40f5eb7bc --- /dev/null +++ b/dist/assets/SearchIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const SearchIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default SearchIcon; diff --git a/dist/assets/SearchIcon.js b/dist/assets/SearchIcon.js new file mode 100644 index 000000000..347365cec --- /dev/null +++ b/dist/assets/SearchIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var C=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),e.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};export{r as default}; diff --git a/dist/assets/XCircleIcon.cjs b/dist/assets/XCircleIcon.cjs new file mode 100644 index 000000000..241ae2b17 --- /dev/null +++ b/dist/assets/XCircleIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}; diff --git a/dist/assets/XCircleIcon.d.ts b/dist/assets/XCircleIcon.d.ts new file mode 100644 index 000000000..3ea3c2bc4 --- /dev/null +++ b/dist/assets/XCircleIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const XCircleIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default XCircleIcon; diff --git a/dist/assets/XCircleIcon.js b/dist/assets/XCircleIcon.js new file mode 100644 index 000000000..5fd1dd05d --- /dev/null +++ b/dist/assets/XCircleIcon.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))};export{r as default}; diff --git a/dist/assets/XIcon.cjs b/dist/assets/XIcon.cjs new file mode 100644 index 000000000..9ab5ca623 --- /dev/null +++ b/dist/assets/XIcon.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var n=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n),r.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))}; diff --git a/dist/assets/XIcon.d.ts b/dist/assets/XIcon.d.ts new file mode 100644 index 000000000..ffb48538a --- /dev/null +++ b/dist/assets/XIcon.d.ts @@ -0,0 +1,5 @@ +import React from "react"; +declare const XIcon: ({ ...props }: { + [x: string]: any; +}) => React.JSX.Element; +export default XIcon; diff --git a/dist/assets/XIcon.js b/dist/assets/XIcon.js new file mode 100644 index 000000000..279a09ead --- /dev/null +++ b/dist/assets/XIcon.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";const r=r=>{var o=e(r,[]);return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};export{r as default}; diff --git a/dist/assets/index.d.ts b/dist/assets/index.d.ts new file mode 100644 index 000000000..8480713d1 --- /dev/null +++ b/dist/assets/index.d.ts @@ -0,0 +1,22 @@ +export { default as ArrowDownHeadIcon } from "./ArrowDownHeadIcon"; +export { default as ArrowDownIcon } from "./ArrowDownIcon"; +export { default as ArrowDownRightIcon } from "./ArrowDownRightIcon"; +export { default as ArrowLeftHeadIcon } from "./ArrowLeftHeadIcon"; +export { default as ArrowRightHeadIcon } from "./ArrowRightHeadIcon"; +export { default as ArrowRightIcon } from "./ArrowRightIcon"; +export { default as ArrowUpHeadIcon } from "./ArrowUpHeadIcon"; +export { default as ArrowUpIcon } from "./ArrowUpIcon"; +export { default as ArrowUpRightIcon } from "./ArrowUpRightIcon"; +export { default as CalendarIcon } from "./CalendarIcon"; +export { default as DoubleArrowLeftHeadIcon } from "./DoubleArrowLeftHeadIcon"; +export { default as DoubleArrowRightHeadIcon } from "./DoubleArrowRightHeadIcon"; +export { default as ExclamationFilledIcon } from "./ExclamationFilledIcon"; +export { default as EyeIcon } from "./EyeIcon"; +export { default as EyeOffIcon } from "./EyeOffIcon"; +export { default as LoadingSpinner } from "./LoadingSpinner"; +export { default as SearchIcon } from "./SearchIcon"; +export { default as XCircleIcon } from "./XCircleIcon"; +export { default as PlusIcon } from "./PlusIcon"; +export { default as MinusIcon } from "./MinusIcon"; +export { default as ChevronLeftFill } from "./ChevronLeftFill"; +export { default as ChevronRightFill } from "./ChevronRightFill"; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.cjs b/dist/components/chart-elements/AreaChart/AreaChart.cjs new file mode 100644 index 000000000..dd49c7527 --- /dev/null +++ b/dist/components/chart-elements/AreaChart/AreaChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../common/ChartLegend.cjs"),o=require("../common/ChartTooltip.cjs"),l=require("../common/NoData.cjs"),n=require("../common/utils.cjs"),i=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),d=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(t);const y=m.default.forwardRef(((u,y)=>{const{data:k=[],categories:p=[],index:g,stack:f=!1,colors:v=s.themeColorRange,valueFormatter:h=c.defaultValueFormatter,startEndOnly:x=!1,showXAxis:C=!0,showYAxis:w=!0,yAxisWidth:T=56,intervalType:b="equidistantPreserveStart",showAnimation:E=!1,animationDuration:L=900,showTooltip:N=!0,showLegend:A=!0,showGridLines:K=!0,showGradient:j=!0,autoMinValue:O=!1,curveType:G="linear",minValue:D,maxValue:q,connectNulls:V=!1,allowDecimals:F=!0,noDataText:M,className:S,onValueChange:W,enableLegendSlider:P=!1,customTooltip:B,rotateLabelX:X,tickGap:Y=5}=u,R=e.__rest(u,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),_=B,z=!C&&!w||x&&!w?0:20,[H,I]=t.useState(60),[$,J]=t.useState(void 0),[Q,U]=t.useState(void 0),Z=n.constructCategoryColors(p,v),ee=n.getYAxisDomain(O,D,q),te=!!W;function ae(e){te&&(e===Q&&!$||n.hasOnlyOneValueForThisKey(k,e)&&$&&$.dataKey===e?(U(void 0),null==W||W(null)):(U(e),null==W||W({eventType:"category",categoryClicked:e})),J(void 0))}return m.default.createElement("div",Object.assign({ref:y,className:d.tremorTwMerge("w-full h-80",S)},R),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==k?void 0:k.length)?m.default.createElement(a.AreaChart,{data:k,onClick:te&&(Q||$)?()=>{J(void 0),U(void 0),null==W||W(null)}:void 0},K?m.default.createElement(a.CartesianGrid,{className:d.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,m.default.createElement(a.XAxis,{padding:{left:z,right:z},hide:!C,dataKey:g,tick:{transform:"translate(0, 6)"},ticks:x?[k[0][g],k[k.length-1][g]]:void 0,fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:x?"preserveStartEnd":b,tickLine:!1,axisLine:!1,minTickGap:Y,angle:null==X?void 0:X.angle,dy:null==X?void 0:X.verticalShift,height:null==X?void 0:X.xAxisHeight}),m.default.createElement(a.YAxis,{width:T,hide:!w,axisLine:!1,tickLine:!1,type:"number",domain:ee,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:h,allowDecimals:F}),m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:N?({active:e,payload:t,label:a})=>_?m.default.createElement(_,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=Z.get(e.dataKey))&&void 0!==t?t:i.BaseColors.Gray})})),active:e,label:a}):m.default.createElement(o.default,{active:e,payload:t,label:a,valueFormatter:h,categoryColors:Z}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),A?m.default.createElement(a.Legend,{verticalAlign:"top",height:H,content:({payload:e})=>r({payload:e},Z,I,Q,te?e=>ae(e):void 0,P)}):null,p.map((e=>{var t,a;return m.default.createElement("defs",{key:e},j?m.default.createElement("linearGradient",{className:c.getColorClassNames(null!==(t=Z.get(e))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).textColor,id:Z.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},m.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:$||Q&&Q!==e?.15:.4}),m.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):m.default.createElement("linearGradient",{className:c.getColorClassNames(null!==(a=Z.get(e))&&void 0!==a?a:i.BaseColors.Gray,s.colorPalette.text).textColor,id:Z.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},m.default.createElement("stop",{stopColor:"currentColor",stopOpacity:$||Q&&Q!==e?.1:.3})))})),p.map((e=>{var r;return m.default.createElement(a.Area,{className:c.getColorClassNames(null!==(r=Z.get(e))&&void 0!==r?r:i.BaseColors.Gray,s.colorPalette.text).strokeColor,strokeOpacity:$||Q&&Q!==e?.3:1,activeDot:e=>{var t;const{cx:r,cy:o,stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,dataKey:g}=e;return m.default.createElement(a.Dot,{className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",c.getColorClassNames(null!==(t=Z.get(g))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,onClick:(t,a)=>function(e,t){t.stopPropagation(),te&&(e.index===(null==$?void 0:$.index)&&e.dataKey===(null==$?void 0:$.dataKey)||n.hasOnlyOneValueForThisKey(k,e.dataKey)&&Q&&Q===e.dataKey?(U(void 0),J(void 0),null==W||W(null)):(U(e.dataKey),J({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:r=>{var o;const{stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,cx:g,cy:f,dataKey:v,index:h}=r;return n.hasOnlyOneValueForThisKey(k,e)&&!($||Q&&Q!==e)||(null==$?void 0:$.index)===h&&(null==$?void 0:$.dataKey)===e?m.default.createElement(a.Dot,{key:h,cx:g,cy:f,r:5,stroke:l,fill:"",strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",c.getColorClassNames(null!==(o=Z.get(v))&&void 0!==o?o:i.BaseColors.Gray,s.colorPalette.text).fillColor)}):m.default.createElement(t.Fragment,{key:h})},key:e,name:e,type:G,dataKey:e,stroke:"",fill:`url(#${Z.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:E,animationDuration:L,stackId:f?"a":void 0,connectNulls:V})})),W?p.map((e=>m.default.createElement(a.Line,{className:d.tremorTwMerge("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:G,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:V,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ae(a)}}))):null):m.default.createElement(l,{noDataText:M})))}));y.displayName="AreaChart",module.exports=y; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.d.ts b/dist/components/chart-elements/AreaChart/AreaChart.d.ts new file mode 100644 index 000000000..595f1e10c --- /dev/null +++ b/dist/components/chart-elements/AreaChart/AreaChart.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +import BaseChartProps from "../common/BaseChartProps"; +import { CurveType } from "../../../lib/inputTypes"; +export interface AreaChartProps extends BaseChartProps { + stack?: boolean; + curveType?: CurveType; + connectNulls?: boolean; + showGradient?: boolean; +} +declare const AreaChart: React.ForwardRefExoticComponent>; +export default AreaChart; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.js b/dist/components/chart-elements/AreaChart/AreaChart.js new file mode 100644 index 000000000..f334a3e31 --- /dev/null +++ b/dist/components/chart-elements/AreaChart/AreaChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useState as o,Fragment as a}from"react";import{ResponsiveContainer as r,AreaChart as l,CartesianGrid as n,XAxis as i,YAxis as s,Tooltip as c,Legend as d,Area as m,Dot as u,Line as p}from"recharts";import k from"../common/ChartLegend.js";import y from"../common/ChartTooltip.js";import v from"../common/NoData.js";import{constructCategoryColors as h,hasOnlyOneValueForThisKey as g,getYAxisDomain as f}from"../common/utils.js";import{BaseColors as x}from"../../../lib/constants.js";import{themeColorRange as b,colorPalette as E}from"../../../lib/theme.js";import{tremorTwMerge as w}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as C,defaultValueFormatter as L}from"../../../lib/utils.js";const N=t.forwardRef(((N,T)=>{const{data:j=[],categories:A=[],index:K,stack:G=!1,colors:D=b,valueFormatter:O=L,startEndOnly:W=!1,showXAxis:V=!0,showYAxis:S=!0,yAxisWidth:F=56,intervalType:X="equidistantPreserveStart",showAnimation:M=!1,animationDuration:P=900,showTooltip:Y=!0,showLegend:q=!0,showGridLines:z=!0,showGradient:H=!0,autoMinValue:I=!1,curveType:R="linear",minValue:$,maxValue:B,connectNulls:J=!1,allowDecimals:Q=!0,noDataText:U,className:Z,onValueChange:_,enableLegendSlider:ee=!1,customTooltip:te,rotateLabelX:oe,tickGap:ae=5}=N,re=e(N,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),le=te,ne=!V&&!S||W&&!S?0:20,[ie,se]=o(60),[ce,de]=o(void 0),[me,ue]=o(void 0),pe=h(A,D),ke=f(I,$,B),ye=!!_;function ve(e){ye&&(e===me&&!ce||g(j,e)&&ce&&ce.dataKey===e?(ue(void 0),null==_||_(null)):(ue(e),null==_||_({eventType:"category",categoryClicked:e})),de(void 0))}return t.createElement("div",Object.assign({ref:T,className:w("w-full h-80",Z)},re),t.createElement(r,{className:"h-full w-full"},(null==j?void 0:j.length)?t.createElement(l,{data:j,onClick:ye&&(me||ce)?()=>{de(void 0),ue(void 0),null==_||_(null)}:void 0},z?t.createElement(n,{className:w("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,t.createElement(i,{padding:{left:ne,right:ne},hide:!V,dataKey:K,tick:{transform:"translate(0, 6)"},ticks:W?[j[0][K],j[j.length-1][K]]:void 0,fill:"",stroke:"",className:w("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:W?"preserveStartEnd":X,tickLine:!1,axisLine:!1,minTickGap:ae,angle:null==oe?void 0:oe.angle,dy:null==oe?void 0:oe.verticalShift,height:null==oe?void 0:oe.xAxisHeight}),t.createElement(s,{width:F,hide:!S,axisLine:!1,tickLine:!1,type:"number",domain:ke,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:w("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:Q}),t.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:Y?({active:e,payload:o,label:a})=>le?t.createElement(le,{payload:null==o?void 0:o.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=pe.get(e.dataKey))&&void 0!==t?t:x.Gray})})),active:e,label:a}):t.createElement(y,{active:e,payload:o,label:a,valueFormatter:O,categoryColors:pe}):t.createElement(t.Fragment,null),position:{y:0}}),q?t.createElement(d,{verticalAlign:"top",height:ie,content:({payload:e})=>k({payload:e},pe,se,me,ye?e=>ve(e):void 0,ee)}):null,A.map((e=>{var o,a;return t.createElement("defs",{key:e},H?t.createElement("linearGradient",{className:C(null!==(o=pe.get(e))&&void 0!==o?o:x.Gray,E.text).textColor,id:pe.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:ce||me&&me!==e?.15:.4}),t.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):t.createElement("linearGradient",{className:C(null!==(a=pe.get(e))&&void 0!==a?a:x.Gray,E.text).textColor,id:pe.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{stopColor:"currentColor",stopOpacity:ce||me&&me!==e?.1:.3})))})),A.map((e=>{var o;return t.createElement(m,{className:C(null!==(o=pe.get(e))&&void 0!==o?o:x.Gray,E.text).strokeColor,strokeOpacity:ce||me&&me!==e?.3:1,activeDot:e=>{var o;const{cx:a,cy:r,stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,dataKey:c}=e;return t.createElement(u,{className:w("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",C(null!==(o=pe.get(c))&&void 0!==o?o:x.Gray,E.text).fillColor),cx:a,cy:r,r:5,fill:"",stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,onClick:(t,o)=>function(e,t){t.stopPropagation(),ye&&(e.index===(null==ce?void 0:ce.index)&&e.dataKey===(null==ce?void 0:ce.dataKey)||g(j,e.dataKey)&&me&&me===e.dataKey?(ue(void 0),de(void 0),null==_||_(null)):(ue(e.dataKey),de({index:e.index,dataKey:e.dataKey}),null==_||_(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,o)})},dot:o=>{var r;const{stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,cx:c,cy:d,dataKey:m,index:p}=o;return g(j,e)&&!(ce||me&&me!==e)||(null==ce?void 0:ce.index)===p&&(null==ce?void 0:ce.dataKey)===e?t.createElement(u,{key:p,cx:c,cy:d,r:5,stroke:l,fill:"",strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,className:w("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",C(null!==(r=pe.get(m))&&void 0!==r?r:x.Gray,E.text).fillColor)}):t.createElement(a,{key:p})},key:e,name:e,type:R,dataKey:e,stroke:"",fill:`url(#${pe.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:M,animationDuration:P,stackId:G?"a":void 0,connectNulls:J})})),_?A.map((e=>t.createElement(p,{className:w("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:R,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:J,onClick:(e,t)=>{t.stopPropagation();const{name:o}=e;ve(o)}}))):null):t.createElement(v,{noDataText:U})))}));N.displayName="AreaChart";export{N as default}; diff --git a/dist/components/chart-elements/AreaChart/index.d.ts b/dist/components/chart-elements/AreaChart/index.d.ts new file mode 100644 index 000000000..92d8c8347 --- /dev/null +++ b/dist/components/chart-elements/AreaChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as AreaChart } from "./AreaChart"; +export type { AreaChartProps } from "./AreaChart"; diff --git a/dist/components/chart-elements/BarChart/BarChart.cjs b/dist/components/chart-elements/BarChart/BarChart.cjs new file mode 100644 index 000000000..f5b3af31b --- /dev/null +++ b/dist/components/chart-elements/BarChart/BarChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs"),i=require("react"),o=require("recharts"),n=require("../common/ChartLegend.cjs"),s=require("../common/ChartTooltip.cjs"),c=require("../common/NoData.cjs"),d=require("../common/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(i);const v=m.default.forwardRef(((u,v)=>{const{data:g=[],categories:h=[],index:f,colors:p=a.themeColorRange,valueFormatter:y=r.defaultValueFormatter,layout:k="horizontal",stack:b=!1,relative:x=!1,startEndOnly:w=!1,animationDuration:T=900,showAnimation:E=!1,showXAxis:C=!0,showYAxis:A=!0,yAxisWidth:j=56,intervalType:L="equidistantPreserveStart",showTooltip:q=!0,showLegend:O=!0,showGridLines:N=!0,autoMinValue:D=!1,minValue:M,maxValue:S,allowDecimals:G=!0,noDataText:V,onValueChange:F,enableLegendSlider:K=!1,customTooltip:X,rotateLabelX:B,tickGap:P=5,className:Y}=u,z=e.__rest(u,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),R=X,H=C||A?20:0,[W,_]=i.useState(60),I=d.constructCategoryColors(h,p),[$,J]=m.default.useState(void 0),[Q,U]=i.useState(void 0),Z=!!F;function ee(e,t,a){var l,r,i,o;a.stopPropagation(),F&&(d.deepEqual($,Object.assign(Object.assign({},e.payload),{value:e.value}))?(U(void 0),J(void 0),null==F||F(null)):(U(null===(r=null===(l=e.tooltipPayload)||void 0===l?void 0:l[0])||void 0===r?void 0:r.dataKey),J(Object.assign(Object.assign({},e.payload),{value:e.value})),null==F||F(Object.assign({eventType:"bar",categoryClicked:null===(o=null===(i=e.tooltipPayload)||void 0===i?void 0:i[0])||void 0===o?void 0:o.dataKey},e.payload))))}const te=d.getYAxisDomain(D,M,S);return m.default.createElement("div",Object.assign({ref:v,className:l.tremorTwMerge("w-full h-80",Y)},z),m.default.createElement(o.ResponsiveContainer,{className:"h-full w-full"},(null==g?void 0:g.length)?m.default.createElement(o.BarChart,{data:g,stackOffset:b?"sign":x?"expand":"none",layout:"vertical"===k?"vertical":"horizontal",onClick:Z&&(Q||$)?()=>{J(void 0),U(void 0),null==F||F(null)}:void 0},N?m.default.createElement(o.CartesianGrid,{className:l.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==k,vertical:"vertical"===k}):null,"vertical"!==k?m.default.createElement(o.XAxis,{padding:{left:H,right:H},hide:!C,dataKey:f,interval:w?"preserveStartEnd":L,tick:{transform:"translate(0, 6)"},ticks:w?[g[0][f],g[g.length-1][f]]:void 0,fill:"",stroke:"",className:l.tremorTwMerge("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight,minTickGap:P}):m.default.createElement(o.XAxis,{hide:!C,type:"number",tick:{transform:"translate(-3, 0)"},domain:te,fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:y,minTickGap:P,allowDecimals:G,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight}),"vertical"!==k?m.default.createElement(o.YAxis,{width:j,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:te,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:x?e=>`${(100*e).toString()} %`:y,allowDecimals:G}):m.default.createElement(o.YAxis,{width:j,hide:!A,dataKey:f,axisLine:!1,tickLine:!1,ticks:w?[g[0][f],g[g.length-1][f]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),m.default.createElement(o.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:q?({active:e,payload:a,label:l})=>R?m.default.createElement(R,{payload:null==a?void 0:a.map((e=>{var a;return Object.assign(Object.assign({},e),{color:null!==(a=I.get(e.dataKey))&&void 0!==a?a:t.BaseColors.Gray})})),active:e,label:l}):m.default.createElement(s.default,{active:e,payload:a,label:l,valueFormatter:y,categoryColors:I}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),O?m.default.createElement(o.Legend,{verticalAlign:"top",height:W,content:({payload:e})=>n({payload:e},I,_,Q,Z?e=>{return t=e,void(Z&&(t!==Q||$?(U(t),null==F||F({eventType:"category",categoryClicked:t})):(U(void 0),null==F||F(null)),J(void 0)));var t}:void 0,K)}):null,h.map((e=>{var i;return m.default.createElement(o.Bar,{className:l.tremorTwMerge(r.getColorClassNames(null!==(i=I.get(e))&&void 0!==i?i:t.BaseColors.Gray,a.colorPalette.background).fillColor,F?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:b||x?"a":void 0,dataKey:e,fill:"",isAnimationActive:E,animationDuration:T,shape:e=>((e,t,a,l)=>{const{fillOpacity:r,name:i,payload:o,value:n}=e;let{x:s,width:c,y:u,height:v}=e;return"horizontal"===l&&v<0?(u+=v,v=Math.abs(v)):"vertical"===l&&c<0&&(s+=c,c=Math.abs(c)),m.default.createElement("rect",{x:s,y:u,width:c,height:v,opacity:t||a&&a!==i?d.deepEqual(t,Object.assign(Object.assign({},o),{value:n}))?r:.3:r})})(e,$,Q,k),onClick:ee})}))):m.default.createElement(c,{noDataText:V})))}));v.displayName="BarChart",module.exports=v; diff --git a/dist/components/chart-elements/BarChart/BarChart.d.ts b/dist/components/chart-elements/BarChart/BarChart.d.ts new file mode 100644 index 000000000..3284286c0 --- /dev/null +++ b/dist/components/chart-elements/BarChart/BarChart.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +import BaseChartProps from "../common/BaseChartProps"; +export interface BarChartProps extends BaseChartProps { + layout?: "vertical" | "horizontal"; + stack?: boolean; + relative?: boolean; +} +declare const BarChart: React.ForwardRefExoticComponent>; +export default BarChart; diff --git a/dist/components/chart-elements/BarChart/BarChart.js b/dist/components/chart-elements/BarChart/BarChart.js new file mode 100644 index 000000000..35bb20f0e --- /dev/null +++ b/dist/components/chart-elements/BarChart/BarChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{BaseColors as t}from"../../../lib/constants.js";import{themeColorRange as a,colorPalette as l}from"../../../lib/theme.js";import{tremorTwMerge as i}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o,defaultValueFormatter as r}from"../../../lib/utils.js";import n,{useState as s}from"react";import{ResponsiveContainer as c,BarChart as m,CartesianGrid as d,XAxis as v,YAxis as u,Tooltip as p,Legend as h,Bar as y}from"recharts";import g from"../common/ChartLegend.js";import f from"../common/ChartTooltip.js";import k from"../common/NoData.js";import{constructCategoryColors as b,deepEqual as x,getYAxisDomain as w}from"../common/utils.js";const E=n.forwardRef(((E,j)=>{const{data:L=[],categories:A=[],index:T,colors:O=a,valueFormatter:C=r,layout:N="horizontal",stack:D=!1,relative:S=!1,startEndOnly:G=!1,animationDuration:V=900,showAnimation:F=!1,showXAxis:K=!0,showYAxis:M=!0,yAxisWidth:z=56,intervalType:P="equidistantPreserveStart",showTooltip:X=!0,showLegend:B=!0,showGridLines:H=!0,autoMinValue:W=!1,minValue:Y,maxValue:q,allowDecimals:I=!0,noDataText:R,onValueChange:$,enableLegendSlider:J=!1,customTooltip:Q,rotateLabelX:U,tickGap:Z=5,className:_}=E,ee=e(E,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),te=Q,ae=K||M?20:0,[le,ie]=s(60),oe=b(A,O),[re,ne]=n.useState(void 0),[se,ce]=s(void 0),me=!!$;function de(e,t,a){var l,i,o,r;a.stopPropagation(),$&&(x(re,Object.assign(Object.assign({},e.payload),{value:e.value}))?(ce(void 0),ne(void 0),null==$||$(null)):(ce(null===(i=null===(l=e.tooltipPayload)||void 0===l?void 0:l[0])||void 0===i?void 0:i.dataKey),ne(Object.assign(Object.assign({},e.payload),{value:e.value})),null==$||$(Object.assign({eventType:"bar",categoryClicked:null===(r=null===(o=e.tooltipPayload)||void 0===o?void 0:o[0])||void 0===r?void 0:r.dataKey},e.payload))))}const ve=w(W,Y,q);return n.createElement("div",Object.assign({ref:j,className:i("w-full h-80",_)},ee),n.createElement(c,{className:"h-full w-full"},(null==L?void 0:L.length)?n.createElement(m,{data:L,stackOffset:D?"sign":S?"expand":"none",layout:"vertical"===N?"vertical":"horizontal",onClick:me&&(se||re)?()=>{ne(void 0),ce(void 0),null==$||$(null)}:void 0},H?n.createElement(d,{className:i("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==N,vertical:"vertical"===N}):null,"vertical"!==N?n.createElement(v,{padding:{left:ae,right:ae},hide:!K,dataKey:T,interval:G?"preserveStartEnd":P,tick:{transform:"translate(0, 6)"},ticks:G?[L[0][T],L[L.length-1][T]]:void 0,fill:"",stroke:"",className:i("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==U?void 0:U.angle,dy:null==U?void 0:U.verticalShift,height:null==U?void 0:U.xAxisHeight,minTickGap:Z}):n.createElement(v,{hide:!K,type:"number",tick:{transform:"translate(-3, 0)"},domain:ve,fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:C,minTickGap:Z,allowDecimals:I,angle:null==U?void 0:U.angle,dy:null==U?void 0:U.verticalShift,height:null==U?void 0:U.xAxisHeight}),"vertical"!==N?n.createElement(u,{width:z,hide:!M,axisLine:!1,tickLine:!1,type:"number",domain:ve,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:S?e=>`${(100*e).toString()} %`:C,allowDecimals:I}):n.createElement(u,{width:z,hide:!M,dataKey:T,axisLine:!1,tickLine:!1,ticks:G?[L[0][T],L[L.length-1][T]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),n.createElement(p,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:X?({active:e,payload:a,label:l})=>te?n.createElement(te,{payload:null==a?void 0:a.map((e=>{var a;return Object.assign(Object.assign({},e),{color:null!==(a=oe.get(e.dataKey))&&void 0!==a?a:t.Gray})})),active:e,label:l}):n.createElement(f,{active:e,payload:a,label:l,valueFormatter:C,categoryColors:oe}):n.createElement(n.Fragment,null),position:{y:0}}),B?n.createElement(h,{verticalAlign:"top",height:le,content:({payload:e})=>g({payload:e},oe,ie,se,me?e=>{return t=e,void(me&&(t!==se||re?(ce(t),null==$||$({eventType:"category",categoryClicked:t})):(ce(void 0),null==$||$(null)),ne(void 0)));var t}:void 0,J)}):null,A.map((e=>{var a;return n.createElement(y,{className:i(o(null!==(a=oe.get(e))&&void 0!==a?a:t.Gray,l.background).fillColor,$?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:D||S?"a":void 0,dataKey:e,fill:"",isAnimationActive:F,animationDuration:V,shape:e=>((e,t,a,l)=>{const{fillOpacity:i,name:o,payload:r,value:s}=e;let{x:c,width:m,y:d,height:v}=e;return"horizontal"===l&&v<0?(d+=v,v=Math.abs(v)):"vertical"===l&&m<0&&(c+=m,m=Math.abs(m)),n.createElement("rect",{x:c,y:d,width:m,height:v,opacity:t||a&&a!==o?x(t,Object.assign(Object.assign({},r),{value:s}))?i:.3:i})})(e,re,se,N),onClick:de})}))):n.createElement(k,{noDataText:R})))}));E.displayName="BarChart";export{E as default}; diff --git a/dist/components/chart-elements/BarChart/index.d.ts b/dist/components/chart-elements/BarChart/index.d.ts new file mode 100644 index 000000000..4802cb346 --- /dev/null +++ b/dist/components/chart-elements/BarChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as BarChart } from "./BarChart"; +export type { BarChartProps } from "./BarChart"; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.cjs b/dist/components/chart-elements/DonutChart/DonutChart.cjs new file mode 100644 index 000000000..58d610264 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),r=require("react"),n=require("recharts"),i=require("../common/NoData.cjs"),u=require("./DonutChartTooltip.cjs"),s=require("./inputParser.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(r);const m=e=>{const{cx:t,cy:a,innerRadius:l,outerRadius:o,startAngle:r,endAngle:i,className:u}=e;return d.default.createElement("g",null,d.default.createElement(n.Sector,{cx:t,cy:a,innerRadius:l,outerRadius:o,startAngle:r,endAngle:i,className:u,fill:"",opacity:.3,style:{outline:"none"}}))},f=d.default.forwardRef(((c,f)=>{const{data:v=[],category:p="value",index:g="name",colors:h=a.themeColorRange,variant:y="donut",valueFormatter:b=o.defaultValueFormatter,label:A,showLabel:T=!0,animationDuration:w=900,showAnimation:E=!1,showTooltip:j=!0,noDataText:x,onValueChange:k,customTooltip:q,className:C}=c,D=e.__rest(c,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),N=q,R="donut"==y,F=s.parseLabelInput(A,b,v,p),[S,L]=d.default.useState(void 0),M=!!k;return r.useEffect((()=>{const e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach((e=>{e.setAttribute("style","outline: none")}))}),[S]),d.default.createElement("div",Object.assign({ref:f,className:l.tremorTwMerge("w-full h-40",C)},D),d.default.createElement(n.ResponsiveContainer,{className:"h-full w-full"},(null==v?void 0:v.length)?d.default.createElement(n.PieChart,{onClick:M&&S?()=>{L(void 0),null==k||k(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},T&&R?d.default.createElement("text",{className:l.tremorTwMerge("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},F):null,d.default.createElement(n.Pie,{className:l.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",k?"cursor-pointer":"cursor-default"),data:s.parseData(v,h),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:R?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:p,nameKey:g,isAnimationActive:E,animationDuration:w,onClick:function(e,t,a){a.stopPropagation(),M&&(S===t?(L(void 0),null==k||k(null)):(L(t),null==k||k(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:S,inactiveShape:m,style:{outline:"none"}}),d.default.createElement(n.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:j?({active:e,payload:a})=>{var l;return N?d.default.createElement(N,{payload:null==a?void 0:a.map((e=>{var l,o,r;return Object.assign(Object.assign({},e),{color:null!==(r=null===(o=null===(l=null==a?void 0:a[0])||void 0===l?void 0:l.payload)||void 0===o?void 0:o.color)&&void 0!==r?r:t.BaseColors.Gray})})),active:e,label:null===(l=null==a?void 0:a[0])||void 0===l?void 0:l.name}):d.default.createElement(u.DonutChartTooltip,{active:e,payload:a,valueFormatter:b})}:d.default.createElement(d.default.Fragment,null)})):d.default.createElement(i,{noDataText:x})))}));f.displayName="DonutChart",module.exports=f; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.d.ts b/dist/components/chart-elements/DonutChart/DonutChart.d.ts new file mode 100644 index 000000000..84382ea3a --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChart.d.ts @@ -0,0 +1,24 @@ +import React from "react"; +import { Color, ValueFormatter } from "../../../lib/inputTypes"; +import type { EventProps } from "components/chart-elements/common"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; +import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; +type DonutChartVariant = "donut" | "pie"; +export interface DonutChartProps extends BaseAnimationTimingProps { + data: any[]; + category?: string; + index?: string; + colors?: (Color | string)[]; + variant?: DonutChartVariant; + valueFormatter?: ValueFormatter; + label?: string; + showLabel?: boolean; + showAnimation?: boolean; + showTooltip?: boolean; + noDataText?: string; + className?: string; + onValueChange?: (value: EventProps) => void; + customTooltip?: React.ComponentType; +} +declare const DonutChart: React.ForwardRefExoticComponent>; +export default DonutChart; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.js b/dist/components/chart-elements/DonutChart/DonutChart.js new file mode 100644 index 000000000..cd1599344 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{BaseColors as t}from"../../../lib/constants.js";import{themeColorRange as a}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{defaultValueFormatter as n}from"../../../lib/utils.js";import l,{useEffect as r}from"react";import{ResponsiveContainer as i,PieChart as s,Pie as m,Tooltip as c,Sector as u}from"recharts";import d from"../common/NoData.js";import{DonutChartTooltip as p}from"./DonutChartTooltip.js";import{parseLabelInput as v,parseData as f}from"./inputParser.js";const g=e=>{const{cx:t,cy:a,innerRadius:o,outerRadius:n,startAngle:r,endAngle:i,className:s}=e;return l.createElement("g",null,l.createElement(u,{cx:t,cy:a,innerRadius:o,outerRadius:n,startAngle:r,endAngle:i,className:s,fill:"",opacity:.3,style:{outline:"none"}}))},y=l.forwardRef(((u,y)=>{const{data:h=[],category:b="value",index:A="name",colors:x=a,variant:E="donut",valueFormatter:j=n,label:k,showLabel:w=!0,animationDuration:N=900,showAnimation:T=!1,showTooltip:D=!0,noDataText:R,onValueChange:C,customTooltip:F,className:O}=u,S=e(u,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),L=F,K="donut"==E,P=v(k,j,h,b),[V,q]=l.useState(void 0),B=!!C;return r((()=>{const e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach((e=>{e.setAttribute("style","outline: none")}))}),[V]),l.createElement("div",Object.assign({ref:y,className:o("w-full h-40",O)},S),l.createElement(i,{className:"h-full w-full"},(null==h?void 0:h.length)?l.createElement(s,{onClick:B&&V?()=>{q(void 0),null==C||C(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},w&&K?l.createElement("text",{className:o("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(m,{className:o("stroke-tremor-background dark:stroke-dark-tremor-background",C?"cursor-pointer":"cursor-default"),data:f(h,x),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:K?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:b,nameKey:A,isAnimationActive:T,animationDuration:N,onClick:function(e,t,a){a.stopPropagation(),B&&(V===t?(q(void 0),null==C||C(null)):(q(t),null==C||C(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:V,inactiveShape:g,style:{outline:"none"}}),l.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:D?({active:e,payload:a})=>{var o;return L?l.createElement(L,{payload:null==a?void 0:a.map((e=>{var o,n,l;return Object.assign(Object.assign({},e),{color:null!==(l=null===(n=null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.payload)||void 0===n?void 0:n.color)&&void 0!==l?l:t.Gray})})),active:e,label:null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.name}):l.createElement(p,{active:e,payload:a,valueFormatter:j})}:l.createElement(l.Fragment,null)})):l.createElement(d,{noDataText:R})))}));y.displayName="DonutChart";export{y as default}; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs b/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs new file mode 100644 index 000000000..dcc608c7c --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../common/ChartTooltip.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e);exports.DonutChartTooltip=({active:e,payload:l,valueFormatter:a})=>{if(e&&(null==l?void 0:l[0])){const e=null==l?void 0:l[0];return o.default.createElement(r.ChartTooltipFrame,null,o.default.createElement("div",{className:t.tremorTwMerge("px-4 py-2")},o.default.createElement(r.ChartTooltipRow,{value:a(e.value),name:e.name,color:e.payload.color})))}return null}; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts b/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts new file mode 100644 index 000000000..6dae72cd8 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts @@ -0,0 +1,8 @@ +import React from "react"; +import { ValueFormatter } from "lib"; +export interface DonutChartTooltipProps { + active: boolean | undefined; + payload: any; + valueFormatter: ValueFormatter; +} +export declare const DonutChartTooltip: ({ active, payload, valueFormatter }: DonutChartTooltipProps) => React.JSX.Element | null; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.js b/dist/components/chart-elements/DonutChart/DonutChartTooltip.js new file mode 100644 index 000000000..e2b4a9e72 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/DonutChartTooltip.js @@ -0,0 +1 @@ +import e from"react";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{ChartTooltipFrame as r,ChartTooltipRow as l}from"../common/ChartTooltip.js";const t=({active:t,payload:a,valueFormatter:m})=>{if(t&&(null==a?void 0:a[0])){const t=null==a?void 0:a[0];return e.createElement(r,null,e.createElement("div",{className:o("px-4 py-2")},e.createElement(l,{value:m(t.value),name:t.name,color:t.payload.color})))}return null};export{t as DonutChartTooltip}; diff --git a/dist/components/chart-elements/DonutChart/index.d.ts b/dist/components/chart-elements/DonutChart/index.d.ts new file mode 100644 index 000000000..16c105077 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as DonutChart } from "./DonutChart"; +export type { DonutChartProps } from "./DonutChart"; diff --git a/dist/components/chart-elements/DonutChart/inputParser.cjs b/dist/components/chart-elements/DonutChart/inputParser.cjs new file mode 100644 index 000000000..1b7a0b31e --- /dev/null +++ b/dist/components/chart-elements/DonutChart/inputParser.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),r=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var s=require("../../../lib/utils.cjs");exports.parseData=(a,l)=>a.map(((a,t)=>{const o=te||r(((e,r)=>s.sumNumericArray(e.map((e=>e[r]))))(a,l)); diff --git a/dist/components/chart-elements/DonutChart/inputParser.d.ts b/dist/components/chart-elements/DonutChart/inputParser.d.ts new file mode 100644 index 000000000..a306cb986 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/inputParser.d.ts @@ -0,0 +1,3 @@ +import { Color, ValueFormatter } from "../../../lib/inputTypes"; +export declare const parseData: (data: any[], colors: (Color | string)[]) => any[]; +export declare const parseLabelInput: (labelInput: string | undefined, valueFormatter: ValueFormatter, data: any[], category: string) => string; diff --git a/dist/components/chart-elements/DonutChart/inputParser.js b/dist/components/chart-elements/DonutChart/inputParser.js new file mode 100644 index 000000000..d462473c8 --- /dev/null +++ b/dist/components/chart-elements/DonutChart/inputParser.js @@ -0,0 +1 @@ +import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as o}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as t,sumNumericArray as l}from"../../../lib/utils.js";const s=(l,s)=>l.map(((l,i)=>{const m=ir||o(((r,o)=>l(r.map((r=>r[o]))))(t,s));export{s as parseData,i as parseLabelInput}; diff --git a/dist/components/chart-elements/LineChart/LineChart.cjs b/dist/components/chart-elements/LineChart/LineChart.cjs new file mode 100644 index 000000000..d8a45093d --- /dev/null +++ b/dist/components/chart-elements/LineChart/LineChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../common/ChartLegend.cjs"),o=require("../common/ChartTooltip.cjs"),l=require("../common/NoData.cjs"),n=require("../common/utils.cjs"),i=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),d=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(t);const k=m.default.forwardRef(((u,k)=>{const{data:y=[],categories:g=[],index:p,colors:v=s.themeColorRange,valueFormatter:h=c.defaultValueFormatter,startEndOnly:f=!1,showXAxis:x=!0,showYAxis:C=!0,yAxisWidth:T=56,intervalType:w="equidistantPreserveStart",animationDuration:L=900,showAnimation:b=!1,showTooltip:E=!0,showLegend:N=!0,showGridLines:K=!0,autoMinValue:j=!1,curveType:A="linear",minValue:D,maxValue:O,connectNulls:q=!1,allowDecimals:V=!0,noDataText:M,className:F,onValueChange:G,enableLegendSlider:S=!1,customTooltip:W,rotateLabelX:P,tickGap:X=5}=u,B=e.__rest(u,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),Y=W,R=x||C?20:0,[_,z]=t.useState(60),[H,I]=t.useState(void 0),[J,Q]=t.useState(void 0),U=n.constructCategoryColors(g,v),Z=n.getYAxisDomain(j,D,O),$=!!G;function ee(e){$&&(e===J&&!H||n.hasOnlyOneValueForThisKey(y,e)&&H&&H.dataKey===e?(Q(void 0),null==G||G(null)):(Q(e),null==G||G({eventType:"category",categoryClicked:e})),I(void 0))}return m.default.createElement("div",Object.assign({ref:k,className:d.tremorTwMerge("w-full h-80",F)},B),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==y?void 0:y.length)?m.default.createElement(a.LineChart,{data:y,onClick:$&&(J||H)?()=>{I(void 0),Q(void 0),null==G||G(null)}:void 0},K?m.default.createElement(a.CartesianGrid,{className:d.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,m.default.createElement(a.XAxis,{padding:{left:R,right:R},hide:!x,dataKey:p,interval:f?"preserveStartEnd":w,tick:{transform:"translate(0, 6)"},ticks:f?[y[0][p],y[y.length-1][p]]:void 0,fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:X,angle:null==P?void 0:P.angle,dy:null==P?void 0:P.verticalShift,height:null==P?void 0:P.xAxisHeight}),m.default.createElement(a.YAxis,{width:T,hide:!C,axisLine:!1,tickLine:!1,type:"number",domain:Z,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:h,allowDecimals:V}),m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:E?({active:e,payload:t,label:a})=>Y?m.default.createElement(Y,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=U.get(e.dataKey))&&void 0!==t?t:i.BaseColors.Gray})})),active:e,label:a}):m.default.createElement(o.default,{active:e,payload:t,label:a,valueFormatter:h,categoryColors:U}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),N?m.default.createElement(a.Legend,{verticalAlign:"top",height:_,content:({payload:e})=>r({payload:e},U,z,J,$?e=>ee(e):void 0,S)}):null,g.map((e=>{var r;return m.default.createElement(a.Line,{className:d.tremorTwMerge(c.getColorClassNames(null!==(r=U.get(e))&&void 0!==r?r:i.BaseColors.Gray,s.colorPalette.text).strokeColor),strokeOpacity:H||J&&J!==e?.3:1,activeDot:e=>{var t;const{cx:r,cy:o,stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,dataKey:p}=e;return m.default.createElement(a.Dot,{className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",G?"cursor-pointer":"",c.getColorClassNames(null!==(t=U.get(p))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,onClick:(t,a)=>function(e,t){t.stopPropagation(),$&&(e.index===(null==H?void 0:H.index)&&e.dataKey===(null==H?void 0:H.dataKey)||n.hasOnlyOneValueForThisKey(y,e.dataKey)&&J&&J===e.dataKey?(Q(void 0),I(void 0),null==G||G(null)):(Q(e.dataKey),I({index:e.index,dataKey:e.dataKey}),null==G||G(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:r=>{var o;const{stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,cx:p,cy:v,dataKey:h,index:f}=r;return n.hasOnlyOneValueForThisKey(y,e)&&!(H||J&&J!==e)||(null==H?void 0:H.index)===f&&(null==H?void 0:H.dataKey)===e?m.default.createElement(a.Dot,{key:f,cx:p,cy:v,r:5,stroke:l,fill:"",strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",G?"cursor-pointer":"",c.getColorClassNames(null!==(o=U.get(h))&&void 0!==o?o:i.BaseColors.Gray,s.colorPalette.text).fillColor)}):m.default.createElement(t.Fragment,{key:f})},key:e,name:e,type:A,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:b,animationDuration:L,connectNulls:q})})),G?g.map((e=>m.default.createElement(a.Line,{className:d.tremorTwMerge("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:A,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:q,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ee(a)}}))):null):m.default.createElement(l,{noDataText:M})))}));k.displayName="LineChart",module.exports=k; diff --git a/dist/components/chart-elements/LineChart/LineChart.d.ts b/dist/components/chart-elements/LineChart/LineChart.d.ts new file mode 100644 index 000000000..901ac038a --- /dev/null +++ b/dist/components/chart-elements/LineChart/LineChart.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +import BaseChartProps from "../common/BaseChartProps"; +import { CurveType } from "../../../lib/inputTypes"; +export interface LineChartProps extends BaseChartProps { + curveType?: CurveType; + connectNulls?: boolean; +} +declare const LineChart: React.ForwardRefExoticComponent>; +export default LineChart; diff --git a/dist/components/chart-elements/LineChart/LineChart.js b/dist/components/chart-elements/LineChart/LineChart.js new file mode 100644 index 000000000..0b577c763 --- /dev/null +++ b/dist/components/chart-elements/LineChart/LineChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useState as a,Fragment as o}from"react";import{ResponsiveContainer as r,LineChart as n,CartesianGrid as l,XAxis as i,YAxis as s,Tooltip as c,Legend as d,Line as m,Dot as u}from"recharts";import k from"../common/ChartLegend.js";import p from"../common/ChartTooltip.js";import y from"../common/NoData.js";import{constructCategoryColors as v,hasOnlyOneValueForThisKey as h,getYAxisDomain as g}from"../common/utils.js";import{BaseColors as f}from"../../../lib/constants.js";import{themeColorRange as x,colorPalette as b}from"../../../lib/theme.js";import{tremorTwMerge as L}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as w,defaultValueFormatter as E}from"../../../lib/utils.js";const T=t.forwardRef(((T,j)=>{const{data:N=[],categories:K=[],index:C,colors:A=x,valueFormatter:D=E,startEndOnly:G=!1,showXAxis:W=!0,showYAxis:O=!0,yAxisWidth:V=56,intervalType:S="equidistantPreserveStart",animationDuration:F=900,showAnimation:X=!1,showTooltip:M=!0,showLegend:P=!0,showGridLines:Y=!0,autoMinValue:q=!1,curveType:z="linear",minValue:H,maxValue:R,connectNulls:B=!1,allowDecimals:I=!0,noDataText:J,className:Q,onValueChange:U,enableLegendSlider:Z=!1,customTooltip:$,rotateLabelX:_,tickGap:ee=5}=T,te=e(T,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),ae=$,oe=W||O?20:0,[re,ne]=a(60),[le,ie]=a(void 0),[se,ce]=a(void 0),de=v(K,A),me=g(q,H,R),ue=!!U;function ke(e){ue&&(e===se&&!le||h(N,e)&&le&&le.dataKey===e?(ce(void 0),null==U||U(null)):(ce(e),null==U||U({eventType:"category",categoryClicked:e})),ie(void 0))}return t.createElement("div",Object.assign({ref:j,className:L("w-full h-80",Q)},te),t.createElement(r,{className:"h-full w-full"},(null==N?void 0:N.length)?t.createElement(n,{data:N,onClick:ue&&(se||le)?()=>{ie(void 0),ce(void 0),null==U||U(null)}:void 0},Y?t.createElement(l,{className:L("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,t.createElement(i,{padding:{left:oe,right:oe},hide:!W,dataKey:C,interval:G?"preserveStartEnd":S,tick:{transform:"translate(0, 6)"},ticks:G?[N[0][C],N[N.length-1][C]]:void 0,fill:"",stroke:"",className:L("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:ee,angle:null==_?void 0:_.angle,dy:null==_?void 0:_.verticalShift,height:null==_?void 0:_.xAxisHeight}),t.createElement(s,{width:V,hide:!O,axisLine:!1,tickLine:!1,type:"number",domain:me,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:L("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:D,allowDecimals:I}),t.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?({active:e,payload:a,label:o})=>ae?t.createElement(ae,{payload:null==a?void 0:a.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=de.get(e.dataKey))&&void 0!==t?t:f.Gray})})),active:e,label:o}):t.createElement(p,{active:e,payload:a,label:o,valueFormatter:D,categoryColors:de}):t.createElement(t.Fragment,null),position:{y:0}}),P?t.createElement(d,{verticalAlign:"top",height:re,content:({payload:e})=>k({payload:e},de,ne,se,ue?e=>ke(e):void 0,Z)}):null,K.map((e=>{var a;return t.createElement(m,{className:L(w(null!==(a=de.get(e))&&void 0!==a?a:f.Gray,b.text).strokeColor),strokeOpacity:le||se&&se!==e?.3:1,activeDot:e=>{var a;const{cx:o,cy:r,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,dataKey:c}=e;return t.createElement(u,{className:L("stroke-tremor-background dark:stroke-dark-tremor-background",U?"cursor-pointer":"",w(null!==(a=de.get(c))&&void 0!==a?a:f.Gray,b.text).fillColor),cx:o,cy:r,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,onClick:(t,a)=>function(e,t){t.stopPropagation(),ue&&(e.index===(null==le?void 0:le.index)&&e.dataKey===(null==le?void 0:le.dataKey)||h(N,e.dataKey)&&se&&se===e.dataKey?(ce(void 0),ie(void 0),null==U||U(null)):(ce(e.dataKey),ie({index:e.index,dataKey:e.dataKey}),null==U||U(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:a=>{var r;const{stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,cx:c,cy:d,dataKey:m,index:k}=a;return h(N,e)&&!(le||se&&se!==e)||(null==le?void 0:le.index)===k&&(null==le?void 0:le.dataKey)===e?t.createElement(u,{key:k,cx:c,cy:d,r:5,stroke:n,fill:"",strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,className:L("stroke-tremor-background dark:stroke-dark-tremor-background",U?"cursor-pointer":"",w(null!==(r=de.get(m))&&void 0!==r?r:f.Gray,b.text).fillColor)}):t.createElement(o,{key:k})},key:e,name:e,type:z,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:X,animationDuration:F,connectNulls:B})})),U?K.map((e=>t.createElement(m,{className:L("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:z,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ke(a)}}))):null):t.createElement(y,{noDataText:J})))}));T.displayName="LineChart";export{T as default}; diff --git a/dist/components/chart-elements/LineChart/index.d.ts b/dist/components/chart-elements/LineChart/index.d.ts new file mode 100644 index 000000000..89a8587b8 --- /dev/null +++ b/dist/components/chart-elements/LineChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as LineChart } from "./LineChart"; +export type { LineChartProps } from "./LineChart"; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.cjs b/dist/components/chart-elements/ScatterChart/ScatterChart.cjs new file mode 100644 index 000000000..b26088134 --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),l=require("../common/ChartLegend.cjs"),r=require("./ScatterChartTooltip.cjs"),o=require("../common/NoData.cjs"),i=require("../common/utils.cjs"),n=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),u=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(t);const v=m.default.forwardRef(((d,v)=>{const{data:g=[],x:y,y:f,size:p,category:h,colors:x=s.themeColorRange,showOpacity:w=!1,sizeRange:k=[1,1e3],valueFormatter:b={x:c.defaultValueFormatter,y:c.defaultValueFormatter,size:c.defaultValueFormatter},startEndOnly:C=!1,showXAxis:E=!0,showYAxis:T=!0,yAxisWidth:A=56,intervalType:V="equidistantPreserveStart",animationDuration:D=900,showAnimation:q=!1,showTooltip:L=!0,showLegend:j=!0,showGridLines:S=!0,autoMinXValue:N=!1,minXValue:O,maxXValue:X,autoMinYValue:Y=!1,minYValue:M,maxYValue:F,allowDecimals:G=!0,noDataText:z,onValueChange:R,customTooltip:P,rotateLabelX:B,className:K,enableLegendSlider:W=!1,tickGap:_=5}=d,H=e.__rest(d,["data","x","y","size","category","colors","showOpacity","sizeRange","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinXValue","minXValue","maxXValue","autoMinYValue","minYValue","maxYValue","allowDecimals","noDataText","onValueChange","customTooltip","rotateLabelX","className","enableLegendSlider","tickGap"]),Z=P,[$,I]=t.useState(60),[J,Q]=m.default.useState(void 0),[U,ee]=t.useState(void 0),te=!!R;function ae(e,t,a){a.stopPropagation(),te&&(i.deepEqual(J,e.node)?(ee(void 0),Q(void 0),null==R||R(null)):(Q(e.node),ee(e.payload[h]),null==R||R(Object.assign({eventType:"bubble",categoryClicked:e.payload[h]},e.payload))))}const le=i.constructCategories(g,h),re=i.constructCategoryColors(le,x),oe=i.getYAxisDomain(N,O,X),ie=i.getYAxisDomain(Y,M,F);return m.default.createElement("div",Object.assign({ref:v,className:u.tremorTwMerge("w-full h-80",K)},H),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==g?void 0:g.length)?m.default.createElement(a.ScatterChart,{onClick:te&&(U||J)?()=>{Q(void 0),ee(void 0),null==R||R(null)}:void 0,margin:{left:20,right:20}},S?m.default.createElement(a.CartesianGrid,{className:u.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!0}):null,y?m.default.createElement(a.XAxis,{hide:!E,dataKey:y,interval:C?"preserveStartEnd":V,tick:{transform:"translate(0, 6)"},ticks:C?[g[0][y],g[g.length-1][y]]:void 0,type:"number",name:y,fill:"",stroke:"",className:u.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,tickFormatter:b.x,axisLine:!1,minTickGap:_,domain:oe,allowDataOverflow:!0,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight}):null,f?m.default.createElement(a.YAxis,{width:A,hide:!T,axisLine:!1,tickLine:!1,dataKey:f,type:"number",name:f,domain:ie,tick:{transform:"translate(-3, 0)"},tickFormatter:b.y,fill:"",stroke:"",className:u.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),allowDecimals:G,allowDataOverflow:!0}):null,m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:L?({active:e,payload:t,label:a})=>{var l,o;const i=h?null===(o=null===(l=null==t?void 0:t[0])||void 0===l?void 0:l.payload)||void 0===o?void 0:o[h]:a;return Z?m.default.createElement(Z,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=re.get(i))&&void 0!==t?t:n.BaseColors.Gray})})),active:e,label:i}):m.default.createElement(r.default,{active:e,payload:t,label:i,valueFormatter:b,axis:{x:y,y:f,size:p},category:h,categoryColors:re})}:m.default.createElement(m.default.Fragment,null)}),p?m.default.createElement(a.ZAxis,{dataKey:p,type:"number",range:k,name:p}):null,le.map((e=>{var t,l;return m.default.createElement(a.Scatter,{className:u.tremorTwMerge(c.getColorClassNames(null!==(t=re.get(e))&&void 0!==t?t:n.BaseColors.Gray,s.colorPalette.text).fillColor,w?c.getColorClassNames(null!==(l=re.get(e))&&void 0!==l?l:n.BaseColors.Gray,s.colorPalette.text).strokeColor:"",R?"cursor-pointer":""),fill:`url(#${re.get(e)})`,fillOpacity:w?.7:1,key:e,name:e,data:h?g.filter((t=>t[h]===e)):g,isAnimationActive:q,animationDuration:D,shape:e=>((e,t,l)=>{const{cx:r,cy:o,width:n,node:s,fillOpacity:u,name:c}=e;return m.default.createElement(a.Dot,{cx:r,cy:o,r:n/2,opacity:t||l&&l!==c?i.deepEqual(t,s)?u:.3:u})})(e,J,U),onClick:ae})})),j?m.default.createElement(a.Legend,{verticalAlign:"top",height:$,content:({payload:e})=>l({payload:e},re,I,U,te?e=>{return t=e,void(te&&(t!==U||J?(ee(t),null==R||R({eventType:"category",categoryClicked:t})):(ee(void 0),null==R||R(null)),Q(void 0)));var t}:void 0,W)}):null):m.default.createElement(o,{noDataText:z})))}));v.displayName="ScatterChart",module.exports=v; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts b/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts new file mode 100644 index 000000000..a0490a0c1 --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts @@ -0,0 +1,48 @@ +import React from "react"; +import type { EventProps } from "components/chart-elements/common"; +import BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; +import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; +import { Color, ValueFormatter, IntervalType } from "../../../lib/inputTypes"; +export type ScatterChartValueFormatter = { + x?: ValueFormatter; + y?: ValueFormatter; + size?: ValueFormatter; +}; +export interface ScatterChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { + data: any[]; + x: string; + y: string; + category: string; + size?: string; + valueFormatter?: ScatterChartValueFormatter; + sizeRange?: number[]; + colors?: (Color | string)[]; + showOpacity?: boolean; + startEndOnly?: boolean; + showXAxis?: boolean; + showYAxis?: boolean; + yAxisWidth?: number; + intervalType?: IntervalType; + showTooltip?: boolean; + showLegend?: boolean; + showGridLines?: boolean; + autoMinXValue?: boolean; + minXValue?: number; + maxXValue?: number; + autoMinYValue?: boolean; + minYValue?: number; + maxYValue?: number; + allowDecimals?: boolean; + noDataText?: string; + enableLegendSlider?: boolean; + onValueChange?: (value: EventProps) => void; + customTooltip?: React.ComponentType; + rotateLabelX?: { + angle: number; + verticalShift: number; + xAxisHeight: number; + }; + tickGap?: number; +} +declare const ScatterChart: React.ForwardRefExoticComponent>; +export default ScatterChart; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.js b/dist/components/chart-elements/ScatterChart/ScatterChart.js new file mode 100644 index 000000000..ececb4f6b --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useState as a}from"react";import{ResponsiveContainer as l,ScatterChart as o,CartesianGrid as r,XAxis as i,YAxis as n,Tooltip as s,ZAxis as m,Scatter as c,Legend as d,Dot as u}from"recharts";import p from"../common/ChartLegend.js";import v from"./ScatterChartTooltip.js";import y from"../common/NoData.js";import{constructCategories as h,constructCategoryColors as g,deepEqual as f,getYAxisDomain as x}from"../common/utils.js";import{BaseColors as k}from"../../../lib/constants.js";import{themeColorRange as w,colorPalette as b}from"../../../lib/theme.js";import{tremorTwMerge as E}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as A,defaultValueFormatter as T}from"../../../lib/utils.js";const V=t.forwardRef(((V,C)=>{const{data:L=[],x:j,y:D,size:O,category:N,colors:S=w,showOpacity:X=!1,sizeRange:G=[1,1e3],valueFormatter:Y={x:T,y:T,size:T},startEndOnly:z=!1,showXAxis:F=!0,showYAxis:M=!0,yAxisWidth:K=56,intervalType:R="equidistantPreserveStart",animationDuration:W=900,showAnimation:P=!1,showTooltip:q=!0,showLegend:H=!0,showGridLines:$=!0,autoMinXValue:B=!1,minXValue:I,maxXValue:J,autoMinYValue:Q=!1,minYValue:U,maxYValue:Z,allowDecimals:_=!0,noDataText:ee,onValueChange:te,customTooltip:ae,rotateLabelX:le,className:oe,enableLegendSlider:re=!1,tickGap:ie=5}=V,ne=e(V,["data","x","y","size","category","colors","showOpacity","sizeRange","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinXValue","minXValue","maxXValue","autoMinYValue","minYValue","maxYValue","allowDecimals","noDataText","onValueChange","customTooltip","rotateLabelX","className","enableLegendSlider","tickGap"]),se=ae,[me,ce]=a(60),[de,ue]=t.useState(void 0),[pe,ve]=a(void 0),ye=!!te;function he(e,t,a){a.stopPropagation(),ye&&(f(de,e.node)?(ve(void 0),ue(void 0),null==te||te(null)):(ue(e.node),ve(e.payload[N]),null==te||te(Object.assign({eventType:"bubble",categoryClicked:e.payload[N]},e.payload))))}const ge=h(L,N),fe=g(ge,S),xe=x(B,I,J),ke=x(Q,U,Z);return t.createElement("div",Object.assign({ref:C,className:E("w-full h-80",oe)},ne),t.createElement(l,{className:"h-full w-full"},(null==L?void 0:L.length)?t.createElement(o,{onClick:ye&&(pe||de)?()=>{ue(void 0),ve(void 0),null==te||te(null)}:void 0,margin:{left:20,right:20}},$?t.createElement(r,{className:E("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!0}):null,j?t.createElement(i,{hide:!F,dataKey:j,interval:z?"preserveStartEnd":R,tick:{transform:"translate(0, 6)"},ticks:z?[L[0][j],L[L.length-1][j]]:void 0,type:"number",name:j,fill:"",stroke:"",className:E("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,tickFormatter:Y.x,axisLine:!1,minTickGap:ie,domain:xe,allowDataOverflow:!0,angle:null==le?void 0:le.angle,dy:null==le?void 0:le.verticalShift,height:null==le?void 0:le.xAxisHeight}):null,D?t.createElement(n,{width:K,hide:!M,axisLine:!1,tickLine:!1,dataKey:D,type:"number",name:D,domain:ke,tick:{transform:"translate(-3, 0)"},tickFormatter:Y.y,fill:"",stroke:"",className:E("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),allowDecimals:_,allowDataOverflow:!0}):null,t.createElement(s,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:q?({active:e,payload:a,label:l})=>{var o,r;const i=N?null===(r=null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.payload)||void 0===r?void 0:r[N]:l;return se?t.createElement(se,{payload:null==a?void 0:a.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=fe.get(i))&&void 0!==t?t:k.Gray})})),active:e,label:i}):t.createElement(v,{active:e,payload:a,label:i,valueFormatter:Y,axis:{x:j,y:D,size:O},category:N,categoryColors:fe})}:t.createElement(t.Fragment,null)}),O?t.createElement(m,{dataKey:O,type:"number",range:G,name:O}):null,ge.map((e=>{var a,l;return t.createElement(c,{className:E(A(null!==(a=fe.get(e))&&void 0!==a?a:k.Gray,b.text).fillColor,X?A(null!==(l=fe.get(e))&&void 0!==l?l:k.Gray,b.text).strokeColor:"",te?"cursor-pointer":""),fill:`url(#${fe.get(e)})`,fillOpacity:X?.7:1,key:e,name:e,data:N?L.filter((t=>t[N]===e)):L,isAnimationActive:P,animationDuration:W,shape:e=>((e,a,l)=>{const{cx:o,cy:r,width:i,node:n,fillOpacity:s,name:m}=e;return t.createElement(u,{cx:o,cy:r,r:i/2,opacity:a||l&&l!==m?f(a,n)?s:.3:s})})(e,de,pe),onClick:he})})),H?t.createElement(d,{verticalAlign:"top",height:me,content:({payload:e})=>p({payload:e},fe,ce,pe,ye?e=>{return t=e,void(ye&&(t!==pe||de?(ve(t),null==te||te({eventType:"category",categoryClicked:t})):(ve(void 0),null==te||te(null)),ue(void 0)));var t}:void 0,re)}):null):t.createElement(y,{noDataText:ee})))}));V.displayName="ScatterChart";export{V as default}; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs new file mode 100644 index 000000000..86816d6a2 --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(e);const m=({children:e})=>l.default.createElement("div",{className:a.tremorTwMerge("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),s=({value:e,name:r})=>l.default.createElement("div",{className:"flex items-center justify-between space-x-8"},l.default.createElement("div",{className:"flex items-center space-x-2"},l.default.createElement("p",{className:a.tremorTwMerge("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},r)),l.default.createElement("p",{className:a.tremorTwMerge("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e));exports.ChartTooltipFrame=m,exports.ChartTooltipRow=s,exports.default=({label:e,active:d,payload:n,valueFormatter:c,axis:u,category:i,categoryColors:p})=>{var b,f;return d&&n?l.default.createElement(m,null,l.default.createElement("div",{className:a.tremorTwMerge("flex items-center space-x-2 border-b px-4 py-2","border-tremor-border","dark:border-dark-tremor-border")},l.default.createElement("span",{className:a.tremorTwMerge("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o.getColorClassNames(i&&null!==(f=p.get(null===(b=null==n?void 0:n[0])||void 0===b?void 0:b.payload[i]))&&void 0!==f?f:r.BaseColors.Blue,t.colorPalette.background).bgColor)}),l.default.createElement("p",{className:a.tremorTwMerge("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e)),l.default.createElement("div",{className:a.tremorTwMerge("px-4 py-2 space-y-1")},n.map((({value:e,name:r},t)=>{var a,d;const m=null!==(a=Object.keys(u).find((e=>u[e]===r)))&&void 0!==a?a:"",n=null!==(d=c[m])&&void 0!==d?d:o.defaultValueFormatter;return l.default.createElement(s,{key:`id-${t}`,value:c&&n?n(e):`${e}`,name:r})})))):null}; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts new file mode 100644 index 000000000..0144f6bdf --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts @@ -0,0 +1,22 @@ +import React from "react"; +import { ScatterChartValueFormatter } from "components/chart-elements/ScatterChart/ScatterChart"; +import { Color } from "lib"; +export declare const ChartTooltipFrame: ({ children }: { + children: React.ReactNode; +}) => React.JSX.Element; +export interface ChartTooltipRowProps { + value: string; + name: string; +} +export declare const ChartTooltipRow: ({ value, name }: ChartTooltipRowProps) => React.JSX.Element; +export interface ScatterChartTooltipProps { + label: string; + categoryColors: Map; + active: boolean | undefined; + payload: any; + valueFormatter: ScatterChartValueFormatter; + axis: any; + category?: string; +} +declare const ScatterChartTooltip: ({ label, active, payload, valueFormatter, axis, category, categoryColors, }: ScatterChartTooltipProps) => React.JSX.Element | null; +export default ScatterChartTooltip; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js new file mode 100644 index 000000000..de3df03d5 --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js @@ -0,0 +1 @@ +import e from"react";import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o,defaultValueFormatter as d}from"../../../lib/utils.js";const m=({children:r})=>e.createElement("div",{className:a("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},r),n=({value:r,name:t})=>e.createElement("div",{className:"flex items-center justify-between space-x-8"},e.createElement("div",{className:"flex items-center space-x-2"},e.createElement("p",{className:a("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},t)),e.createElement("p",{className:a("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r)),l=({label:l,active:s,payload:c,valueFormatter:i,axis:p,category:u,categoryColors:b})=>{var k,x;return s&&c?e.createElement(m,null,e.createElement("div",{className:a("flex items-center space-x-2 border-b px-4 py-2","border-tremor-border","dark:border-dark-tremor-border")},e.createElement("span",{className:a("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o(u&&null!==(x=b.get(null===(k=null==c?void 0:c[0])||void 0===k?void 0:k.payload[u]))&&void 0!==x?x:r.Blue,t.background).bgColor)}),e.createElement("p",{className:a("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},l)),e.createElement("div",{className:a("px-4 py-2 space-y-1")},c.map((({value:r,name:t},a)=>{var o,m;const l=null!==(o=Object.keys(p).find((e=>p[e]===t)))&&void 0!==o?o:"",s=null!==(m=i[l])&&void 0!==m?m:d;return e.createElement(n,{key:`id-${a}`,value:i&&s?s(r):`${r}`,name:t})})))):null};export{m as ChartTooltipFrame,n as ChartTooltipRow,l as default}; diff --git a/dist/components/chart-elements/ScatterChart/index.d.ts b/dist/components/chart-elements/ScatterChart/index.d.ts new file mode 100644 index 000000000..538f51039 --- /dev/null +++ b/dist/components/chart-elements/ScatterChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as ScatterChart } from "./ScatterChart"; +export type { ScatterChartProps } from "./ScatterChart"; diff --git a/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts b/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts new file mode 100644 index 000000000..75833c6bf --- /dev/null +++ b/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts @@ -0,0 +1,5 @@ +interface BaseAnimationTimingProps { + animationDuration?: number; + showAnimation?: boolean; +} +export default BaseAnimationTimingProps; diff --git a/dist/components/chart-elements/common/BaseChartProps.d.ts b/dist/components/chart-elements/common/BaseChartProps.d.ts new file mode 100644 index 000000000..33c21dee7 --- /dev/null +++ b/dist/components/chart-elements/common/BaseChartProps.d.ts @@ -0,0 +1,42 @@ +/// +import { Color, ValueFormatter, IntervalType } from "../../../lib"; +import type BaseAnimationTimingProps from "./BaseAnimationTimingProps"; +import { CustomTooltipProps } from "./CustomTooltipProps"; +type FixedProps = { + eventType: "dot" | "category" | "bar" | "slice" | "bubble"; + categoryClicked: string; +}; +type BaseEventProps = FixedProps & { + [key: string]: number | string; +}; +export type EventProps = BaseEventProps | null | undefined; +interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { + data: any[]; + categories: string[]; + index: string; + colors?: (Color | string)[]; + valueFormatter?: ValueFormatter; + startEndOnly?: boolean; + showXAxis?: boolean; + showYAxis?: boolean; + yAxisWidth?: number; + intervalType?: IntervalType; + showTooltip?: boolean; + showLegend?: boolean; + showGridLines?: boolean; + autoMinValue?: boolean; + minValue?: number; + maxValue?: number; + allowDecimals?: boolean; + noDataText?: string; + onValueChange?: (value: EventProps) => void; + enableLegendSlider?: boolean; + customTooltip?: React.ComponentType; + rotateLabelX?: { + angle: number; + verticalShift?: number; + xAxisHeight?: number; + }; + tickGap?: number; +} +export default BaseChartProps; diff --git a/dist/components/chart-elements/common/ChartLegend.cjs b/dist/components/chart-elements/common/ChartLegend.cjs new file mode 100644 index 000000000..9774463dc --- /dev/null +++ b/dist/components/chart-elements/common/ChartLegend.cjs @@ -0,0 +1 @@ +"use strict";var e=require("react"),t=require("../../../hooks/useOnWindowResize.cjs"),r=require("../../text-elements/Legend/Legend.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(e);module.exports=({payload:n},a,u,i,c,o)=>{const s=e.useRef(null);t((()=>{var e;var t;u((t=null===(e=s.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)}));const d=n.filter((e=>"none"!==e.type));return l.default.createElement("div",{ref:s,className:"flex items-center justify-end"},l.default.createElement(r,{categories:d.map((e=>e.value)),colors:d.map((e=>a.get(e.value))),onClickLegendItem:c,activeLegend:i,enableLegendSlider:o}))}; diff --git a/dist/components/chart-elements/common/ChartLegend.d.ts b/dist/components/chart-elements/common/ChartLegend.d.ts new file mode 100644 index 000000000..9984cb5ea --- /dev/null +++ b/dist/components/chart-elements/common/ChartLegend.d.ts @@ -0,0 +1,4 @@ +import React from "react"; +import { Color } from "../../../lib"; +declare const ChartLegend: ({ payload }: any, categoryColors: Map, setLegendHeight: React.Dispatch>, activeLegend: string | undefined, onClick?: ((category: string, color: Color | string) => void) | undefined, enableLegendSlider?: boolean) => React.JSX.Element; +export default ChartLegend; diff --git a/dist/components/chart-elements/common/ChartLegend.js b/dist/components/chart-elements/common/ChartLegend.js new file mode 100644 index 000000000..b5a088505 --- /dev/null +++ b/dist/components/chart-elements/common/ChartLegend.js @@ -0,0 +1 @@ +import e,{useRef as t}from"react";import n from"../../../hooks/useOnWindowResize.js";import r from"../../text-elements/Legend/Legend.js";const o=({payload:o},l,a,i,s,m)=>{const c=t(null);n((()=>{var e;var t;a((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)}));const d=o.filter((e=>"none"!==e.type));return e.createElement("div",{ref:c,className:"flex items-center justify-end"},e.createElement(r,{categories:d.map((e=>e.value)),colors:d.map((e=>l.get(e.value))),onClickLegendItem:s,activeLegend:i,enableLegendSlider:m}))};export{o as default}; diff --git a/dist/components/chart-elements/common/ChartTooltip.cjs b/dist/components/chart-elements/common/ChartTooltip.cjs new file mode 100644 index 000000000..4df5f0c98 --- /dev/null +++ b/dist/components/chart-elements/common/ChartTooltip.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(e);const m=({children:e})=>l.default.createElement("div",{className:a.tremorTwMerge("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),n=({value:e,name:r,color:d})=>l.default.createElement("div",{className:"flex items-center justify-between space-x-8"},l.default.createElement("div",{className:"flex items-center space-x-2"},l.default.createElement("span",{className:a.tremorTwMerge("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o.getColorClassNames(d,t.colorPalette.background).bgColor)}),l.default.createElement("p",{className:a.tremorTwMerge("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},r)),l.default.createElement("p",{className:a.tremorTwMerge("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e));exports.ChartTooltipFrame=m,exports.ChartTooltipRow=n,exports.default=({active:e,payload:t,label:o,categoryColors:d,valueFormatter:s})=>{if(e&&t){const e=t.filter((e=>"none"!==e.type));return l.default.createElement(m,null,l.default.createElement("div",{className:a.tremorTwMerge("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},l.default.createElement("p",{className:a.tremorTwMerge("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},o)),l.default.createElement("div",{className:a.tremorTwMerge("px-4 py-2 space-y-1")},e.map((({value:e,name:t},a)=>{var o;return l.default.createElement(n,{key:`id-${a}`,value:s(e),name:t,color:null!==(o=d.get(t))&&void 0!==o?o:r.BaseColors.Blue})}))))}return null}; diff --git a/dist/components/chart-elements/common/ChartTooltip.d.ts b/dist/components/chart-elements/common/ChartTooltip.d.ts new file mode 100644 index 000000000..4a714502a --- /dev/null +++ b/dist/components/chart-elements/common/ChartTooltip.d.ts @@ -0,0 +1,20 @@ +import React from "react"; +import { Color, ValueFormatter } from "lib"; +export declare const ChartTooltipFrame: ({ children }: { + children: React.ReactNode; +}) => React.JSX.Element; +export interface ChartTooltipRowProps { + value: string; + name: string; + color: Color | string; +} +export declare const ChartTooltipRow: ({ value, name, color }: ChartTooltipRowProps) => React.JSX.Element; +export interface ChartTooltipProps { + active: boolean | undefined; + payload: any; + label: string; + categoryColors: Map; + valueFormatter: ValueFormatter; +} +declare const ChartTooltip: ({ active, payload, label, categoryColors, valueFormatter, }: ChartTooltipProps) => React.JSX.Element | null; +export default ChartTooltip; diff --git a/dist/components/chart-elements/common/ChartTooltip.js b/dist/components/chart-elements/common/ChartTooltip.js new file mode 100644 index 000000000..80c9ba489 --- /dev/null +++ b/dist/components/chart-elements/common/ChartTooltip.js @@ -0,0 +1 @@ +import e from"react";import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";const m=({children:r})=>e.createElement("div",{className:a("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},r),d=({value:r,name:m,color:d})=>e.createElement("div",{className:"flex items-center justify-between space-x-8"},e.createElement("div",{className:"flex items-center space-x-2"},e.createElement("span",{className:a("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o(d,t.background).bgColor)}),e.createElement("p",{className:a("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},m)),e.createElement("p",{className:a("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r)),n=({active:t,payload:o,label:n,categoryColors:l,valueFormatter:s})=>{if(t&&o){const t=o.filter((e=>"none"!==e.type));return e.createElement(m,null,e.createElement("div",{className:a("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},e.createElement("p",{className:a("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},n)),e.createElement("div",{className:a("px-4 py-2 space-y-1")},t.map((({value:t,name:a},o)=>{var m;return e.createElement(d,{key:`id-${o}`,value:s(t),name:a,color:null!==(m=l.get(a))&&void 0!==m?m:r.Blue})}))))}return null};export{m as ChartTooltipFrame,d as ChartTooltipRow,n as default}; diff --git a/dist/components/chart-elements/common/CustomTooltipProps.d.ts b/dist/components/chart-elements/common/CustomTooltipProps.d.ts new file mode 100644 index 000000000..221d6f921 --- /dev/null +++ b/dist/components/chart-elements/common/CustomTooltipProps.d.ts @@ -0,0 +1,6 @@ +import { NameType, Payload } from "recharts/types/component/DefaultTooltipContent"; +export type CustomTooltipProps = { + payload: Payload[] | undefined; + active: boolean | undefined; + label: NameType | undefined; +}; diff --git a/dist/components/chart-elements/common/NoData.cjs b/dist/components/chart-elements/common/NoData.cjs new file mode 100644 index 000000000..3b4e54b1b --- /dev/null +++ b/dist/components/chart-elements/common/NoData.cjs @@ -0,0 +1 @@ +"use strict";var e=require("../../../lib/tremorTwMerge.cjs"),r=require("react"),t=require("../../layout-elements/Flex/Flex.cjs"),o=require("../../text-elements/Text/Text.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(r);module.exports=({noDataText:r="No data"})=>d.default.createElement(t,{alignItems:"center",justifyContent:"center",className:e.tremorTwMerge("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},d.default.createElement(o,{className:e.tremorTwMerge("text-tremor-content","dark:text-dark-tremor-content")},r)); diff --git a/dist/components/chart-elements/common/NoData.d.ts b/dist/components/chart-elements/common/NoData.d.ts new file mode 100644 index 000000000..5159890f6 --- /dev/null +++ b/dist/components/chart-elements/common/NoData.d.ts @@ -0,0 +1,6 @@ +import React from "react"; +interface NoDataProps { + noDataText?: string; +} +declare const NoData: ({ noDataText }: NoDataProps) => React.JSX.Element; +export default NoData; diff --git a/dist/components/chart-elements/common/NoData.js b/dist/components/chart-elements/common/NoData.js new file mode 100644 index 000000000..a0e8a1884 --- /dev/null +++ b/dist/components/chart-elements/common/NoData.js @@ -0,0 +1 @@ +import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import r from"react";import t from"../../layout-elements/Flex/Flex.js";import o from"../../text-elements/Text/Text.js";const a=({noDataText:a="No data"})=>r.createElement(t,{alignItems:"center",justifyContent:"center",className:e("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},r.createElement(o,{className:e("text-tremor-content","dark:text-dark-tremor-content")},a));export{a as default}; diff --git a/dist/components/chart-elements/common/index.d.ts b/dist/components/chart-elements/common/index.d.ts new file mode 100644 index 000000000..7a73db7fe --- /dev/null +++ b/dist/components/chart-elements/common/index.d.ts @@ -0,0 +1,2 @@ +export type { EventProps } from "./BaseChartProps"; +export type { CustomTooltipProps } from "./CustomTooltipProps"; diff --git a/dist/components/chart-elements/common/utils.cjs b/dist/components/chart-elements/common/utils.cjs new file mode 100644 index 000000000..e363ca0a7 --- /dev/null +++ b/dist/components/chart-elements/common/utils.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.constructCategories=(e,t)=>{if(!t)return[];const r=new Set;return e.forEach((e=>{r.add(e[t])})),Array.from(r)},exports.constructCategoryColors=(e,t)=>{const r=new Map;return e.forEach(((e,o)=>{r.set(e,t[o])})),r},exports.deepEqual=function e(t,r){if(t===r)return!0;if("object"!=typeof t||"object"!=typeof r||null===t||null===r)return!1;const o=Object.keys(t),n=Object.keys(r);if(o.length!==n.length)return!1;for(const s of o)if(!n.includes(s)||!e(t[s],r[s]))return!1;return!0},exports.getYAxisDomain=(e,t,r)=>[e?"auto":null!=t?t:0,null!=r?r:"auto"],exports.hasOnlyOneValueForThisKey=function(e,t){const r=[];for(const o of e)if(Object.prototype.hasOwnProperty.call(o,t)&&(r.push(o[t]),r.length>1))return!1;return!0}; diff --git a/dist/components/chart-elements/common/utils.d.ts b/dist/components/chart-elements/common/utils.d.ts new file mode 100644 index 000000000..d128c66bd --- /dev/null +++ b/dist/components/chart-elements/common/utils.d.ts @@ -0,0 +1,6 @@ +import { Color } from "../../../lib/inputTypes"; +export declare const constructCategoryColors: (categories: string[], colors: (Color | string)[]) => Map; +export declare const getYAxisDomain: (autoMinValue: boolean, minValue: number | undefined, maxValue: number | undefined) => (string | number)[]; +export declare const constructCategories: (data: any[], color?: string) => string[]; +export declare function deepEqual(obj1: any, obj2: any): boolean; +export declare function hasOnlyOneValueForThisKey(array: any[], keyToCheck: string): boolean; diff --git a/dist/components/chart-elements/common/utils.js b/dist/components/chart-elements/common/utils.js new file mode 100644 index 000000000..66b8a5f9a --- /dev/null +++ b/dist/components/chart-elements/common/utils.js @@ -0,0 +1 @@ +const t=(t,n)=>{const r=new Map;return t.forEach(((t,e)=>{r.set(t,n[e])})),r},n=(t,n,r)=>[t?"auto":null!=n?n:0,null!=r?r:"auto"],r=(t,n)=>{if(!n)return[];const r=new Set;return t.forEach((t=>{r.add(t[n])})),Array.from(r)};function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;const r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(const u of r)if(!o.includes(u)||!e(t[u],n[u]))return!1;return!0}function o(t,n){const r=[];for(const e of t)if(Object.prototype.hasOwnProperty.call(e,n)&&(r.push(e[n]),r.length>1))return!1;return!0}export{r as constructCategories,t as constructCategoryColors,e as deepEqual,n as getYAxisDomain,o as hasOnlyOneValueForThisKey}; diff --git a/dist/components/chart-elements/index.d.ts b/dist/components/chart-elements/index.d.ts new file mode 100644 index 000000000..f8327e561 --- /dev/null +++ b/dist/components/chart-elements/index.d.ts @@ -0,0 +1,7 @@ +export * from "./AreaChart"; +export * from "./BarChart"; +export { EventProps } from "./common/BaseChartProps"; +export { CustomTooltipProps } from "./common/CustomTooltipProps"; +export * from "./DonutChart"; +export * from "./LineChart"; +export * from "./ScatterChart"; diff --git a/dist/components/icon-elements/Badge/Badge.cjs b/dist/components/icon-elements/Badge/Badge.cjs new file mode 100644 index 000000000..f5319ea6b --- /dev/null +++ b/dist/components/icon-elements/Badge/Badge.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("./styles.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(r);const d=i.makeClassName("Badge"),m=c.default.forwardRef(((r,n)=>{const{color:m,icon:g,size:u=o.Sizes.SM,tooltip:p,className:b,children:f}=r,k=e.__rest(r,["color","icon","size","tooltip","className","children"]),w=g||null,{tooltipProps:h,getReferenceProps:j}=t.useTooltip();return c.default.createElement("span",Object.assign({ref:i.mergeRefs([n,h.refs.setReference]),className:s.tremorTwMerge(d("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",m?s.tremorTwMerge(i.getColorClassNames(m,a.colorPalette.background).bgColor,i.getColorClassNames(m,a.colorPalette.iconText).textColor,i.getColorClassNames(m,a.colorPalette.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):s.tremorTwMerge("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),l.badgeProportions[u].paddingX,l.badgeProportions[u].paddingY,l.badgeProportions[u].fontSize,b)},j,k),c.default.createElement(t.default,Object.assign({text:p},h)),w?c.default.createElement(w,{className:s.tremorTwMerge(d("icon"),"shrink-0 -ml-1 mr-1.5",l.iconSizes[u].height,l.iconSizes[u].width)}):null,c.default.createElement("span",{className:s.tremorTwMerge(d("text"),"whitespace-nowrap")},f))}));m.displayName="Badge",module.exports=m; diff --git a/dist/components/icon-elements/Badge/Badge.d.ts b/dist/components/icon-elements/Badge/Badge.d.ts new file mode 100644 index 000000000..56099f2b3 --- /dev/null +++ b/dist/components/icon-elements/Badge/Badge.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +import { Color, Size } from "lib"; +export interface BadgeProps extends React.HTMLAttributes { + color?: Color; + size?: Size; + icon?: React.ElementType; + tooltip?: string; +} +declare const Badge: React.ForwardRefExoticComponent>; +export default Badge; diff --git a/dist/components/icon-elements/Badge/Badge.js b/dist/components/icon-elements/Badge/Badge.js new file mode 100644 index 000000000..c80c18386 --- /dev/null +++ b/dist/components/icon-elements/Badge/Badge.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as r}from"tslib";import e from"react";import t,{useTooltip as o}from"../../util-elements/Tooltip/Tooltip.js";import{Sizes as i}from"../../../lib/constants.js";import{colorPalette as a}from"../../../lib/theme.js";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,getColorClassNames as l,makeClassName as m}from"../../../lib/utils.js";import{badgeProportions as c,iconSizes as d}from"./styles.js";const p=m("Badge"),g=e.forwardRef(((m,g)=>{const{color:f,icon:b,size:u=i.SM,tooltip:k,className:h,children:j}=m,x=r(m,["color","icon","size","tooltip","className","children"]),y=b||null,{tooltipProps:w,getReferenceProps:N}=o();return e.createElement("span",Object.assign({ref:s([g,w.refs.setReference]),className:n(p("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",f?n(l(f,a.background).bgColor,l(f,a.iconText).textColor,l(f,a.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):n("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),c[u].paddingX,c[u].paddingY,c[u].fontSize,h)},N,x),e.createElement(t,Object.assign({text:k},w)),y?e.createElement(y,{className:n(p("icon"),"shrink-0 -ml-1 mr-1.5",d[u].height,d[u].width)}):null,e.createElement("span",{className:n(p("text"),"whitespace-nowrap")},j))}));g.displayName="Badge";export{g as default}; diff --git a/dist/components/icon-elements/Badge/index.d.ts b/dist/components/icon-elements/Badge/index.d.ts new file mode 100644 index 000000000..7a1b96baf --- /dev/null +++ b/dist/components/icon-elements/Badge/index.d.ts @@ -0,0 +1,2 @@ +export { default as Badge } from "./Badge"; +export type { BadgeProps } from "./Badge"; diff --git a/dist/components/icon-elements/Badge/styles.cjs b/dist/components/icon-elements/Badge/styles.cjs new file mode 100644 index 000000000..4fc7cee32 --- /dev/null +++ b/dist/components/icon-elements/Badge/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.badgeProportions={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/icon-elements/Badge/styles.d.ts b/dist/components/icon-elements/Badge/styles.d.ts new file mode 100644 index 000000000..5e5feb96a --- /dev/null +++ b/dist/components/icon-elements/Badge/styles.d.ts @@ -0,0 +1,14 @@ +export type BadgeProportionTypes = { + paddingX: string; + paddingY: string; + fontSize: string; +}; +export declare const badgeProportions: { + [char: string]: BadgeProportionTypes; +}; +export declare const iconSizes: { + [size: string]: { + height: string; + width: string; + }; +}; diff --git a/dist/components/icon-elements/Badge/styles.js b/dist/components/icon-elements/Badge/styles.js new file mode 100644 index 000000000..2e701d5a9 --- /dev/null +++ b/dist/components/icon-elements/Badge/styles.js @@ -0,0 +1 @@ +const d={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},t={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}};export{d as badgeProportions,t as iconSizes}; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs b/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs new file mode 100644 index 000000000..74f590576 --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),s=require("../../../lib/constants.cjs"),i=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),a=require("./styles.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(t);const c=o.makeClassName("BadgeDelta"),d=n.default.forwardRef(((t,l)=>{const{deltaType:d=s.DeltaTypes.Increase,isIncreasePositive:p=!0,size:u=s.Sizes.SM,tooltip:m,children:g,className:f}=t,T=e.__rest(t,["deltaType","isIncreasePositive","size","tooltip","children","className"]),y=a.deltaIcons[d],b=o.mapInputsToDeltaType(d,p),w=g?a.badgeProportionsWithText:a.badgeProportionsIconOnly,{tooltipProps:h,getReferenceProps:j}=r.useTooltip();return n.default.createElement("span",Object.assign({ref:o.mergeRefs([l,h.refs.setReference]),className:i.tremorTwMerge(c("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",a.colors[b].bgColor,a.colors[b].textColor,a.colors[b].ringColor,w[u].paddingX,w[u].paddingY,w[u].fontSize,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60",f)},j,T),n.default.createElement(r.default,Object.assign({text:m},h)),n.default.createElement(y,{className:i.tremorTwMerge(c("icon"),"shrink-0",g?i.tremorTwMerge("-ml-1 mr-1.5"):a.iconSizes[u].height,a.iconSizes[u].width)}),g?n.default.createElement("span",{className:i.tremorTwMerge(c("text"),"whitespace-nowrap")},g):null)}));d.displayName="BadgeDelta",module.exports=d; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts b/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts new file mode 100644 index 000000000..9db78b535 --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +import { DeltaType, Size } from "lib"; +export interface BadgeDeltaProps extends React.HTMLAttributes { + deltaType?: DeltaType; + isIncreasePositive?: boolean; + size?: Size; + tooltip?: string; +} +declare const BadgeDelta: React.ForwardRefExoticComponent>; +export default BadgeDelta; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.js b/dist/components/icon-elements/BadgeDelta/BadgeDelta.js new file mode 100644 index 000000000..39f2ccaa6 --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/BadgeDelta.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import r,{useTooltip as i}from"../../util-elements/Tooltip/Tooltip.js";import{DeltaTypes as s,Sizes as o}from"../../../lib/constants.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as n,mapInputsToDeltaType as m}from"../../../lib/utils.js";import{colors as c,iconSizes as p,deltaIcons as d,badgeProportionsWithText as f,badgeProportionsIconOnly as g}from"./styles.js";const b=n("BadgeDelta"),u=t.forwardRef(((n,u)=>{const{deltaType:y=s.Increase,isIncreasePositive:h=!0,size:j=o.SM,tooltip:w,children:x,className:N}=n,T=e(n,["deltaType","isIncreasePositive","size","tooltip","children","className"]),k=d[y],E=m(y,h),P=x?f:g,{tooltipProps:z,getReferenceProps:C}=i();return t.createElement("span",Object.assign({ref:l([u,z.refs.setReference]),className:a(b("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",c[E].bgColor,c[E].textColor,c[E].ringColor,P[j].paddingX,P[j].paddingY,P[j].fontSize,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60",N)},C,T),t.createElement(r,Object.assign({text:w},z)),t.createElement(k,{className:a(b("icon"),"shrink-0",x?a("-ml-1 mr-1.5"):p[j].height,p[j].width)}),x?t.createElement("span",{className:a(b("text"),"whitespace-nowrap")},x):null)}));u.displayName="BadgeDelta";export{u as default}; diff --git a/dist/components/icon-elements/BadgeDelta/index.d.ts b/dist/components/icon-elements/BadgeDelta/index.d.ts new file mode 100644 index 000000000..5b0cc86ad --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/index.d.ts @@ -0,0 +1,2 @@ +export { default as BadgeDelta } from "./BadgeDelta"; +export type { BadgeDeltaProps } from "./BadgeDelta"; diff --git a/dist/components/icon-elements/BadgeDelta/styles.cjs b/dist/components/icon-elements/BadgeDelta/styles.cjs new file mode 100644 index 000000000..303048c34 --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs");require("tslib"),require("react");var t=require("../../../assets/ArrowDownIcon.cjs"),s=require("../../../assets/ArrowDownRightIcon.cjs"),l=require("../../../assets/ArrowRightIcon.cjs"),a=require("../../../assets/ArrowUpIcon.cjs"),i=require("../../../assets/ArrowUpRightIcon.cjs");const n={[e.DeltaTypes.Increase]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.ModerateIncrease]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.Decrease]:{bgColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.ModerateDecrease]:{bgColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.Unchanged]:{bgColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.iconRing).ringColor}},g={[e.DeltaTypes.Increase]:a,[e.DeltaTypes.ModerateIncrease]:i,[e.DeltaTypes.Decrease]:t,[e.DeltaTypes.ModerateDecrease]:s,[e.DeltaTypes.Unchanged]:l};exports.badgeProportionsIconOnly={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},exports.badgeProportionsWithText={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},exports.colors=n,exports.deltaIcons=g,exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/icon-elements/BadgeDelta/styles.d.ts b/dist/components/icon-elements/BadgeDelta/styles.d.ts new file mode 100644 index 000000000..96d4213ec --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/styles.d.ts @@ -0,0 +1,29 @@ +/// +export type BadgeProportionTypes = { + paddingX: string; + paddingY: string; + fontSize: string; +}; +export declare const badgeProportionsIconOnly: { + [char: string]: BadgeProportionTypes; +}; +export declare const badgeProportionsWithText: { + [char: string]: BadgeProportionTypes; +}; +export declare const iconSizes: { + [size: string]: { + height: string; + width: string; + }; +}; +export type ColorTypes = { + bgColor: string; + textColor: string; + ringColor: string; +}; +export declare const colors: { + [key: string]: ColorTypes; +}; +export declare const deltaIcons: { + [key: string]: React.ElementType; +}; diff --git a/dist/components/icon-elements/BadgeDelta/styles.js b/dist/components/icon-elements/BadgeDelta/styles.js new file mode 100644 index 000000000..7adacd674 --- /dev/null +++ b/dist/components/icon-elements/BadgeDelta/styles.js @@ -0,0 +1 @@ +import{DeltaTypes as o,BaseColors as r}from"../../../lib/constants.js";import{colorPalette as e}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as t}from"../../../lib/utils.js";import"tslib";import"react";import i from"../../../assets/ArrowDownIcon.js";import n from"../../../assets/ArrowDownRightIcon.js";import d from"../../../assets/ArrowRightIcon.js";import g from"../../../assets/ArrowUpIcon.js";import a from"../../../assets/ArrowUpRightIcon.js";const p={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},l={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},s={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},x={[o.Increase]:{bgColor:t(r.Emerald,e.background).bgColor,textColor:t(r.Emerald,e.iconText).textColor,ringColor:t(r.Emerald,e.iconRing).ringColor},[o.ModerateIncrease]:{bgColor:t(r.Emerald,e.background).bgColor,textColor:t(r.Emerald,e.iconText).textColor,ringColor:t(r.Emerald,e.iconRing).ringColor},[o.Decrease]:{bgColor:t(r.Red,e.background).bgColor,textColor:t(r.Red,e.iconText).textColor,ringColor:t(r.Red,e.iconRing).ringColor},[o.ModerateDecrease]:{bgColor:t(r.Red,e.background).bgColor,textColor:t(r.Red,e.iconText).textColor,ringColor:t(r.Red,e.iconRing).ringColor},[o.Unchanged]:{bgColor:t(r.Orange,e.background).bgColor,textColor:t(r.Orange,e.iconText).textColor,ringColor:t(r.Orange,e.iconRing).ringColor}},m={[o.Increase]:g,[o.ModerateIncrease]:a,[o.Decrease]:i,[o.ModerateDecrease]:n,[o.Unchanged]:d};export{p as badgeProportionsIconOnly,l as badgeProportionsWithText,x as colors,m as deltaIcons,s as iconSizes}; diff --git a/dist/components/icon-elements/Icon/Icon.cjs b/dist/components/icon-elements/Icon/Icon.cjs new file mode 100644 index 000000000..9352918cd --- /dev/null +++ b/dist/components/icon-elements/Icon/Icon.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("../../../lib/constants.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),a=require("./styles.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(r);const c=i.makeClassName("Icon"),p={Simple:"simple",Light:"light",Shadow:"shadow",Solid:"solid",Outlined:"outlined"},d=n.default.forwardRef(((r,l)=>{const{icon:d,variant:u=p.Simple,tooltip:f,size:m=o.Sizes.SM,color:g,className:h}=r,b=e.__rest(r,["icon","variant","tooltip","size","color","className"]),j=d,w=a.getIconColors(u,g),{tooltipProps:S,getReferenceProps:q}=t.useTooltip();return n.default.createElement("span",Object.assign({ref:i.mergeRefs([l,S.refs.setReference]),className:s.tremorTwMerge(c("root"),"inline-flex shrink-0 items-center justify-center",w.bgColor,w.textColor,w.borderColor,w.ringColor,a.shape[u].rounded,a.shape[u].border,a.shape[u].shadow,a.shape[u].ring,a.wrapperProportions[m].paddingX,a.wrapperProportions[m].paddingY,h)},q,b),n.default.createElement(t.default,Object.assign({text:f},S)),n.default.createElement(j,{className:s.tremorTwMerge(c("icon"),"shrink-0",a.iconSizes[m].height,a.iconSizes[m].width)}))}));d.displayName="Icon",exports.IconVariants=p,exports.default=d; diff --git a/dist/components/icon-elements/Icon/Icon.d.ts b/dist/components/icon-elements/Icon/Icon.d.ts new file mode 100644 index 000000000..0041a26a3 --- /dev/null +++ b/dist/components/icon-elements/Icon/Icon.d.ts @@ -0,0 +1,14 @@ +import React from "react"; +import { Color, IconVariant, Size } from "../../../lib"; +export declare const IconVariants: { + [key: string]: IconVariant; +}; +export interface IconProps extends React.HTMLAttributes { + icon: React.ElementType; + variant?: IconVariant; + tooltip?: string; + size?: Size; + color?: Color; +} +declare const Icon: React.ForwardRefExoticComponent>; +export default Icon; diff --git a/dist/components/icon-elements/Icon/Icon.js b/dist/components/icon-elements/Icon/Icon.js new file mode 100644 index 000000000..65e6f67a6 --- /dev/null +++ b/dist/components/icon-elements/Icon/Icon.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import o from"react";import t,{useTooltip as r}from"../../util-elements/Tooltip/Tooltip.js";import{Sizes as i}from"../../../lib/constants.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as n}from"../../../lib/utils.js";import{getIconColors as a,shape as m,wrapperProportions as c,iconSizes as p}from"./styles.js";const d=n("Icon"),f={Simple:"simple",Light:"light",Shadow:"shadow",Solid:"solid",Outlined:"outlined"},g=o.forwardRef(((n,g)=>{const{icon:h,variant:b=f.Simple,tooltip:j,size:u=i.SM,color:w,className:N}=n,S=e(n,["icon","variant","tooltip","size","color","className"]),x=h,C=a(b,w),{tooltipProps:y,getReferenceProps:E}=r();return o.createElement("span",Object.assign({ref:l([g,y.refs.setReference]),className:s(d("root"),"inline-flex shrink-0 items-center justify-center",C.bgColor,C.textColor,C.borderColor,C.ringColor,m[b].rounded,m[b].border,m[b].shadow,m[b].ring,c[u].paddingX,c[u].paddingY,N)},E,S),o.createElement(t,Object.assign({text:j},y)),o.createElement(x,{className:s(d("icon"),"shrink-0",p[u].height,p[u].width)}))}));g.displayName="Icon";export{f as IconVariants,g as default}; diff --git a/dist/components/icon-elements/Icon/index.d.ts b/dist/components/icon-elements/Icon/index.d.ts new file mode 100644 index 000000000..74325024c --- /dev/null +++ b/dist/components/icon-elements/Icon/index.d.ts @@ -0,0 +1,2 @@ +export { default as Icon } from "./Icon"; +export type { IconProps } from "./Icon"; diff --git a/dist/components/icon-elements/Icon/styles.cjs b/dist/components/icon-elements/Icon/styles.cjs new file mode 100644 index 000000000..40525ce78 --- /dev/null +++ b/dist/components/icon-elements/Icon/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../lib/theme.cjs"),o=require("../../../lib/tremorTwMerge.cjs"),e=require("../../../lib/utils.cjs");exports.getIconColors=(t,d)=>{switch(t){case"simple":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:d?e.getColorClassNames(d,r.colorPalette.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},exports.iconSizes={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},exports.shape={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},exports.wrapperProportions={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}}; diff --git a/dist/components/icon-elements/Icon/styles.d.ts b/dist/components/icon-elements/Icon/styles.d.ts new file mode 100644 index 000000000..0635088d2 --- /dev/null +++ b/dist/components/icon-elements/Icon/styles.d.ts @@ -0,0 +1,29 @@ +import { Color, IconVariant } from "lib"; +export type WrapperProportionTypes = { + paddingX: string; + paddingY: string; +}; +export declare const wrapperProportions: { + [size: string]: WrapperProportionTypes; +}; +export declare const iconSizes: { + [size: string]: { + height: string; + width: string; + }; +}; +export type ShapeTypes = { + rounded: string; + border: string; + ring: string; + shadow: string; +}; +export declare const shape: { + [style: string]: ShapeTypes; +}; +export declare const getIconColors: (variant: IconVariant, color?: Color) => { + textColor: string; + bgColor: string; + borderColor: string; + ringColor: string; +}; diff --git a/dist/components/icon-elements/Icon/styles.js b/dist/components/icon-elements/Icon/styles.js new file mode 100644 index 000000000..5264f21f5 --- /dev/null +++ b/dist/components/icon-elements/Icon/styles.js @@ -0,0 +1 @@ +import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as d}from"../../../lib/utils.js";const e={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},t={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},a={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},n=(e,t)=>{switch(e){case"simple":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?d(t,r.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?o(d(t,r.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}};export{n as getIconColors,t as iconSizes,a as shape,e as wrapperProportions}; diff --git a/dist/components/icon-elements/index.d.ts b/dist/components/icon-elements/index.d.ts new file mode 100644 index 000000000..b6e0e54f0 --- /dev/null +++ b/dist/components/icon-elements/index.d.ts @@ -0,0 +1,3 @@ +export * from "./Badge"; +export * from "./BadgeDelta"; +export * from "./Icon"; diff --git a/dist/components/index.d.ts b/dist/components/index.d.ts new file mode 100644 index 000000000..c0342ea97 --- /dev/null +++ b/dist/components/index.d.ts @@ -0,0 +1,8 @@ +export * from "./chart-elements"; +export * from "./icon-elements"; +export * from "./input-elements"; +export * from "./layout-elements"; +export * from "./list-elements"; +export * from "./spark-elements"; +export * from "./text-elements"; +export * from "./vis-elements"; diff --git a/dist/components/input-elements/BaseInput.cjs b/dist/components/input-elements/BaseInput.cjs new file mode 100644 index 000000000..5df13697e --- /dev/null +++ b/dist/components/input-elements/BaseInput.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("../../assets/ExclamationFilledIcon.cjs"),a=require("../../assets/EyeIcon.cjs"),n=require("../../assets/EyeOffIcon.cjs"),o=require("./selectUtils.cjs"),l=require("../../lib/tremorTwMerge.cjs"),s=require("../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(t);const c=d.default.forwardRef(((u,c)=>{const{value:m,defaultValue:i,type:p,placeholder:f="Type...",icon:b,error:g=!1,errorMessage:h,disabled:k=!1,stepper:x,makeInputClassName:w,className:v,onChange:E,onValueChange:M,autoFocus:N}=u,T=e.__rest(u,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[y,C]=t.useState(N||!1),[j,q]=t.useState(!1),I=t.useCallback((()=>q(!j)),[j,q]),V=b,F=t.useRef(null),L=o.hasValue(m||i);return d.default.useEffect((()=>{const e=()=>C(!0),t=()=>C(!1),r=F.current;return r&&(r.addEventListener("focus",e),r.addEventListener("blur",t),N&&r.focus()),()=>{r&&(r.removeEventListener("focus",e),r.removeEventListener("blur",t))}}),[N]),d.default.createElement(d.default.Fragment,null,d.default.createElement("div",{className:l.tremorTwMerge(w("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",o.getSelectButtonColors(L,k,g),y&&l.tremorTwMerge("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),v)},V?d.default.createElement(V,{className:l.tremorTwMerge(w("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,d.default.createElement("input",Object.assign({ref:s.mergeRefs([F,c]),defaultValue:i,value:m,type:j?"text":p,className:l.tremorTwMerge(w("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",V?"pl-2":"pl-3",g?"pr-3":"pr-4",k?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:f,disabled:k,"data-testid":"base-input",onChange:e=>{null==E||E(e),null==M||M(e.target.value)}},T)),"password"!==p||k?null:d.default.createElement("button",{className:l.tremorTwMerge(w("toggleButton"),"mr-2"),type:"button",onClick:()=>I(),"aria-label":j?"Hide password":"Show Password"},j?d.default.createElement(n,{className:l.tremorTwMerge("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):d.default.createElement(a,{className:l.tremorTwMerge("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?d.default.createElement(r,{className:l.tremorTwMerge(w("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=x?x:null),g&&h?d.default.createElement("p",{className:l.tremorTwMerge(w("errorMessage"),"text-sm text-red-500 mt-1")},h):null)}));c.displayName="BaseInput",module.exports=c; diff --git a/dist/components/input-elements/BaseInput.d.ts b/dist/components/input-elements/BaseInput.d.ts new file mode 100644 index 000000000..457dad426 --- /dev/null +++ b/dist/components/input-elements/BaseInput.d.ts @@ -0,0 +1,15 @@ +import React, { ReactNode } from "react"; +export interface BaseInputProps extends React.InputHTMLAttributes { + type?: "text" | "password" | "email" | "url" | "number"; + defaultValue?: string | number; + value?: string | number; + icon?: React.ElementType | React.JSXElementConstructor; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + stepper?: ReactNode; + onValueChange?: (value: any) => void; + makeInputClassName: (className: string) => string; +} +declare const BaseInput: React.ForwardRefExoticComponent>; +export default BaseInput; diff --git a/dist/components/input-elements/BaseInput.js b/dist/components/input-elements/BaseInput.js new file mode 100644 index 000000000..56a2a483f --- /dev/null +++ b/dist/components/input-elements/BaseInput.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useState as r,useCallback as n,useRef as a}from"react";import o from"../../assets/ExclamationFilledIcon.js";import l from"../../assets/EyeIcon.js";import s from"../../assets/EyeOffIcon.js";import{getSelectButtonColors as m,hasValue as d}from"./selectUtils.js";import{tremorTwMerge as u}from"../../lib/tremorTwMerge.js";import{mergeRefs as c}from"../../lib/utils.js";const i=t.forwardRef(((i,p)=>{const{value:b,defaultValue:f,type:h,placeholder:k="Type...",icon:x,error:g=!1,errorMessage:w,disabled:E=!1,stepper:v,makeInputClassName:N,className:y,onChange:C,onValueChange:j,autoFocus:I}=i,V=e(i,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[F,L]=r(I||!1),[M,B]=r(!1),O=n((()=>B(!M)),[M,B]),T=x,H=a(null),P=d(b||f);return t.useEffect((()=>{const e=()=>L(!0),t=()=>L(!1),r=H.current;return r&&(r.addEventListener("focus",e),r.addEventListener("blur",t),I&&r.focus()),()=>{r&&(r.removeEventListener("focus",e),r.removeEventListener("blur",t))}}),[I]),t.createElement(t.Fragment,null,t.createElement("div",{className:u(N("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",m(P,E,g),F&&u("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),y)},T?t.createElement(T,{className:u(N("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,t.createElement("input",Object.assign({ref:c([H,p]),defaultValue:f,value:b,type:M?"text":h,className:u(N("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",T?"pl-2":"pl-3",g?"pr-3":"pr-4",E?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:k,disabled:E,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==j||j(e.target.value)}},V)),"password"!==h||E?null:t.createElement("button",{className:u(N("toggleButton"),"mr-2"),type:"button",onClick:()=>O(),"aria-label":M?"Hide password":"Show Password"},M?t.createElement(s,{className:u("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):t.createElement(l,{className:u("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?t.createElement(o,{className:u(N("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=v?v:null),g&&w?t.createElement("p",{className:u(N("errorMessage"),"text-sm text-red-500 mt-1")},w):null)}));i.displayName="BaseInput";export{i as default}; diff --git a/dist/components/input-elements/Button/Button.cjs b/dist/components/input-elements/Button/Button.cjs new file mode 100644 index 000000000..574f8176b --- /dev/null +++ b/dist/components/input-elements/Button/Button.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("react"),r=require("react-transition-state"),i=require("../../../lib/constants.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),a=require("../../../assets/LoadingSpinner.cjs"),l=require("./styles.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(o);const d=s.makeClassName("Button"),m=({loading:e,iconSize:t,iconPosition:o,Icon:r,needMargin:s,transitionStatus:l})=>{const u=s?o===i.HorizontalPositions.Left?n.tremorTwMerge("-ml-1","mr-1.5"):n.tremorTwMerge("-mr-1","ml-1.5"):"",m=n.tremorTwMerge("w-0 h-0"),g={default:m,entering:m,entered:t,exiting:t,exited:m};return e?c.default.createElement(a,{className:n.tremorTwMerge(d("icon"),"animate-spin shrink-0",u,g.default,g[l]),style:{transition:"width 150ms"}}):c.default.createElement(r,{className:n.tremorTwMerge(d("icon"),"shrink-0",t,u)})},g=c.default.forwardRef(((a,u)=>{const{icon:g,iconPosition:f=i.HorizontalPositions.Left,size:p=i.Sizes.SM,color:h,variant:w="primary",disabled:T,loading:M=!1,loadingText:b,children:x,tooltip:z,className:P}=a,S=e.__rest(a,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),C=g,j=M||T,B=void 0!==C||M,v=M&&b,q=!(!x&&!v),y=n.tremorTwMerge(l.iconSizes[p].height,l.iconSizes[p].width),E="light"!==w?n.tremorTwMerge("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",N=l.getButtonColors(w,h),k=l.getButtonProportions(w)[p],{tooltipProps:R,getReferenceProps:H}=t.useTooltip(300),[I,O]=r.useTransition({timeout:50});return o.useEffect((()=>{O(M)}),[M]),c.default.createElement("button",Object.assign({ref:s.mergeRefs([u,R.refs.setReference]),className:n.tremorTwMerge(d("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",E,k.paddingX,k.paddingY,k.fontSize,N.textColor,N.bgColor,N.borderColor,N.hoverBorderColor,j?"opacity-50 cursor-not-allowed":n.tremorTwMerge(l.getButtonColors(w,h).hoverTextColor,l.getButtonColors(w,h).hoverBgColor,l.getButtonColors(w,h).hoverBorderColor),P),disabled:j},H,S),c.default.createElement(t.default,Object.assign({text:z},R)),B&&f!==i.HorizontalPositions.Right?c.default.createElement(m,{loading:M,iconSize:y,iconPosition:f,Icon:C,transitionStatus:I.status,needMargin:q}):null,v||x?c.default.createElement("span",{className:n.tremorTwMerge(d("text"),"text-tremor-default whitespace-nowrap")},v?b:x):null,B&&f===i.HorizontalPositions.Right?c.default.createElement(m,{loading:M,iconSize:y,iconPosition:f,Icon:C,transitionStatus:I.status,needMargin:q}):null)}));g.displayName="Button",exports.ButtonIconOrSpinner=m,exports.default=g; diff --git a/dist/components/input-elements/Button/Button.d.ts b/dist/components/input-elements/Button/Button.d.ts new file mode 100644 index 000000000..0e7f352cf --- /dev/null +++ b/dist/components/input-elements/Button/Button.d.ts @@ -0,0 +1,25 @@ +import React from "react"; +import { type TransitionStatus } from "react-transition-state"; +import { ButtonVariant, Color, HorizontalPosition, Size } from "../../../lib"; +export interface ButtonIconOrSpinnerProps { + loading: boolean; + iconSize: string; + iconPosition: string; + Icon: React.ElementType | undefined; + needMargin: boolean; + transitionStatus: TransitionStatus; +} +export declare const ButtonIconOrSpinner: ({ loading, iconSize, iconPosition, Icon, needMargin, transitionStatus, }: ButtonIconOrSpinnerProps) => React.JSX.Element; +export interface ButtonProps extends React.ButtonHTMLAttributes { + icon?: React.ElementType; + iconPosition?: HorizontalPosition; + size?: Size; + color?: Color; + variant?: ButtonVariant; + disabled?: boolean; + loading?: boolean; + loadingText?: string; + tooltip?: string; +} +declare const Button: React.ForwardRefExoticComponent>; +export default Button; diff --git a/dist/components/input-elements/Button/Button.js b/dist/components/input-elements/Button/Button.js new file mode 100644 index 000000000..4f6a3ad5c --- /dev/null +++ b/dist/components/input-elements/Button/Button.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as t}from"tslib";import e,{useTooltip as o}from"../../util-elements/Tooltip/Tooltip.js";import i,{useEffect as r}from"react";import{useTransition as n}from"react-transition-state";import{HorizontalPositions as a,Sizes as s}from"../../../lib/constants.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{mergeRefs as m,makeClassName as c}from"../../../lib/utils.js";import d from"../../../assets/LoadingSpinner.js";import{iconSizes as p,getButtonColors as u,getButtonProportions as f}from"./styles.js";const g=c("Button"),h=({loading:t,iconSize:e,iconPosition:o,Icon:r,needMargin:n,transitionStatus:s})=>{const m=n?o===a.Left?l("-ml-1","mr-1.5"):l("-mr-1","ml-1.5"):"",c=l("w-0 h-0"),p={default:c,entering:c,entered:e,exiting:e,exited:c};return t?i.createElement(d,{className:l(g("icon"),"animate-spin shrink-0",m,p.default,p[s]),style:{transition:"width 150ms"}}):i.createElement(r,{className:l(g("icon"),"shrink-0",e,m)})},b=i.forwardRef(((c,d)=>{const{icon:b,iconPosition:x=a.Left,size:w=s.SM,color:j,variant:S="primary",disabled:v,loading:C=!1,loadingText:E,children:N,tooltip:P,className:y}=c,z=t(c,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),T=b,k=C||v,B=void 0!==T||C,M=C&&E,R=!(!N&&!M),I=l(p[w].height,p[w].width),L="light"!==S?l("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",O=u(S,j),X=f(S)[w],{tooltipProps:Y,getReferenceProps:q}=o(300),[A,D]=n({timeout:50});return r((()=>{D(C)}),[C]),i.createElement("button",Object.assign({ref:m([d,Y.refs.setReference]),className:l(g("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",L,X.paddingX,X.paddingY,X.fontSize,O.textColor,O.bgColor,O.borderColor,O.hoverBorderColor,k?"opacity-50 cursor-not-allowed":l(u(S,j).hoverTextColor,u(S,j).hoverBgColor,u(S,j).hoverBorderColor),y),disabled:k},q,z),i.createElement(e,Object.assign({text:P},Y)),B&&x!==a.Right?i.createElement(h,{loading:C,iconSize:I,iconPosition:x,Icon:T,transitionStatus:A.status,needMargin:R}):null,M||N?i.createElement("span",{className:l(g("text"),"text-tremor-default whitespace-nowrap")},M?E:N):null,B&&x===a.Right?i.createElement(h,{loading:C,iconSize:I,iconPosition:x,Icon:T,transitionStatus:A.status,needMargin:R}):null)}));b.displayName="Button";export{h as ButtonIconOrSpinner,b as default}; diff --git a/dist/components/input-elements/Button/index.d.ts b/dist/components/input-elements/Button/index.d.ts new file mode 100644 index 000000000..fdec70a12 --- /dev/null +++ b/dist/components/input-elements/Button/index.d.ts @@ -0,0 +1,2 @@ +export { default as Button } from "./Button"; +export type { ButtonProps } from "./Button"; diff --git a/dist/components/input-elements/Button/styles.cjs b/dist/components/input-elements/Button/styles.cjs new file mode 100644 index 000000000..b0b8e3ce8 --- /dev/null +++ b/dist/components/input-elements/Button/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../lib/theme.cjs"),e=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");exports.getButtonColors=(t,a)=>{switch(t){case"primary":return{textColor:a?o.getColorClassNames("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:a?o.getColorClassNames("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:a?o.getColorClassNames(a,r.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:a?o.getColorClassNames(a,r.colorPalette.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:a?o.getColorClassNames(a,r.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:a?o.getColorClassNames(a,r.colorPalette.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o.getColorClassNames("transparent").bgColor,hoverBgColor:a?e.tremorTwMerge(o.getColorClassNames(a,r.colorPalette.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:a?o.getColorClassNames(a,r.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:a?o.getColorClassNames(a,r.colorPalette.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o.getColorClassNames("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},exports.getButtonProportions=r=>"light"!==r?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/input-elements/Button/styles.d.ts b/dist/components/input-elements/Button/styles.d.ts new file mode 100644 index 000000000..7bd06c09c --- /dev/null +++ b/dist/components/input-elements/Button/styles.d.ts @@ -0,0 +1,56 @@ +import { ButtonVariant, Color } from "lib"; +export declare const iconSizes: { + [size: string]: { + height: string; + width: string; + }; +}; +export declare const getButtonProportions: (variant: ButtonVariant) => { + xs: { + paddingX: string; + paddingY: string; + fontSize: string; + }; + sm: { + paddingX: string; + paddingY: string; + fontSize: string; + }; + md: { + paddingX: string; + paddingY: string; + fontSize: string; + }; + lg: { + paddingX: string; + paddingY: string; + fontSize: string; + }; + xl: { + paddingX: string; + paddingY: string; + fontSize: string; + }; +}; +export declare const getButtonColors: (variant: ButtonVariant, color?: Color) => { + textColor: string; + hoverTextColor: string; + bgColor: string; + hoverBgColor: string; + borderColor: string; + hoverBorderColor: string; +} | { + textColor: string; + hoverTextColor: string; + bgColor: string; + hoverBgColor: string; + borderColor: string; + hoverBorderColor?: undefined; +} | { + textColor: string; + hoverTextColor: string; + bgColor: string; + borderColor: string; + hoverBorderColor: string; + hoverBgColor?: undefined; +}; diff --git a/dist/components/input-elements/Button/styles.js b/dist/components/input-elements/Button/styles.js new file mode 100644 index 000000000..dd8714777 --- /dev/null +++ b/dist/components/input-elements/Button/styles.js @@ -0,0 +1 @@ +import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";const t={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},d=r=>"light"!==r?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},a=(t,d)=>{switch(t){case"primary":return{textColor:d?o("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:d?o("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:d?o(d,r.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:d?o(d,r.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:d?o(d,r.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:d?o(d,r.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:d?o(d,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:d?o(d,r.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o("transparent").bgColor,hoverBgColor:d?e(o(d,r.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:d?o(d,r.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:d?o(d,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:d?o(d,r.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o("transparent").bgColor,borderColor:"",hoverBorderColor:""}}};export{a as getButtonColors,d as getButtonProportions,t as iconSizes}; diff --git a/dist/components/input-elements/Calendar/Calendar.cjs b/dist/components/input-elements/Calendar/Calendar.cjs new file mode 100644 index 000000000..3be82c512 --- /dev/null +++ b/dist/components/input-elements/Calendar/Calendar.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("react-day-picker"),a=require("../../../assets/ArrowLeftHeadIcon.cjs"),o=require("../../../assets/ArrowRightHeadIcon.cjs"),n=require("../../../assets/DoubleArrowLeftHeadIcon.cjs"),s=require("../../../assets/DoubleArrowRightHeadIcon.cjs"),d=require("date-fns"),l=require("../../text-elements/Text/Text.cjs"),c=require("./NavButton.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(t);function m(t){var{mode:u,defaultMonth:m,selected:b,onSelect:f,locale:k,disabled:x,enableYearNavigation:h,classNames:v,weekStartsOn:p=0}=t,g=e.__rest(t,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return i.default.createElement(r.DayPicker,Object.assign({showOutsideDays:!0,mode:u,defaultMonth:m,selected:b,onSelect:f,locale:k,disabled:x,weekStartsOn:p,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},v),components:{IconLeft:t=>{var r=e.__rest(t,[]);return i.default.createElement(a,Object.assign({className:"h-4 w-4"},r))},IconRight:t=>{var r=e.__rest(t,[]);return i.default.createElement(o,Object.assign({className:"h-4 w-4"},r))},Caption:t=>{var u=e.__rest(t,[]);const{goToMonth:m,nextMonth:b,previousMonth:f,currentMonth:x}=r.useNavigation();return i.default.createElement("div",{className:"flex justify-between items-center"},i.default.createElement("div",{className:"flex items-center space-x-1"},h&&i.default.createElement(c.NavButton,{onClick:()=>x&&m(d.addYears(x,-1)),icon:n}),i.default.createElement(c.NavButton,{onClick:()=>f&&m(f),icon:a})),i.default.createElement(l,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},d.format(u.displayMonth,"LLLL yyy",{locale:k})),i.default.createElement("div",{className:"flex items-center space-x-1"},i.default.createElement(c.NavButton,{onClick:()=>b&&m(b),icon:o}),h&&i.default.createElement(c.NavButton,{onClick:()=>x&&m(d.addYears(x,1)),icon:s})))}}},g))}m.displayName="DateRangePicker",module.exports=m; diff --git a/dist/components/input-elements/Calendar/Calendar.d.ts b/dist/components/input-elements/Calendar/Calendar.d.ts new file mode 100644 index 000000000..d5a12e263 --- /dev/null +++ b/dist/components/input-elements/Calendar/Calendar.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +import { DayPickerRangeProps, DayPickerSingleProps } from "react-day-picker"; +declare function Calendar({ mode, defaultMonth, selected, onSelect, locale, disabled, enableYearNavigation, classNames, weekStartsOn, ...other }: T & { + enableYearNavigation: boolean; +}): React.JSX.Element; +declare namespace Calendar { + var displayName: string; +} +export default Calendar; diff --git a/dist/components/input-elements/Calendar/Calendar.js b/dist/components/input-elements/Calendar/Calendar.js new file mode 100644 index 000000000..cf9d47786 --- /dev/null +++ b/dist/components/input-elements/Calendar/Calendar.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import{DayPicker as r,useNavigation as a}from"react-day-picker";import o from"../../../assets/ArrowLeftHeadIcon.js";import n from"../../../assets/ArrowRightHeadIcon.js";import s from"../../../assets/DoubleArrowLeftHeadIcon.js";import c from"../../../assets/DoubleArrowRightHeadIcon.js";import{addYears as d,format as l}from"date-fns";import m from"../../text-elements/Text/Text.js";import{NavButton as i}from"./NavButton.js";function u(u){var{mode:b,defaultMonth:f,selected:k,onSelect:x,locale:p,disabled:h,enableYearNavigation:g,classNames:v,weekStartsOn:w=0}=u,y=e(u,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return t.createElement(r,Object.assign({showOutsideDays:!0,mode:b,defaultMonth:f,selected:k,onSelect:x,locale:p,disabled:h,weekStartsOn:w,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},v),components:{IconLeft:r=>{var a=e(r,[]);return t.createElement(o,Object.assign({className:"h-4 w-4"},a))},IconRight:r=>{var a=e(r,[]);return t.createElement(n,Object.assign({className:"h-4 w-4"},a))},Caption:r=>{var u=e(r,[]);const{goToMonth:b,nextMonth:f,previousMonth:k,currentMonth:x}=a();return t.createElement("div",{className:"flex justify-between items-center"},t.createElement("div",{className:"flex items-center space-x-1"},g&&t.createElement(i,{onClick:()=>x&&b(d(x,-1)),icon:s}),t.createElement(i,{onClick:()=>k&&b(k),icon:o})),t.createElement(m,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},l(u.displayMonth,"LLLL yyy",{locale:p})),t.createElement("div",{className:"flex items-center space-x-1"},t.createElement(i,{onClick:()=>f&&b(f),icon:n}),g&&t.createElement(i,{onClick:()=>x&&b(d(x,1)),icon:c})))}}},y))}u.displayName="DateRangePicker";export{u as default}; diff --git a/dist/components/input-elements/Calendar/NavButton.cjs b/dist/components/input-elements/Calendar/NavButton.cjs new file mode 100644 index 000000000..3c3d16c3e --- /dev/null +++ b/dist/components/input-elements/Calendar/NavButton.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib");require("../../icon-elements/Badge/Badge.cjs"),require("../../icon-elements/BadgeDelta/BadgeDelta.cjs");var r=require("../../icon-elements/Icon/Icon.cjs"),t=require("../../../lib/tremorTwMerge.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(require("react"));exports.NavButton=o=>{var{onClick:a,icon:d}=o,c=e.__rest(o,["onClick","icon"]);const u=d;return n.default.createElement("button",Object.assign({type:"button",className:t.tremorTwMerge("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},c),n.default.createElement(r.default,{onClick:a,icon:u,variant:"simple",color:"slate",size:"sm"}))}; diff --git a/dist/components/input-elements/Calendar/NavButton.d.ts b/dist/components/input-elements/Calendar/NavButton.d.ts new file mode 100644 index 000000000..d9ac2cd5d --- /dev/null +++ b/dist/components/input-elements/Calendar/NavButton.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +interface NavButtonProps extends React.HTMLAttributes { + onClick: () => void; + icon: React.ElementType; +} +export declare const NavButton: ({ onClick, icon, ...other }: NavButtonProps) => React.JSX.Element; +export {}; diff --git a/dist/components/input-elements/Calendar/NavButton.js b/dist/components/input-elements/Calendar/NavButton.js new file mode 100644 index 000000000..4aa29f023 --- /dev/null +++ b/dist/components/input-elements/Calendar/NavButton.js @@ -0,0 +1 @@ +import{__rest as r}from"tslib";import"../../icon-elements/Badge/Badge.js";import"../../icon-elements/BadgeDelta/BadgeDelta.js";import e from"../../icon-elements/Icon/Icon.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import o from"react";const n=n=>{var{onClick:m,icon:a}=n,d=r(n,["onClick","icon"]);const c=a;return o.createElement("button",Object.assign({type:"button",className:t("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},d),o.createElement(e,{onClick:m,icon:c,variant:"simple",color:"slate",size:"sm"}))};export{n as NavButton}; diff --git a/dist/components/input-elements/Calendar/index.d.ts b/dist/components/input-elements/Calendar/index.d.ts new file mode 100644 index 000000000..eca04c49a --- /dev/null +++ b/dist/components/input-elements/Calendar/index.d.ts @@ -0,0 +1 @@ +export { default as Calendar } from "./Calendar"; diff --git a/dist/components/input-elements/DatePicker/DatePicker.cjs b/dist/components/input-elements/DatePicker/DatePicker.cjs new file mode 100644 index 000000000..750e7b1aa --- /dev/null +++ b/dist/components/input-elements/DatePicker/DatePicker.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("date-fns"),o=require("date-fns/locale"),n=require("@headlessui/react"),l=require("../../../assets/CalendarIcon.cjs"),d=require("../../../assets/XCircleIcon.cjs"),s=require("../Calendar/Calendar.cjs"),i=require("./datePickerUtils.cjs"),u=require("../../../hooks/useInternalState.cjs"),m=require("../DateRangePicker/dateRangePickerUtils.cjs"),c=require("../selectUtils.cjs");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=f(r);const k=a.startOfToday(),p=b.default.forwardRef(((f,p)=>{var g;const{value:w,defaultValue:v,onValueChange:h,minDate:y,maxDate:x,placeholder:N="Select date",disabled:q=!1,locale:D=o.enUS,enableClear:C=!0,displayFormat:T,className:j,enableYearNavigation:M=!1,weekStartsOn:E=0,disabledDates:P}=f,S=e.__rest(f,["value","defaultValue","onValueChange","minDate","maxDate","placeholder","disabled","locale","enableClear","displayFormat","className","enableYearNavigation","weekStartsOn","disabledDates"]),[O,V]=u(v,w),F=r.useMemo((()=>{const e=[];return y&&e.push({before:y}),x&&e.push({after:x}),[...e,...null!=P?P:[]]}),[y,x,P]),I=O?m.formatSelectedDates(O,void 0,D,T):N,U=a.startOfMonth(null!==(g=null!=O?O:x)&&void 0!==g?g:k),R=C&&!q;return b.default.createElement(n.Popover,Object.assign({ref:p,as:"div",className:t.tremorTwMerge("relative w-full min-w-[10rem] text-tremor-default","focus:ring-2 focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted",j)},S),b.default.createElement(n.Popover.Button,{disabled:q,className:t.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-tremor-default flex flex-nowrap border pl-3 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",R?"pr-8":"pr-4",c.getSelectButtonColors(c.hasValue(O),q))},b.default.createElement(l,{className:t.tremorTwMerge(i.makeDatePickerClassName("calendarIcon"),"flex-none shrink-0 h-5 w-5 mr-2 -ml-0.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),b.default.createElement("p",{className:"truncate"},I)),R&&O?b.default.createElement("button",{type:"button",className:t.tremorTwMerge("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==h||h(void 0),V(void 0)}},b.default.createElement(d,{className:t.tremorTwMerge("flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,b.default.createElement(n.Transition,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(n.Popover.Panel,{className:t.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},(({close:e})=>b.default.createElement(s,{showOutsideDays:!0,mode:"single",defaultMonth:U,selected:O,weekStartsOn:E,onSelect:r=>{null==h||h(r),V(r),e()},locale:D,disabled:F,enableYearNavigation:M})))))}));p.displayName="DatePicker",module.exports=p; diff --git a/dist/components/input-elements/DatePicker/DatePicker.d.ts b/dist/components/input-elements/DatePicker/DatePicker.d.ts new file mode 100644 index 000000000..f962a4834 --- /dev/null +++ b/dist/components/input-elements/DatePicker/DatePicker.d.ts @@ -0,0 +1,24 @@ +import React from "react"; +import { enUS } from "date-fns/locale"; +import { Color } from "../../../lib/inputTypes"; +export type Locale = typeof enUS; +export type DatePickerValue = Date | undefined; +export interface DatePickerProps extends Omit, "value" | "defaultValue"> { + value?: Date; + defaultValue?: Date; + onValueChange?: (value: DatePickerValue) => void; + minDate?: Date; + maxDate?: Date; + placeholder?: string; + disabled?: boolean; + color?: Color; + locale?: Locale; + enableClear?: boolean; + displayFormat?: string; + enableYearNavigation?: boolean; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + disabledDates?: Date[]; + children?: React.ReactElement[] | React.ReactElement; +} +declare const DatePicker: React.ForwardRefExoticComponent>; +export default DatePicker; diff --git a/dist/components/input-elements/DatePicker/DatePicker.js b/dist/components/input-elements/DatePicker/DatePicker.js new file mode 100644 index 000000000..6f5790ede --- /dev/null +++ b/dist/components/input-elements/DatePicker/DatePicker.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r,{useMemo as t}from"react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{startOfToday as o,startOfMonth as n}from"date-fns";import{enUS as l}from"date-fns/locale";import{Popover as d,Transition as s}from"@headlessui/react";import m from"../../../assets/CalendarIcon.js";import i from"../../../assets/XCircleIcon.js";import c from"../Calendar/Calendar.js";import{makeDatePickerClassName as u}from"./datePickerUtils.js";import b from"../../../hooks/useInternalState.js";import{formatSelectedDates as f}from"../DateRangePicker/dateRangePickerUtils.js";import{getSelectButtonColors as p,hasValue as k}from"../selectUtils.js";const h=o(),w=r.forwardRef(((o,w)=>{var g;const{value:v,defaultValue:y,onValueChange:x,minDate:N,maxDate:D,placeholder:j="Select date",disabled:C=!1,locale:E=l,enableClear:S=!0,displayFormat:O,className:P,enableYearNavigation:F=!1,weekStartsOn:I=0,disabledDates:V}=o,R=e(o,["value","defaultValue","onValueChange","minDate","maxDate","placeholder","disabled","locale","enableClear","displayFormat","className","enableYearNavigation","weekStartsOn","disabledDates"]),[T,U]=b(y,v),Y=t((()=>{const e=[];return N&&e.push({before:N}),D&&e.push({after:D}),[...e,...null!=V?V:[]]}),[N,D,V]),M=T?f(T,void 0,E,O):j,z=n(null!==(g=null!=T?T:D)&&void 0!==g?g:h),B=S&&!C;return r.createElement(d,Object.assign({ref:w,as:"div",className:a("relative w-full min-w-[10rem] text-tremor-default","focus:ring-2 focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted",P)},R),r.createElement(d.Button,{disabled:C,className:a("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-tremor-default flex flex-nowrap border pl-3 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",B?"pr-8":"pr-4",p(k(T),C))},r.createElement(m,{className:a(u("calendarIcon"),"flex-none shrink-0 h-5 w-5 mr-2 -ml-0.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),r.createElement("p",{className:"truncate"},M)),B&&T?r.createElement("button",{type:"button",className:a("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==x||x(void 0),U(void 0)}},r.createElement(i,{className:a("flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,r.createElement(s,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(d.Panel,{className:a("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},(({close:e})=>r.createElement(c,{showOutsideDays:!0,mode:"single",defaultMonth:z,selected:T,weekStartsOn:I,onSelect:r=>{null==x||x(r),U(r),e()},locale:E,disabled:Y,enableYearNavigation:F})))))}));w.displayName="DatePicker";export{w as default}; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.cjs b/dist/components/input-elements/DatePicker/datePickerUtils.cjs new file mode 100644 index 000000000..950e74985 --- /dev/null +++ b/dist/components/input-elements/DatePicker/datePickerUtils.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../lib/tremorTwMerge.cjs");const e=require("../../../lib/utils.cjs").makeClassName("DatePicker");exports.makeDatePickerClassName=e; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.d.ts b/dist/components/input-elements/DatePicker/datePickerUtils.d.ts new file mode 100644 index 000000000..af49b0c20 --- /dev/null +++ b/dist/components/input-elements/DatePicker/datePickerUtils.d.ts @@ -0,0 +1 @@ +export declare const makeDatePickerClassName: (className: string) => string; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.js b/dist/components/input-elements/DatePicker/datePickerUtils.js new file mode 100644 index 000000000..25992eb4e --- /dev/null +++ b/dist/components/input-elements/DatePicker/datePickerUtils.js @@ -0,0 +1 @@ +import"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";const t=r("DatePicker");export{t as makeDatePickerClassName}; diff --git a/dist/components/input-elements/DatePicker/index.d.ts b/dist/components/input-elements/DatePicker/index.d.ts new file mode 100644 index 000000000..87d6c1b35 --- /dev/null +++ b/dist/components/input-elements/DatePicker/index.d.ts @@ -0,0 +1,2 @@ +export { default as DatePicker } from "./DatePicker"; +export type { DatePickerProps, DatePickerValue } from "./DatePicker"; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs b/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs new file mode 100644 index 000000000..284ef64c5 --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("react"),a=require("../../../assets/CalendarIcon.cjs"),o=require("../../../assets/XCircleIcon.cjs"),l=require("date-fns"),n=require("../../../lib/tremorTwMerge.cjs"),d=require("../selectUtils.cjs"),s=require("./dateRangePickerUtils.cjs"),u=require("../Calendar/Calendar.cjs");require("../Select/Select.cjs");var m=require("../Select/SelectItem.cjs"),i=require("date-fns/locale"),c=require("../../../hooks/useInternalState.cjs");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=f(t);const k=l.startOfToday(),p=b.default.forwardRef(((f,p)=>{var g,v;const{value:w,defaultValue:h,onValueChange:x,enableSelect:y=!0,minDate:N,maxDate:E,placeholder:T="Select range",selectPlaceholder:M="Select range",disabled:S=!1,locale:C=i.enUS,enableClear:q=!0,displayFormat:D,children:j,className:O,enableYearNavigation:P=!1,weekStartsOn:V=0,disabledDates:F}=f,_=e.__rest(f,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[B,I]=c(h,w),[R,z]=t.useState(!1),[L,U]=t.useState(!1),Y=t.useMemo((()=>{const e=[];return N&&e.push({before:N}),E&&e.push({after:E}),[...e,...null!=F?F:[]]}),[N,E,F]),X=t.useMemo((()=>{const e=new Map;return j?b.default.Children.forEach(j,(r=>{var t;e.set(r.props.value,{text:null!==(t=d.getNodeText(r))&&void 0!==t?t:r.props.value,from:r.props.from,to:r.props.to})})):s.defaultOptions.forEach((r=>{e.set(r.value,{text:r.text,from:r.from,to:k})})),e}),[j]),A=t.useMemo((()=>{if(j)return d.constructValueToNameMapping(j);const e=new Map;return s.defaultOptions.forEach((r=>e.set(r.value,r.text))),e}),[j]),G=(null==B?void 0:B.selectValue)||"",H=s.parseStartDate(null==B?void 0:B.from,N,G,X),J=s.parseEndDate(null==B?void 0:B.to,E,G,X),K=H||J?s.formatSelectedDates(H,J,C,D):T,Q=l.startOfMonth(null!==(v=null!==(g=null!=J?J:H)&&void 0!==g?g:E)&&void 0!==v?v:k),W=q&&!S;return b.default.createElement("div",Object.assign({ref:p,className:n.tremorTwMerge("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",O)},_),b.default.createElement(r.Popover,{as:"div",className:n.tremorTwMerge("w-full",y?"rounded-l-tremor-default":"rounded-tremor-default",R&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},b.default.createElement("div",{className:"relative w-full"},b.default.createElement(r.Popover.Button,{onFocus:()=>z(!0),onBlur:()=>z(!1),disabled:S,className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",y?"rounded-l-tremor-default":"rounded-tremor-default",W?"pr-8":"pr-4",d.getSelectButtonColors(d.hasValue(H||J),S))},b.default.createElement(a,{className:n.tremorTwMerge(s.makeDateRangePickerClassName("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),b.default.createElement("p",{className:"truncate"},K)),W&&H?b.default.createElement("button",{type:"button",className:n.tremorTwMerge("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==x||x({}),I({})}},b.default.createElement(o,{className:n.tremorTwMerge(s.makeDateRangePickerClassName("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),b.default.createElement(r.Transition,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(r.Popover.Panel,{focus:!0,className:n.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b.default.createElement(u,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:Q,selected:{from:H,to:J},onSelect:e=>{null==x||x({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),I({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:C,disabled:Y,enableYearNavigation:P,classNames:{day_range_middle:n.tremorTwMerge("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:V},f))))),y&&b.default.createElement(r.Listbox,{as:"div",className:n.tremorTwMerge("w-48 -ml-px rounded-r-tremor-default",L&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:G,onChange:e=>{const{from:r,to:t}=X.get(e),a=null!=t?t:k;null==x||x({from:r,to:a,selectValue:e}),I({from:r,to:a,selectValue:e})},disabled:S},(({value:e})=>{var t;return b.default.createElement(b.default.Fragment,null,b.default.createElement(r.Listbox.Button,{onFocus:()=>U(!0),onBlur:()=>U(!1),className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",d.getSelectButtonColors(d.hasValue(e),S))},e&&null!==(t=A.get(e))&&void 0!==t?t:M),b.default.createElement(r.Transition,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(r.Listbox.Options,{className:n.tremorTwMerge("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=j?j:s.defaultOptions.map((e=>b.default.createElement(m,{key:e.value,value:e.value},e.text))))))})))}));p.displayName="DateRangePicker",module.exports=p; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts b/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts new file mode 100644 index 000000000..0b6f2819f --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts @@ -0,0 +1,30 @@ +import React from "react"; +import { enUS } from "date-fns/locale"; +import { Color } from "../../../lib/inputTypes"; +export type Locale = typeof enUS; +export type DateRangePickerValue = { + from?: Date; + to?: Date; + selectValue?: string; +}; +export interface DateRangePickerProps extends Omit, "value" | "defaultValue"> { + value?: DateRangePickerValue; + defaultValue?: DateRangePickerValue; + onValueChange?: (value: DateRangePickerValue) => void; + enableSelect?: boolean; + minDate?: Date; + maxDate?: Date; + placeholder?: string; + selectPlaceholder?: string; + disabled?: boolean; + color?: Color; + locale?: Locale; + enableClear?: boolean; + displayFormat?: string; + enableYearNavigation?: boolean; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + disabledDates?: Date[]; + children?: React.ReactElement[] | React.ReactElement; +} +declare const DateRangePicker: React.ForwardRefExoticComponent>; +export default DateRangePicker; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.js b/dist/components/input-elements/DateRangePicker/DateRangePicker.js new file mode 100644 index 000000000..564dd0904 --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePicker.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Popover as r,Transition as t,Listbox as a}from"@headlessui/react";import o,{useState as n,useMemo as l}from"react";import d from"../../../assets/CalendarIcon.js";import s from"../../../assets/XCircleIcon.js";import{startOfToday as m,startOfMonth as i}from"date-fns";import{tremorTwMerge as u}from"../../../lib/tremorTwMerge.js";import{getNodeText as c,constructValueToNameMapping as b,getSelectButtonColors as f,hasValue as p}from"../selectUtils.js";import{defaultOptions as k,parseStartDate as v,parseEndDate as g,formatSelectedDates as w,makeDateRangePickerClassName as h}from"./dateRangePickerUtils.js";import y from"../Calendar/Calendar.js";import"../Select/Select.js";import x from"../Select/SelectItem.js";import{enUS as N}from"date-fns/locale";import E from"../../../hooks/useInternalState.js";const S=m(),j=o.forwardRef(((m,j)=>{var C,D;const{value:F,defaultValue:O,onValueChange:V,enableSelect:I=!0,minDate:_,maxDate:P,placeholder:T="Select range",selectPlaceholder:z="Select range",disabled:B=!1,locale:M=N,enableClear:R=!0,displayFormat:Y,children:U,className:X,enableYearNavigation:q=!1,weekStartsOn:A=0,disabledDates:G}=m,H=e(m,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[J,K]=E(O,F),[L,Q]=n(!1),[W,Z]=n(!1),$=l((()=>{const e=[];return _&&e.push({before:_}),P&&e.push({after:P}),[...e,...null!=G?G:[]]}),[_,P,G]),ee=l((()=>{const e=new Map;return U?o.Children.forEach(U,(r=>{var t;e.set(r.props.value,{text:null!==(t=c(r))&&void 0!==t?t:r.props.value,from:r.props.from,to:r.props.to})})):k.forEach((r=>{e.set(r.value,{text:r.text,from:r.from,to:S})})),e}),[U]),re=l((()=>{if(U)return b(U);const e=new Map;return k.forEach((r=>e.set(r.value,r.text))),e}),[U]),te=(null==J?void 0:J.selectValue)||"",ae=v(null==J?void 0:J.from,_,te,ee),oe=g(null==J?void 0:J.to,P,te,ee),ne=ae||oe?w(ae,oe,M,Y):T,le=i(null!==(D=null!==(C=null!=oe?oe:ae)&&void 0!==C?C:P)&&void 0!==D?D:S),de=R&&!B;return o.createElement("div",Object.assign({ref:j,className:u("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",X)},H),o.createElement(r,{as:"div",className:u("w-full",I?"rounded-l-tremor-default":"rounded-tremor-default",L&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},o.createElement("div",{className:"relative w-full"},o.createElement(r.Button,{onFocus:()=>Q(!0),onBlur:()=>Q(!1),disabled:B,className:u("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"rounded-l-tremor-default":"rounded-tremor-default",de?"pr-8":"pr-4",f(p(ae||oe),B))},o.createElement(d,{className:u(h("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),o.createElement("p",{className:"truncate"},ne)),de&&ae?o.createElement("button",{type:"button",className:u("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==V||V({}),K({})}},o.createElement(s,{className:u(h("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),o.createElement(t,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(r.Panel,{focus:!0,className:u("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement(y,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:le,selected:{from:ae,to:oe},onSelect:e=>{null==V||V({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),K({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:M,disabled:$,enableYearNavigation:q,classNames:{day_range_middle:u("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:A},m))))),I&&o.createElement(a,{as:"div",className:u("w-48 -ml-px rounded-r-tremor-default",W&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:te,onChange:e=>{const{from:r,to:t}=ee.get(e),a=null!=t?t:S;null==V||V({from:r,to:a,selectValue:e}),K({from:r,to:a,selectValue:e})},disabled:B},(({value:e})=>{var r;return o.createElement(o.Fragment,null,o.createElement(a.Button,{onFocus:()=>Z(!0),onBlur:()=>Z(!1),className:u("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",f(p(e),B))},e&&null!==(r=re.get(e))&&void 0!==r?r:z),o.createElement(t,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(a.Options,{className:u("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=U?U:k.map((e=>o.createElement(x,{key:e.value,value:e.value},e.text))))))})))}));j.displayName="DateRangePicker";export{j as default}; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs new file mode 100644 index 000000000..f9873c945 --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react");require("../Select/Select.cjs");var r=require("../Select/SelectItem.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t);const c=l.default.forwardRef(((t,a)=>{const{value:c,className:s,children:u}=t,i=e.__rest(t,["value","className","children"]);return l.default.createElement(r,Object.assign({ref:a,className:s,value:c},i),null!=u?u:c)}));c.displayName="DateRangePickerItem",module.exports=c; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts new file mode 100644 index 000000000..43050a352 --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts @@ -0,0 +1,8 @@ +import React from "react"; +export interface DateRangePickerItemProps extends React.HTMLAttributes { + value: string; + from: Date; + to?: Date; +} +declare const DateRangePickerItem: React.ForwardRefExoticComponent>; +export default DateRangePickerItem; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js new file mode 100644 index 000000000..0972a02bc --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import"../Select/Select.js";import a from"../Select/SelectItem.js";const l=t.forwardRef(((l,r)=>{const{value:c,className:s,children:m}=l,o=e(l,["value","className","children"]);return t.createElement(a,Object.assign({ref:r,className:s,value:c},o),null!=m?m:c)}));l.displayName="DateRangePickerItem";export{l as default}; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs new file mode 100644 index 000000000..effd7c6ab --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("date-fns");require("../../../lib/tremorTwMerge.cjs");const e=require("../../../lib/utils.cjs").makeClassName("DateRangePicker"),r=[{value:"tdy",text:"Today",from:t.startOfToday()},{value:"w",text:"Last 7 days",from:t.sub(t.startOfToday(),{days:7})},{value:"t",text:"Last 30 days",from:t.sub(t.startOfToday(),{days:30})},{value:"m",text:"Month to Date",from:t.startOfMonth(t.startOfToday())},{value:"y",text:"Year to Date",from:t.startOfYear(t.startOfToday())}];exports.defaultOptions=r,exports.formatSelectedDates=(e,r,a,o)=>{const s=(null==a?void 0:a.code)||"en-US";if(!e&&!r)return"";if(e&&!r){if(o)return t.format(e,o);const r={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(s,r)}if(e&&r){if(t.isEqual(e,r)){if(o)return t.format(e,o);const r={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(s,r)}if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){if(o)return`${t.format(e,o)} - ${t.format(r,o)}`;const a={month:"short",day:"numeric"};return`${e.toLocaleDateString(s,a)} - \n ${r.getDate()}, ${r.getFullYear()}`}{if(o)return`${t.format(e,o)} - ${t.format(r,o)}`;const a={year:"numeric",month:"short",day:"numeric"};return`${e.toLocaleDateString(s,a)} - \n ${r.toLocaleDateString(s,a)}`}}return""},exports.makeDateRangePickerClassName=e,exports.parseEndDate=(e,r,a,o)=>{var s,n;if(a&&(e=t.startOfDay(null!==(n=null===(s=o.get(a))||void 0===s?void 0:s.to)&&void 0!==n?n:t.startOfToday())),e)return e&&!r?t.startOfDay(e):t.startOfDay(t.min([e,r]))},exports.parseStartDate=(e,r,a,o)=>{var s;if(a&&(e=null===(s=o.get(a))||void 0===s?void 0:s.from),e)return e&&!r?t.startOfDay(e):t.startOfDay(t.max([e,r]))}; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts new file mode 100644 index 000000000..4ad184103 --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts @@ -0,0 +1,12 @@ +export type DateRangePickerOption = { + value: string; + text: string; + from: Date; + to?: Date; +}; +export type DropdownValues = Map>; +export declare const makeDateRangePickerClassName: (className: string) => string; +export declare const parseStartDate: (startDate: Date | undefined, minDate: Date | undefined, selectedDropdownValue: string | undefined, selectValues: DropdownValues) => Date | undefined; +export declare const parseEndDate: (endDate: Date | undefined, maxDate: Date | undefined, selectedDropdownValue: string | undefined, selectValues: DropdownValues) => Date | undefined; +export declare const defaultOptions: DateRangePickerOption[]; +export declare const formatSelectedDates: (startDate: Date | undefined, endDate: Date | undefined, locale?: Locale, displayFormat?: string) => string; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js new file mode 100644 index 000000000..5ce9b52ec --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js @@ -0,0 +1 @@ +import{startOfToday as t,sub as e,startOfMonth as r,startOfYear as o,startOfDay as n,max as a,min as i,format as u,isEqual as l}from"date-fns";import"../../../lib/tremorTwMerge.js";import{makeClassName as m}from"../../../lib/utils.js";const c=m("DateRangePicker"),f=(t,e,r,o)=>{var i;if(r&&(t=null===(i=o.get(r))||void 0===i?void 0:i.from),t)return n(t&&!e?t:a([t,e]))},s=(e,r,o,a)=>{var u,l;if(o&&(e=n(null!==(l=null===(u=a.get(o))||void 0===u?void 0:u.to)&&void 0!==l?l:t())),e)return n(e&&!r?e:i([e,r]))},d=[{value:"tdy",text:"Today",from:t()},{value:"w",text:"Last 7 days",from:e(t(),{days:7})},{value:"t",text:"Last 30 days",from:e(t(),{days:30})},{value:"m",text:"Month to Date",from:r(t())},{value:"y",text:"Year to Date",from:o(t())}],g=(t,e,r,o)=>{const n=(null==r?void 0:r.code)||"en-US";if(!t&&!e)return"";if(t&&!e){if(o)return u(t,o);const e={year:"numeric",month:"short",day:"numeric"};return t.toLocaleDateString(n,e)}if(t&&e){if(l(t,e)){if(o)return u(t,o);const e={year:"numeric",month:"short",day:"numeric"};return t.toLocaleDateString(n,e)}if(t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()){if(o)return`${u(t,o)} - ${u(e,o)}`;const r={month:"short",day:"numeric"};return`${t.toLocaleDateString(n,r)} - \n ${e.getDate()}, ${e.getFullYear()}`}{if(o)return`${u(t,o)} - ${u(e,o)}`;const r={year:"numeric",month:"short",day:"numeric"};return`${t.toLocaleDateString(n,r)} - \n ${e.toLocaleDateString(n,r)}`}}return""};export{d as defaultOptions,g as formatSelectedDates,c as makeDateRangePickerClassName,s as parseEndDate,f as parseStartDate}; diff --git a/dist/components/input-elements/DateRangePicker/index.d.ts b/dist/components/input-elements/DateRangePicker/index.d.ts new file mode 100644 index 000000000..331559f4c --- /dev/null +++ b/dist/components/input-elements/DateRangePicker/index.d.ts @@ -0,0 +1,4 @@ +export { default as DateRangePicker } from "./DateRangePicker"; +export type { DateRangePickerProps, DateRangePickerValue } from "./DateRangePicker"; +export { default as DateRangePickerItem } from "./DateRangePickerItem"; +export type { DateRangePickerItemProps } from "./DateRangePickerItem"; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.cjs b/dist/components/input-elements/MultiSelect/MultiSelect.cjs new file mode 100644 index 000000000..c9e3fbec6 --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelect.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs");var r=require("../../../contexts/SelectedValueContext.cjs"),a=require("../../../hooks/useInternalState.cjs"),l=require("../../../assets/ArrowDownHeadIcon.cjs"),o=require("../../../assets/SearchIcon.cjs"),n=require("../../../assets/XCircleIcon.cjs"),s=require("@headlessui/react"),d=require("../../../assets/XIcon.cjs"),u=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs"),m=require("../selectUtils.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=i(t);const p=c.makeClassName("MultiSelect"),b=f.default.forwardRef(((c,i)=>{const{defaultValue:b=[],value:g,onValueChange:x,placeholder:h="Select...",placeholderSearch:k="Search",disabled:w=!1,icon:v,children:E,className:y,required:N,name:M,error:T=!1,errorMessage:C,id:q}=c,j=e.__rest(c,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),S=t.useRef(null),I=v,[V,D]=a(b,g),{reactElementChildren:F,optionsAvailable:A}=t.useMemo((()=>{const e=f.default.Children.toArray(E).filter(t.isValidElement);return{reactElementChildren:e,optionsAvailable:m.getFilteredOptions("",e)}}),[E]),[O,B]=t.useState(""),R=(null!=V?V:[]).length>0,L=t.useMemo((()=>O?m.getFilteredOptions(O,F):A),[O,F,A]),z=()=>{B("")};return f.default.createElement("div",{className:u.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},f.default.createElement("select",{title:"multi-select-hidden",required:N,className:u.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:V,onChange:e=>{e.preventDefault()},name:M,disabled:w,multiple:!0,id:q,onFocus:()=>{const e=S.current;e&&e.focus()}},f.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},h),L.map((e=>{const t=e.props.value,r=e.props.children;return f.default.createElement("option",{className:"hidden",key:t,value:t},r)}))),f.default.createElement(s.Listbox,Object.assign({as:"div",ref:i,defaultValue:V,value:V,onChange:e=>{null==x||x(e),D(e)},disabled:w,className:u.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",y),id:q,multiple:!0},j),(({value:e})=>f.default.createElement(f.default.Fragment,null,f.default.createElement(s.Listbox.Button,{className:u.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"pl-11 -ml-0.5":"pl-3",m.getSelectButtonColors(e.length>0,w,T)),ref:S},I&&f.default.createElement("span",{className:u.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},f.default.createElement(I,{className:u.tremorTwMerge(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),f.default.createElement("div",{className:"h-6 flex items-center"},e.length>0?f.default.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},A.filter((t=>e.includes(t.props.value))).map(((t,r)=>{var a;return f.default.createElement("div",{key:r,className:u.tremorTwMerge("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},f.default.createElement("div",{className:"text-xs truncate "},null!==(a=t.props.children)&&void 0!==a?a:t.props.value),f.default.createElement("div",{onClick:r=>{r.preventDefault();const a=e.filter((e=>e!==t.props.value));null==x||x(a),D(a)}},f.default.createElement(d,{className:u.tremorTwMerge(p("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))}))):f.default.createElement("span",null,h)),f.default.createElement("span",{className:u.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-2.5")},f.default.createElement(l,{className:u.tremorTwMerge(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),R&&!w?f.default.createElement("button",{type:"button",className:u.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),D([]),null==x||x([])}},f.default.createElement(n,{className:u.tremorTwMerge(p("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,f.default.createElement(s.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},f.default.createElement(s.Listbox.Options,{className:u.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},f.default.createElement("div",{className:u.tremorTwMerge("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},f.default.createElement("span",null,f.default.createElement(o,{className:u.tremorTwMerge("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),f.default.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:u.tremorTwMerge("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>B(e.target.value),value:O})),f.default.createElement(r.Provider,Object.assign({},{onBlur:{handleResetSearch:z}},{value:{selectedValue:e}}),L)))))),T&&C?f.default.createElement("p",{className:u.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},C):null)}));b.displayName="MultiSelect",module.exports=b; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.d.ts b/dist/components/input-elements/MultiSelect/MultiSelect.d.ts new file mode 100644 index 000000000..8c55b621e --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelect.d.ts @@ -0,0 +1,17 @@ +import React from "react"; +export interface MultiSelectProps extends React.HTMLAttributes { + defaultValue?: string[]; + name?: string; + value?: string[]; + onValueChange?: (value: string[]) => void; + placeholder?: string; + placeholderSearch?: string; + disabled?: boolean; + icon?: React.ElementType | React.JSXElementConstructor; + required?: boolean; + error?: boolean; + errorMessage?: string; + children: React.ReactNode; +} +declare const MultiSelect: React.ForwardRefExoticComponent>; +export default MultiSelect; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.js b/dist/components/input-elements/MultiSelect/MultiSelect.js new file mode 100644 index 000000000..0d80be447 --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelect.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useRef as r,useMemo as a,isValidElement as o,useState as l}from"react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import n from"../../../contexts/SelectedValueContext.js";import s from"../../../hooks/useInternalState.js";import m from"../../../assets/ArrowDownHeadIcon.js";import d from"../../../assets/SearchIcon.js";import c from"../../../assets/XCircleIcon.js";import{Listbox as u,Transition as i}from"@headlessui/react";import p from"../../../assets/XIcon.js";import{tremorTwMerge as f}from"../../../lib/tremorTwMerge.js";import{makeClassName as b}from"../../../lib/utils.js";import{getFilteredOptions as x,getSelectButtonColors as h}from"../selectUtils.js";const k=b("MultiSelect"),v=t.forwardRef(((b,v)=>{const{defaultValue:g=[],value:w,onValueChange:E,placeholder:y="Select...",placeholderSearch:N="Search",disabled:C=!1,icon:j,children:I,className:S,required:V,name:D,error:M=!1,errorMessage:A,id:F}=b,q=e(b,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),B=r(null),O=j,[R,T]=s(g,w),{reactElementChildren:z,optionsAvailable:P}=a((()=>{const e=t.Children.toArray(I).filter(o);return{reactElementChildren:e,optionsAvailable:x("",e)}}),[I]),[X,H]=l(""),K=(null!=R?R:[]).length>0,U=a((()=>X?x(X,z):P),[X,z,P]),G=()=>{H("")};return t.createElement("div",{className:f("w-full min-w-[10rem] relative text-tremor-default")},t.createElement("select",{title:"multi-select-hidden",required:V,className:f("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:R,onChange:e=>{e.preventDefault()},name:D,disabled:C,multiple:!0,id:F,onFocus:()=>{const e=B.current;e&&e.focus()}},t.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},y),U.map((e=>{const r=e.props.value,a=e.props.children;return t.createElement("option",{className:"hidden",key:r,value:r},a)}))),t.createElement(u,Object.assign({as:"div",ref:v,defaultValue:R,value:R,onChange:e=>{null==E||E(e),T(e)},disabled:C,className:f("w-full min-w-[10rem] relative text-tremor-default",S),id:F,multiple:!0},q),(({value:e})=>t.createElement(t.Fragment,null,t.createElement(u.Button,{className:f("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-11 -ml-0.5":"pl-3",h(e.length>0,C,M)),ref:B},O&&t.createElement("span",{className:f("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},t.createElement(O,{className:f(k("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),t.createElement("div",{className:"h-6 flex items-center"},e.length>0?t.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},P.filter((t=>e.includes(t.props.value))).map(((r,a)=>{var o;return t.createElement("div",{key:a,className:f("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},t.createElement("div",{className:"text-xs truncate "},null!==(o=r.props.children)&&void 0!==o?o:r.props.value),t.createElement("div",{onClick:t=>{t.preventDefault();const a=e.filter((e=>e!==r.props.value));null==E||E(a),T(a)}},t.createElement(p,{className:f(k("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))}))):t.createElement("span",null,y)),t.createElement("span",{className:f("absolute inset-y-0 right-0 flex items-center mr-2.5")},t.createElement(m,{className:f(k("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),K&&!C?t.createElement("button",{type:"button",className:f("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),T([]),null==E||E([])}},t.createElement(c,{className:f(k("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,t.createElement(i,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},t.createElement(u.Options,{className:f("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},t.createElement("div",{className:f("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},t.createElement("span",null,t.createElement(d,{className:f("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),t.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:N,className:f("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>H(e.target.value),value:X})),t.createElement(n.Provider,Object.assign({},{onBlur:{handleResetSearch:G}},{value:{selectedValue:e}}),U)))))),M&&A?t.createElement("p",{className:f("errorMessage","text-sm text-rose-500 mt-1")},A):null)}));v.displayName="MultiSelect";export{v as default}; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs b/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs new file mode 100644 index 000000000..e25275e24 --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs");var t=require("../../../contexts/SelectedValueContext.cjs"),r=require("react"),a=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs"),o=require("@headlessui/react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(r);const u=c.makeClassName("MultiSelectItem"),l=s.default.forwardRef(((n,l)=>{const{value:i,className:d,children:m}=n,x=e.__rest(n,["value","className","children"]),{selectedValue:k}=r.useContext(t),f=c.isValueInArray(i,k);return s.default.createElement(o.Listbox.Option,Object.assign({className:a.tremorTwMerge(u("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",d),ref:l,key:i,value:i},x),s.default.createElement("input",{type:"checkbox",className:a.tremorTwMerge(u("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:f,readOnly:!0}),s.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:i))}));l.displayName="MultiSelectItem",module.exports=l; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts b/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts new file mode 100644 index 000000000..ceb00a792 --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts @@ -0,0 +1,6 @@ +import React from "react"; +export interface MultiSelectItemProps extends React.HTMLAttributes { + value: string; +} +declare const MultiSelectItem: React.ForwardRefExoticComponent>; +export default MultiSelectItem; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.js b/dist/components/input-elements/MultiSelect/MultiSelectItem.js new file mode 100644 index 000000000..45716c88f --- /dev/null +++ b/dist/components/input-elements/MultiSelect/MultiSelectItem.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import t from"../../../contexts/SelectedValueContext.js";import r,{useContext as o}from"react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{isValueInArray as n,makeClassName as c}from"../../../lib/utils.js";import{Listbox as s}from"@headlessui/react";const m=c("MultiSelectItem"),i=r.forwardRef(((c,i)=>{const{value:l,className:d,children:u}=c,p=e(c,["value","className","children"]),{selectedValue:x}=o(t),k=n(l,x);return r.createElement(s.Option,Object.assign({className:a(m("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",d),ref:i,key:l,value:l},p),r.createElement("input",{type:"checkbox",className:a(m("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:k,readOnly:!0}),r.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:l))}));i.displayName="MultiSelectItem";export{i as default}; diff --git a/dist/components/input-elements/MultiSelect/index.d.ts b/dist/components/input-elements/MultiSelect/index.d.ts new file mode 100644 index 000000000..e4ea57b7f --- /dev/null +++ b/dist/components/input-elements/MultiSelect/index.d.ts @@ -0,0 +1,4 @@ +export { default as MultiSelect } from "./MultiSelect"; +export type { MultiSelectProps } from "./MultiSelect"; +export { default as MultiSelectItem } from "./MultiSelectItem"; +export type { MultiSelectItemProps } from "./MultiSelectItem"; diff --git a/dist/components/input-elements/NumberInput/NumberInput.cjs b/dist/components/input-elements/NumberInput/NumberInput.cjs new file mode 100644 index 000000000..d2f4367c7 --- /dev/null +++ b/dist/components/input-elements/NumberInput/NumberInput.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../assets/PlusIcon.cjs"),a=require("../../../assets/MinusIcon.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs"),u=require("../BaseInput.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(t);const d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",i=s.default.forwardRef(((o,i)=>{const{onSubmit:p,enableStepper:b=!0,disabled:m,onValueChange:f,onChange:v}=o,k=e.__rest(o,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),w=t.useRef(null),[g,y]=s.default.useState(!1),h=s.default.useCallback((()=>{y(!0)}),[]),x=s.default.useCallback((()=>{y(!1)}),[]),[C,D]=s.default.useState(!1),E=s.default.useCallback((()=>{D(!0)}),[]),N=s.default.useCallback((()=>{D(!1)}),[]);return s.default.createElement(u,Object.assign({type:"number",ref:l.mergeRefs([w,i]),disabled:m,makeInputClassName:l.makeClassName("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){const e=null===(t=w.current)||void 0===t?void 0:t.value;null==p||p(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&h(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&N()},onChange:e=>{m||(null==f||f(parseFloat(e.target.value)),null==v||v(e))},stepper:b?s.default.createElement("div",{className:n.tremorTwMerge("flex justify-center align-middle")},s.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=w.current)||void 0===e||e.stepDown(),null===(t=w.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:n.tremorTwMerge(!m&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.default.createElement(a,{"data-testid":"step-down",className:(g?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),s.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=w.current)||void 0===e||e.stepUp(),null===(t=w.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:n.tremorTwMerge(!m&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.default.createElement(r,{"data-testid":"step-up",className:(C?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},k))}));i.displayName="NumberInput",module.exports=i; diff --git a/dist/components/input-elements/NumberInput/NumberInput.d.ts b/dist/components/input-elements/NumberInput/NumberInput.d.ts new file mode 100644 index 000000000..1d21e2663 --- /dev/null +++ b/dist/components/input-elements/NumberInput/NumberInput.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +import { BaseInputProps } from "../BaseInput"; +export interface NumberInputProps extends Omit { + step?: string | number; + enableStepper?: boolean; + onSubmit?: (value: number) => void; + onValueChange?: (value: number) => void; +} +declare const NumberInput: React.ForwardRefExoticComponent>; +export default NumberInput; diff --git a/dist/components/input-elements/NumberInput/NumberInput.js b/dist/components/input-elements/NumberInput/NumberInput.js new file mode 100644 index 000000000..1ee9b1698 --- /dev/null +++ b/dist/components/input-elements/NumberInput/NumberInput.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useRef as r}from"react";import a from"../../../assets/PlusIcon.js";import n from"../../../assets/MinusIcon.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as s}from"../../../lib/utils.js";import u from"../BaseInput.js";const p="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",i=t.forwardRef(((i,d)=>{const{onSubmit:m,enableStepper:b=!0,disabled:v,onValueChange:f,onChange:k}=i,w=e(i,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),y=r(null),[h,x]=t.useState(!1),g=t.useCallback((()=>{x(!0)}),[]),C=t.useCallback((()=>{x(!1)}),[]),[D,E]=t.useState(!1),N=t.useCallback((()=>{E(!0)}),[]),I=t.useCallback((()=>{E(!1)}),[]);return t.createElement(u,Object.assign({type:"number",ref:l([y,d]),disabled:v,makeInputClassName:s("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){const e=null===(t=y.current)||void 0===t?void 0:t.value;null==m||m(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&g(),"ArrowUp"===e.key&&N()},onKeyUp:e=>{"ArrowDown"===e.key&&C(),"ArrowUp"===e.key&&I()},onChange:e=>{v||(null==f||f(parseFloat(e.target.value)),null==k||k(e))},stepper:b?t.createElement("div",{className:o("flex justify-center align-middle")},t.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;v||(null===(e=y.current)||void 0===e||e.stepDown(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:o(!v&&c,p,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},t.createElement(n,{"data-testid":"step-down",className:(h?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),t.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;v||(null===(e=y.current)||void 0===e||e.stepUp(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:o(!v&&c,p,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},t.createElement(a,{"data-testid":"step-up",className:(D?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},w))}));i.displayName="NumberInput";export{i as default}; diff --git a/dist/components/input-elements/NumberInput/index.d.ts b/dist/components/input-elements/NumberInput/index.d.ts new file mode 100644 index 000000000..cebb2e9a3 --- /dev/null +++ b/dist/components/input-elements/NumberInput/index.d.ts @@ -0,0 +1,2 @@ +export { default as NumberInput } from "./NumberInput"; +export type { NumberInputProps } from "./NumberInput"; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.cjs b/dist/components/input-elements/SearchSelect/SearchSelect.cjs new file mode 100644 index 000000000..5bcc89859 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelect.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../hooks/useInternalState.cjs"),a=require("@headlessui/react"),l=require("../../../assets/ArrowDownHeadIcon.cjs"),o=require("../../../assets/XCircleIcon.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),d=require("../../../lib/utils.cjs"),s=require("../selectUtils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(r);const m=d.makeClassName("SearchSelect"),i=d.makeClassName("SearchSelect"),f=c.default.forwardRef(((d,u)=>{const{defaultValue:f="",searchValue:b,onSearchValueChange:p,value:h,onValueChange:g,placeholder:w="Select...",disabled:k=!1,icon:x,enableClear:v=!0,name:N,required:y,error:C=!1,errorMessage:M,children:E,className:T,id:V}=d,q=e.__rest(d,["defaultValue","searchValue","onSearchValueChange","value","onValueChange","placeholder","disabled","icon","enableClear","name","required","error","errorMessage","children","className","id"]),S=r.useRef(null),[j,I]=t("",b),[F,D]=t(f,h),O=x,{reactElementChildren:z,valueToNameMapping:A}=r.useMemo((()=>{const e=c.default.Children.toArray(E).filter(r.isValidElement);return{reactElementChildren:e,valueToNameMapping:s.constructValueToNameMapping(e)}}),[E]),B=r.useMemo((()=>s.getFilteredOptions(null!=j?j:"",z)),[j,z]);return c.default.createElement("div",{className:n.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},c.default.createElement("select",{title:"search-select-hidden",required:y,className:n.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:F,onChange:e=>{e.preventDefault()},name:N,disabled:k,id:V,onFocus:()=>{const e=S.current;e&&e.click()}},c.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},w),B.map((e=>{const r=e.props.value,t=e.props.children;return c.default.createElement("option",{className:"hidden",key:r,value:r},t)}))),c.default.createElement(a.Combobox,Object.assign({as:"div",ref:u,defaultValue:F,value:F,onChange:e=>{null==g||g(e),D(e)},disabled:k,className:n.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",T),id:V},q),(({value:e})=>c.default.createElement(c.default.Fragment,null,c.default.createElement(a.Combobox.Button,{ref:S,className:"w-full"},O&&c.default.createElement("span",{className:n.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},c.default.createElement(O,{className:n.tremorTwMerge(m("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),c.default.createElement(a.Combobox.Input,{className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-10":"pl-3",k?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",s.getSelectButtonColors(s.hasValue(e),k)),placeholder:w,onChange:e=>{null==p||p(e.target.value),I(e.target.value)},displayValue:e=>{var r;return null!==(r=A.get(e))&&void 0!==r?r:""}}),c.default.createElement("div",{className:n.tremorTwMerge("absolute inset-y-0 right-0 flex items-center pr-2.5")},c.default.createElement(l,{className:n.tremorTwMerge(m("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&F?c.default.createElement("button",{type:"button",className:n.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),D(""),I(""),null==g||g(""),null==p||p("")}},c.default.createElement(o,{className:n.tremorTwMerge(i("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,B.length>0&&c.default.createElement(a.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},c.default.createElement(a.Combobox.Options,{className:n.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},B))))),C&&M?c.default.createElement("p",{className:n.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},M):null)}));f.displayName="SearchSelect",module.exports=f; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.d.ts b/dist/components/input-elements/SearchSelect/SearchSelect.d.ts new file mode 100644 index 000000000..bcbfa7681 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelect.d.ts @@ -0,0 +1,19 @@ +import React from "react"; +export interface SearchSelectProps extends React.HTMLAttributes { + defaultValue?: string; + name?: string; + searchValue?: string; + onSearchValueChange?: (value: string) => void; + value?: string; + onValueChange?: (value: string) => void; + placeholder?: string; + disabled?: boolean; + icon?: React.ElementType | React.JSXElementConstructor; + required?: boolean; + error?: boolean; + errorMessage?: string; + enableClear?: boolean; + children: React.ReactNode; +} +declare const SearchSelect: React.ForwardRefExoticComponent>; +export default SearchSelect; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.js b/dist/components/input-elements/SearchSelect/SearchSelect.js new file mode 100644 index 000000000..4c37ac6d4 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelect.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r,{useRef as t,useMemo as a,isValidElement as l}from"react";import o from"../../../hooks/useInternalState.js";import{Combobox as n,Transition as s}from"@headlessui/react";import d from"../../../assets/ArrowDownHeadIcon.js";import m from"../../../assets/XCircleIcon.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{makeClassName as u}from"../../../lib/utils.js";import{constructValueToNameMapping as i,getFilteredOptions as p,getSelectButtonColors as f,hasValue as b}from"../selectUtils.js";const h=u("SearchSelect"),k=u("SearchSelect"),g=r.forwardRef(((u,g)=>{const{defaultValue:v="",searchValue:x,onSearchValueChange:w,value:y,onValueChange:N,placeholder:E="Select...",disabled:C=!1,icon:S,enableClear:V=!0,name:j,required:I,error:M=!1,errorMessage:T,children:D,className:F,id:q}=u,z=e(u,["defaultValue","searchValue","onSearchValueChange","value","onValueChange","placeholder","disabled","icon","enableClear","name","required","error","errorMessage","children","className","id"]),A=t(null),[O,B]=o("",x),[H,R]=o(v,y),U=S,{reactElementChildren:X,valueToNameMapping:G}=a((()=>{const e=r.Children.toArray(D).filter(l);return{reactElementChildren:e,valueToNameMapping:i(e)}}),[D]),J=a((()=>p(null!=O?O:"",X)),[O,X]);return r.createElement("div",{className:c("w-full min-w-[10rem] relative text-tremor-default")},r.createElement("select",{title:"search-select-hidden",required:I,className:c("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:H,onChange:e=>{e.preventDefault()},name:j,disabled:C,id:q,onFocus:()=>{const e=A.current;e&&e.click()}},r.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},E),J.map((e=>{const t=e.props.value,a=e.props.children;return r.createElement("option",{className:"hidden",key:t,value:t},a)}))),r.createElement(n,Object.assign({as:"div",ref:g,defaultValue:H,value:H,onChange:e=>{null==N||N(e),R(e)},disabled:C,className:c("w-full min-w-[10rem] relative text-tremor-default",F),id:q},z),(({value:e})=>r.createElement(r.Fragment,null,r.createElement(n.Button,{ref:A,className:"w-full"},U&&r.createElement("span",{className:c("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},r.createElement(U,{className:c(h("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),r.createElement(n.Input,{className:c("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",U?"pl-10":"pl-3",C?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",f(b(e),C)),placeholder:E,onChange:e=>{null==w||w(e.target.value),B(e.target.value)},displayValue:e=>{var r;return null!==(r=G.get(e))&&void 0!==r?r:""}}),r.createElement("div",{className:c("absolute inset-y-0 right-0 flex items-center pr-2.5")},r.createElement(d,{className:c(h("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),V&&H?r.createElement("button",{type:"button",className:c("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),R(""),B(""),null==N||N(""),null==w||w("")}},r.createElement(m,{className:c(k("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,J.length>0&&r.createElement(s,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(n.Options,{className:c("divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},J))))),M&&T?r.createElement("p",{className:c("errorMessage","text-sm text-rose-500 mt-1")},T):null)}));g.displayName="SearchSelect";export{g as default}; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs b/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs new file mode 100644 index 000000000..8694cc7d1 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),o=require("@headlessui/react");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=c(t);const s=a.makeClassName("SearchSelectItem"),u=n.default.forwardRef(((t,a)=>{const{value:c,icon:u,className:l,children:m}=t,d=e.__rest(t,["value","icon","className","children"]),i=u;return n.default.createElement(o.Combobox.Option,Object.assign({className:r.tremorTwMerge(s("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",l),ref:a,key:c,value:c},d),i&&n.default.createElement(i,{className:r.tremorTwMerge(s("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),n.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:c))}));u.displayName="SearchSelectItem",module.exports=u; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts b/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts new file mode 100644 index 000000000..ef47d6970 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +export interface SearchSelectItemProps extends React.HTMLAttributes { + value: string; + icon?: React.ElementType; +} +declare const SearchSelectItem: React.ForwardRefExoticComponent>; +export default SearchSelectItem; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.js b/dist/components/input-elements/SearchSelect/SearchSelectItem.js new file mode 100644 index 000000000..452777a9d --- /dev/null +++ b/dist/components/input-elements/SearchSelect/SearchSelectItem.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import{Combobox as o}from"@headlessui/react";const c=a("SearchSelectItem"),n=t.forwardRef(((a,n)=>{const{value:m,icon:s,className:i,children:l}=a,d=e(a,["value","icon","className","children"]),u=s;return t.createElement(o.Option,Object.assign({className:r(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",i),ref:n,key:m,value:m},d),u&&t.createElement(u,{className:r(c("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),t.createElement("span",{className:"whitespace-nowrap truncate"},null!=l?l:m))}));n.displayName="SearchSelectItem";export{n as default}; diff --git a/dist/components/input-elements/SearchSelect/index.d.ts b/dist/components/input-elements/SearchSelect/index.d.ts new file mode 100644 index 000000000..60336d9b0 --- /dev/null +++ b/dist/components/input-elements/SearchSelect/index.d.ts @@ -0,0 +1,4 @@ +export { default as SearchSelect } from "./SearchSelect"; +export type { SearchSelectProps } from "./SearchSelect"; +export { default as SearchSelectItem } from "./SearchSelectItem"; +export type { SearchSelectItemProps } from "./SearchSelectItem"; diff --git a/dist/components/input-elements/Select/Select.cjs b/dist/components/input-elements/Select/Select.cjs new file mode 100644 index 000000000..819284923 --- /dev/null +++ b/dist/components/input-elements/Select/Select.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../assets/ArrowDownHeadIcon.cjs"),a=require("../../../assets/XCircleIcon.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),n=require("../selectUtils.cjs"),s=require("@headlessui/react"),d=require("../../../hooks/useInternalState.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(r);const c=o.makeClassName("Select"),i=m.default.forwardRef(((o,u)=>{const{defaultValue:i="",value:f,onValueChange:b,placeholder:p="Select...",disabled:w=!1,icon:g,enableClear:h=!1,required:k,children:v,name:x,error:y=!1,errorMessage:N,className:E,id:M}=o,T=e.__rest(o,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),q=r.useRef(null),C=r.Children.toArray(v),[j,V]=d(i,f),I=g,S=r.useMemo((()=>{const e=m.default.Children.toArray(v).filter(r.isValidElement);return n.constructValueToNameMapping(e)}),[v]);return m.default.createElement("div",{className:l.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},m.default.createElement("select",{title:"select-hidden",required:k,className:l.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:j,onChange:e=>{e.preventDefault()},name:x,disabled:w,id:M,onFocus:()=>{const e=q.current;e&&e.focus()}},m.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),C.map((e=>{const r=e.props.value,t=e.props.children;return m.default.createElement("option",{className:"hidden",key:r,value:r},t)}))),m.default.createElement(s.Listbox,Object.assign({as:"div",ref:u,defaultValue:j,value:j,onChange:e=>{null==b||b(e),V(e)},disabled:w,className:l.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",E),id:M},T),(({value:e})=>{var r;return m.default.createElement(m.default.Fragment,null,m.default.createElement(s.Listbox.Button,{ref:q,className:l.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"pl-10":"pl-3",n.getSelectButtonColors(n.hasValue(e),w,y))},I&&m.default.createElement("span",{className:l.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},m.default.createElement(I,{className:l.tremorTwMerge(c("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),m.default.createElement("span",{className:"w-[90%] block truncate"},e&&null!==(r=S.get(e))&&void 0!==r?r:p),m.default.createElement("span",{className:l.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-3")},m.default.createElement(t,{className:l.tremorTwMerge(c("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),h&&j?m.default.createElement("button",{type:"button",className:l.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),V(""),null==b||b("")}},m.default.createElement(a,{className:l.tremorTwMerge(c("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,m.default.createElement(s.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},m.default.createElement(s.Listbox.Options,{className:l.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},v)))})),y&&N?m.default.createElement("p",{className:l.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},N):null)}));i.displayName="Select",module.exports=i; diff --git a/dist/components/input-elements/Select/Select.d.ts b/dist/components/input-elements/Select/Select.d.ts new file mode 100644 index 000000000..e35fea476 --- /dev/null +++ b/dist/components/input-elements/Select/Select.d.ts @@ -0,0 +1,17 @@ +import React from "react"; +export interface SelectProps extends React.HTMLAttributes { + value?: string; + name?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + placeholder?: string; + disabled?: boolean; + icon?: React.JSXElementConstructor; + enableClear?: boolean; + required?: boolean; + error?: boolean; + errorMessage?: string; + children: React.ReactNode; +} +declare const Select: React.ForwardRefExoticComponent>; +export default Select; diff --git a/dist/components/input-elements/Select/Select.js b/dist/components/input-elements/Select/Select.js new file mode 100644 index 000000000..9f79afe83 --- /dev/null +++ b/dist/components/input-elements/Select/Select.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r,{useRef as t,Children as a,useMemo as o,isValidElement as l}from"react";import n from"../../../assets/ArrowDownHeadIcon.js";import s from"../../../assets/XCircleIcon.js";import{tremorTwMerge as d}from"../../../lib/tremorTwMerge.js";import{makeClassName as m}from"../../../lib/utils.js";import{constructValueToNameMapping as c,getSelectButtonColors as i,hasValue as u}from"../selectUtils.js";import{Listbox as b,Transition as f}from"@headlessui/react";import p from"../../../hooks/useInternalState.js";const h=m("Select"),k=r.forwardRef(((m,k)=>{const{defaultValue:w="",value:v,onValueChange:x,placeholder:y="Select...",disabled:g=!1,icon:N,enableClear:E=!1,required:C,children:j,name:I,error:V=!1,errorMessage:D,className:F,id:M}=m,S=e(m,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),q=t(null),A=a.toArray(j),[T,z]=p(w,v),O=N,B=o((()=>{const e=r.Children.toArray(j).filter(l);return c(e)}),[j]);return r.createElement("div",{className:d("w-full min-w-[10rem] relative text-tremor-default")},r.createElement("select",{title:"select-hidden",required:C,className:d("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:T,onChange:e=>{e.preventDefault()},name:I,disabled:g,id:M,onFocus:()=>{const e=q.current;e&&e.focus()}},r.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},y),A.map((e=>{const t=e.props.value,a=e.props.children;return r.createElement("option",{className:"hidden",key:t,value:t},a)}))),r.createElement(b,Object.assign({as:"div",ref:k,defaultValue:T,value:T,onChange:e=>{null==x||x(e),z(e)},disabled:g,className:d("w-full min-w-[10rem] relative text-tremor-default",F),id:M},S),(({value:e})=>{var t;return r.createElement(r.Fragment,null,r.createElement(b.Button,{ref:q,className:d("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-10":"pl-3",i(u(e),g,V))},O&&r.createElement("span",{className:d("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},r.createElement(O,{className:d(h("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),r.createElement("span",{className:"w-[90%] block truncate"},e&&null!==(t=B.get(e))&&void 0!==t?t:y),r.createElement("span",{className:d("absolute inset-y-0 right-0 flex items-center mr-3")},r.createElement(n,{className:d(h("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),E&&T?r.createElement("button",{type:"button",className:d("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),z(""),null==x||x("")}},r.createElement(s,{className:d(h("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,r.createElement(f,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(b.Options,{className:d("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},j)))})),V&&D?r.createElement("p",{className:d("errorMessage","text-sm text-rose-500 mt-1")},D):null)}));k.displayName="Select";export{k as default}; diff --git a/dist/components/input-elements/Select/SelectItem.cjs b/dist/components/input-elements/Select/SelectItem.cjs new file mode 100644 index 000000000..1011e2cf3 --- /dev/null +++ b/dist/components/input-elements/Select/SelectItem.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=c(t);const s=o.makeClassName("SelectItem"),u=n.default.forwardRef(((t,o)=>{const{value:c,icon:u,className:l,children:i}=t,d=e.__rest(t,["value","icon","className","children"]),m=u;return n.default.createElement(r.Listbox.Option,Object.assign({className:a.tremorTwMerge(s("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",l),ref:o,key:c,value:c},d),m&&n.default.createElement(m,{className:a.tremorTwMerge(s("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),n.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=i?i:c))}));u.displayName="SelectItem",module.exports=u; diff --git a/dist/components/input-elements/Select/SelectItem.d.ts b/dist/components/input-elements/Select/SelectItem.d.ts new file mode 100644 index 000000000..d08cf36fd --- /dev/null +++ b/dist/components/input-elements/Select/SelectItem.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +export interface SelectItemProps extends React.HTMLAttributes { + value: string; + icon?: React.ElementType; +} +declare const SelectItem: React.ForwardRefExoticComponent>; +export default SelectItem; diff --git a/dist/components/input-elements/Select/SelectItem.js b/dist/components/input-elements/Select/SelectItem.js new file mode 100644 index 000000000..3d79093fa --- /dev/null +++ b/dist/components/input-elements/Select/SelectItem.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import{Listbox as r}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const c=o("SelectItem"),n=t.forwardRef(((o,n)=>{const{value:m,icon:s,className:i,children:l}=o,d=e(o,["value","icon","className","children"]),u=s;return t.createElement(r.Option,Object.assign({className:a(c("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",i),ref:n,key:m,value:m},d),u&&t.createElement(u,{className:a(c("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),t.createElement("span",{className:"whitespace-nowrap truncate"},null!=l?l:m))}));n.displayName="SelectItem";export{n as default}; diff --git a/dist/components/input-elements/Select/index.d.ts b/dist/components/input-elements/Select/index.d.ts new file mode 100644 index 000000000..8c0e47459 --- /dev/null +++ b/dist/components/input-elements/Select/index.d.ts @@ -0,0 +1,4 @@ +export { default as Select } from "./Select"; +export type { SelectProps } from "./Select"; +export { default as SelectItem } from "./SelectItem"; +export type { SelectItemProps } from "./SelectItem"; diff --git a/dist/components/input-elements/Switch/Switch.cjs b/dist/components/input-elements/Switch/Switch.cjs new file mode 100644 index 000000000..b9efe855d --- /dev/null +++ b/dist/components/input-elements/Switch/Switch.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("../../../hooks/useInternalState.cjs"),o=require("react"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs"),s=require("../../util-elements/Tooltip/Tooltip.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=d(o);const u=n.makeClassName("Switch"),c=i.default.forwardRef(((d,c)=>{const{checked:m,defaultChecked:g=!1,onChange:b,color:f,name:k,error:h,errorMessage:p,disabled:w,required:C,tooltip:x,id:M}=d,T=e.__rest(d,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),N=(e=>({bgColor:e?n.getColorClassNames(e,a.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:e?n.getColorClassNames(e,a.colorPalette.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}))(f),[q,j]=t(g,m),[v,E]=o.useState(!1),{tooltipProps:y,getReferenceProps:S}=s.useTooltip(300);return i.default.createElement("div",{className:"flex flex-row items-center justify-start"},i.default.createElement(s.default,Object.assign({text:x},y)),i.default.createElement("div",Object.assign({ref:n.mergeRefs([c,y.refs.setReference]),className:l.tremorTwMerge(u("root"),"flex flex-row relative h-5")},T,S),i.default.createElement("input",{type:"checkbox",className:l.tremorTwMerge(u("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:k,required:C,checked:q,onChange:e=>{e.preventDefault()}}),i.default.createElement(r.Switch,{checked:q,onChange:e=>{j(e),null==b||b(e)},disabled:w,className:l.tremorTwMerge(u("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",w?"cursor-not-allowed":""),onFocus:()=>E(!0),onBlur:()=>E(!1),id:M},i.default.createElement("span",{className:l.tremorTwMerge(u("sr-only"),"sr-only")},"Switch ",q?"on":"off"),i.default.createElement("span",{"aria-hidden":"true",className:l.tremorTwMerge(u("background"),q?N.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),i.default.createElement("span",{"aria-hidden":"true",className:l.tremorTwMerge(u("round"),q?l.tremorTwMerge(N.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",v?l.tremorTwMerge("ring-2",N.ringColor):"")}))),h&&p?i.default.createElement("p",{className:l.tremorTwMerge(u("errorMessage"),"text-sm text-red-500 mt-1 ")},p):null)}));c.displayName="Switch",module.exports=c; diff --git a/dist/components/input-elements/Switch/Switch.d.ts b/dist/components/input-elements/Switch/Switch.d.ts new file mode 100644 index 000000000..9e1580ebc --- /dev/null +++ b/dist/components/input-elements/Switch/Switch.d.ts @@ -0,0 +1,17 @@ +import { Color } from "lib"; +import React from "react"; +export interface SwitchProps extends Omit, "onChange"> { + checked?: boolean; + defaultChecked?: boolean; + onChange?: (value: boolean) => void; + color?: Color; + name?: string; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + required?: boolean; + id?: string; + tooltip?: string; +} +declare const Switch: React.ForwardRefExoticComponent>; +export default Switch; diff --git a/dist/components/input-elements/Switch/Switch.js b/dist/components/input-elements/Switch/Switch.js new file mode 100644 index 000000000..a18cb720d --- /dev/null +++ b/dist/components/input-elements/Switch/Switch.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Switch as r}from"@headlessui/react";import o from"../../../hooks/useInternalState.js";import t,{useState as a}from"react";import{colorPalette as n}from"../../../lib/theme.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,getColorClassNames as i,makeClassName as d}from"../../../lib/utils.js";import m,{useTooltip as c}from"../../util-elements/Tooltip/Tooltip.js";const u=d("Switch"),b=t.forwardRef(((d,b)=>{const{checked:g,defaultChecked:f=!1,onChange:p,color:h,name:k,error:w,errorMessage:x,disabled:C,required:j,tooltip:E,id:N}=d,v=e(d,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),y=(e=>({bgColor:e?i(e,n.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:e?i(e,n.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}))(h),[S,M]=o(f,g),[q,R]=a(!1),{tooltipProps:T,getReferenceProps:O}=c(300);return t.createElement("div",{className:"flex flex-row items-center justify-start"},t.createElement(m,Object.assign({text:E},T)),t.createElement("div",Object.assign({ref:s([b,T.refs.setReference]),className:l(u("root"),"flex flex-row relative h-5")},v,O),t.createElement("input",{type:"checkbox",className:l(u("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:k,required:j,checked:S,onChange:e=>{e.preventDefault()}}),t.createElement(r,{checked:S,onChange:e=>{M(e),null==p||p(e)},disabled:C,className:l(u("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",C?"cursor-not-allowed":""),onFocus:()=>R(!0),onBlur:()=>R(!1),id:N},t.createElement("span",{className:l(u("sr-only"),"sr-only")},"Switch ",S?"on":"off"),t.createElement("span",{"aria-hidden":"true",className:l(u("background"),S?y.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),t.createElement("span",{"aria-hidden":"true",className:l(u("round"),S?l(y.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",q?l("ring-2",y.ringColor):"")}))),w&&x?t.createElement("p",{className:l(u("errorMessage"),"text-sm text-red-500 mt-1 ")},x):null)}));b.displayName="Switch";export{b as default}; diff --git a/dist/components/input-elements/Switch/index.d.ts b/dist/components/input-elements/Switch/index.d.ts new file mode 100644 index 000000000..eaf14f132 --- /dev/null +++ b/dist/components/input-elements/Switch/index.d.ts @@ -0,0 +1,2 @@ +export { default as Switch } from "./Switch"; +export type { SwitchProps } from "./Switch"; diff --git a/dist/components/input-elements/Tabs/Tab.cjs b/dist/components/input-elements/Tabs/Tab.cjs new file mode 100644 index 000000000..a8e1600b8 --- /dev/null +++ b/dist/components/input-elements/Tabs/Tab.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("../../../lib/theme.cjs"),o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),s=require("react"),n=require("./TabList.cjs"),d=require("../../../contexts/BaseColorContext.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs"),require("../../../contexts/SelectedValueContext.cjs");var l=c(s);const i=a.makeClassName("Tab");function u(e,r){switch(e){case"line":return o.tremorTwMerge("ui-selected:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","dark:hover:border-dark-tremor-content-emphasis dark:hover:text-dark-tremor-content-emphasis dark:text-dark-tremor-content",r?a.getColorClassNames(r,t.colorPalette.border).selectBorderColor:"ui-selected:border-tremor-brand dark:ui-selected:border-dark-tremor-brand");case"solid":return o.tremorTwMerge("border-transparent border rounded-tremor-small px-2.5 py-1","ui-selected:border-tremor-border ui-selected:bg-tremor-background ui-selected:shadow-tremor-input hover:text-tremor-content-emphasis ui-selected:text-tremor-brand","dark:ui-selected:border-dark-tremor-border dark:ui-selected:bg-dark-tremor-background dark:ui-selected:shadow-dark-tremor-input dark:hover:text-dark-tremor-content-emphasis dark:ui-selected:text-dark-tremor-brand",r?a.getColorClassNames(r,t.colorPalette.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}const m=l.default.forwardRef(((c,m)=>{const{icon:x,className:b,children:k}=c,h=e.__rest(c,["icon","className","children"]),p=s.useContext(n.TabVariantContext),C=s.useContext(d),f=x;return l.default.createElement(r.Tab,Object.assign({ref:m,className:o.tremorTwMerge(i("root"),"flex whitespace-nowrap truncate max-w-xs outline-none focus:ring-0 text-tremor-default transition duration-100",C?a.getColorClassNames(C,t.colorPalette.text).selectTextColor:"solid"===p?"ui-selected:text-tremor-content-emphasis dark:ui-selected:text-dark-tremor-content-emphasis":"ui-selected:text-tremor-brand dark:ui-selected:text-dark-tremor-brand",u(p,C),b)},h),f?l.default.createElement(f,{className:o.tremorTwMerge(i("icon"),"flex-none h-5 w-5",k?"mr-2":"")}):null,k?l.default.createElement("span",null,k):null)}));m.displayName="Tab",module.exports=m; diff --git a/dist/components/input-elements/Tabs/Tab.d.ts b/dist/components/input-elements/Tabs/Tab.d.ts new file mode 100644 index 000000000..ff2555c84 --- /dev/null +++ b/dist/components/input-elements/Tabs/Tab.d.ts @@ -0,0 +1,6 @@ +import React from "react"; +export interface TabProps extends React.ButtonHTMLAttributes { + icon?: React.ElementType; +} +declare const Tab: React.ForwardRefExoticComponent>; +export default Tab; diff --git a/dist/components/input-elements/Tabs/Tab.js b/dist/components/input-elements/Tabs/Tab.js new file mode 100644 index 000000000..bab4fe9b6 --- /dev/null +++ b/dist/components/input-elements/Tabs/Tab.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Tab as r}from"@headlessui/react";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as n}from"../../../lib/utils.js";import s,{useContext as d}from"react";import{TabVariantContext as m}from"./TabList.js";import i from"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";const c=n("Tab");function l(e,r){switch(e){case"line":return o("ui-selected:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","dark:hover:border-dark-tremor-content-emphasis dark:hover:text-dark-tremor-content-emphasis dark:text-dark-tremor-content",r?a(r,t.border).selectBorderColor:"ui-selected:border-tremor-brand dark:ui-selected:border-dark-tremor-brand");case"solid":return o("border-transparent border rounded-tremor-small px-2.5 py-1","ui-selected:border-tremor-border ui-selected:bg-tremor-background ui-selected:shadow-tremor-input hover:text-tremor-content-emphasis ui-selected:text-tremor-brand","dark:ui-selected:border-dark-tremor-border dark:ui-selected:bg-dark-tremor-background dark:ui-selected:shadow-dark-tremor-input dark:hover:text-dark-tremor-content-emphasis dark:ui-selected:text-dark-tremor-brand",r?a(r,t.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}const u=s.forwardRef(((n,u)=>{const{icon:b,className:x,children:p}=n,k=e(n,["icon","className","children"]),h=d(m),f=d(i),j=b;return s.createElement(r,Object.assign({ref:u,className:o(c("root"),"flex whitespace-nowrap truncate max-w-xs outline-none focus:ring-0 text-tremor-default transition duration-100",f?a(f,t.text).selectTextColor:"solid"===h?"ui-selected:text-tremor-content-emphasis dark:ui-selected:text-dark-tremor-content-emphasis":"ui-selected:text-tremor-brand dark:ui-selected:text-dark-tremor-brand",l(h,f),x)},k),j?s.createElement(j,{className:o(c("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)}));u.displayName="Tab";export{u as default}; diff --git a/dist/components/input-elements/Tabs/TabGroup.cjs b/dist/components/input-elements/Tabs/TabGroup.cjs new file mode 100644 index 000000000..62db30244 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabGroup.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(require("react"));const l=t.makeClassName("TabGroup"),d=s.default.forwardRef(((t,n)=>{const{defaultIndex:d,index:u,onIndexChange:i,children:o,className:c}=t,f=e.__rest(t,["defaultIndex","index","onIndexChange","children","className"]);return s.default.createElement(r.Tab.Group,Object.assign({as:"div",ref:n,defaultIndex:d,selectedIndex:u,onChange:i,className:a.tremorTwMerge(l("root"),"w-full",c)},f),o)}));d.displayName="TabGroup",module.exports=d; diff --git a/dist/components/input-elements/Tabs/TabGroup.d.ts b/dist/components/input-elements/Tabs/TabGroup.d.ts new file mode 100644 index 000000000..286b73bd5 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabGroup.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface TabGroupProps extends React.HTMLAttributes { + defaultIndex?: number; + index?: number; + onIndexChange?: (index: number) => void; + children: React.ReactElement[] | React.ReactElement; +} +declare const TabGroup: React.ForwardRefExoticComponent>; +export default TabGroup; diff --git a/dist/components/input-elements/Tabs/TabGroup.js b/dist/components/input-elements/Tabs/TabGroup.js new file mode 100644 index 000000000..f133bed5e --- /dev/null +++ b/dist/components/input-elements/Tabs/TabGroup.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Tab as r}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";import t from"react";const n=o("TabGroup"),s=t.forwardRef(((o,s)=>{const{defaultIndex:d,index:l,onIndexChange:i,children:m,className:f}=o,c=e(o,["defaultIndex","index","onIndexChange","children","className"]);return t.createElement(r.Group,Object.assign({as:"div",ref:s,defaultIndex:d,selectedIndex:l,onChange:i,className:a(n("root"),"w-full",f)},c),m)}));s.displayName="TabGroup";export{s as default}; diff --git a/dist/components/input-elements/Tabs/TabList.cjs b/dist/components/input-elements/Tabs/TabList.cjs new file mode 100644 index 000000000..f0663887e --- /dev/null +++ b/dist/components/input-elements/Tabs/TabList.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react"),t=require("../../../contexts/BaseColorContext.cjs");require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs"),require("../../../contexts/SelectedValueContext.cjs");var a=require("@headlessui/react"),o=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(r);const c=s.makeClassName("TabList"),n=r.createContext("line"),u={line:o.tremorTwMerge("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:o.tremorTwMerge("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=i.default.forwardRef(((r,s)=>{const{color:l,variant:d="line",children:b,className:x}=r,f=e.__rest(r,["color","variant","children","className"]);return i.default.createElement(a.Tab.List,Object.assign({ref:s,className:o.tremorTwMerge(c("root"),"justify-start overflow-x-clip",u[d],x)},f),i.default.createElement(n.Provider,{value:d},i.default.createElement(t.Provider,{value:l},b)))}));d.displayName="TabList",exports.TabVariantContext=n,exports.default=d; diff --git a/dist/components/input-elements/Tabs/TabList.d.ts b/dist/components/input-elements/Tabs/TabList.d.ts new file mode 100644 index 000000000..5c8d22bba --- /dev/null +++ b/dist/components/input-elements/Tabs/TabList.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +import { Color } from "lib"; +export type TabVariant = "line" | "solid"; +export declare const TabVariantContext: React.Context; +export interface TabListProps extends React.HTMLAttributes { + color?: Color; + variant?: TabVariant; + children: React.ReactElement[] | React.ReactElement; +} +declare const TabList: React.ForwardRefExoticComponent>; +export default TabList; diff --git a/dist/components/input-elements/Tabs/TabList.js b/dist/components/input-elements/Tabs/TabList.js new file mode 100644 index 000000000..991b3b037 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabList.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r,{createContext as t}from"react";import o from"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{Tab as a}from"@headlessui/react";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const i=l("TabList"),m=t("line"),n={line:s("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:s("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},c=r.forwardRef(((t,l)=>{const{color:c,variant:d="line",children:b,className:f}=t,p=e(t,["color","variant","children","className"]);return r.createElement(a.List,Object.assign({ref:l,className:s(i("root"),"justify-start overflow-x-clip",n[d],f)},p),r.createElement(m.Provider,{value:d},r.createElement(o.Provider,{value:c},b)))}));c.displayName="TabList";export{m as TabVariantContext,c as default}; diff --git a/dist/components/input-elements/Tabs/TabPanel.cjs b/dist/components/input-elements/Tabs/TabPanel.cjs new file mode 100644 index 000000000..0f99153ea --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanel.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib");require("../../../contexts/BaseColorContext.cjs");var t=require("../../../contexts/IndexContext.cjs");require("../../../contexts/RootStylesContext.cjs");var r=require("../../../contexts/SelectedValueContext.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),l=require("react");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=c(l);const n=a.makeClassName("TabPanel"),u=o.default.forwardRef(((a,c)=>{const{children:u,className:i}=a,d=e.__rest(a,["children","className"]),{selectedValue:x}=l.useContext(r),f=x===l.useContext(t);return o.default.createElement("div",Object.assign({ref:c,className:s.tremorTwMerge(n("root"),"w-full mt-2",f?"":"hidden",i),"aria-selected":f?"true":"false"},d),u)}));u.displayName="TabPanel",module.exports=u; diff --git a/dist/components/input-elements/Tabs/TabPanel.d.ts b/dist/components/input-elements/Tabs/TabPanel.d.ts new file mode 100644 index 000000000..3f476df50 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanel.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TabPanel: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TabPanel; diff --git a/dist/components/input-elements/Tabs/TabPanel.js b/dist/components/input-elements/Tabs/TabPanel.js new file mode 100644 index 000000000..da5017f75 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanel.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import"../../../contexts/BaseColorContext.js";import t from"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import o from"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";import a,{useContext as l}from"react";const m=s("TabPanel"),i=a.forwardRef(((s,i)=>{const{children:n,className:c}=s,d=e(s,["children","className"]),{selectedValue:f}=l(o),p=f===l(t);return a.createElement("div",Object.assign({ref:i,className:r(m("root"),"w-full mt-2",p?"":"hidden",c),"aria-selected":p?"true":"false"},d),n)}));i.displayName="TabPanel";export{i as default}; diff --git a/dist/components/input-elements/Tabs/TabPanels.cjs b/dist/components/input-elements/Tabs/TabPanels.cjs new file mode 100644 index 000000000..8e69f649a --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanels.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("@headlessui/react");require("../../../contexts/BaseColorContext.cjs");var r=require("../../../contexts/IndexContext.cjs");require("../../../contexts/RootStylesContext.cjs");var a=require("../../../contexts/SelectedValueContext.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(require("react"));const n=l.makeClassName("TabPanels"),o=u.default.forwardRef(((l,c)=>{const{children:o,className:i}=l,d=e.__rest(l,["children","className"]);return u.default.createElement(t.Tab.Panels,Object.assign({as:"div",ref:c,className:s.tremorTwMerge(n("root"),"w-full",i)},d),(({selectedIndex:e})=>u.default.createElement(a.Provider,{value:{selectedValue:e}},u.default.Children.map(o,((e,t)=>u.default.createElement(r.Provider,{value:t},e))))))}));o.displayName="TabPanels",module.exports=o; diff --git a/dist/components/input-elements/Tabs/TabPanels.d.ts b/dist/components/input-elements/Tabs/TabPanels.d.ts new file mode 100644 index 000000000..9ede10ab6 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanels.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TabPanels: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TabPanels; diff --git a/dist/components/input-elements/Tabs/TabPanels.js b/dist/components/input-elements/Tabs/TabPanels.js new file mode 100644 index 000000000..bebad6424 --- /dev/null +++ b/dist/components/input-elements/Tabs/TabPanels.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Tab as t}from"@headlessui/react";import"../../../contexts/BaseColorContext.js";import r from"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import o from"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import l from"react";const m=a("TabPanels"),n=l.forwardRef(((a,n)=>{const{children:i,className:c}=a,d=e(a,["children","className"]);return l.createElement(t.Panels,Object.assign({as:"div",ref:n,className:s(m("root"),"w-full",c)},d),(({selectedIndex:e})=>l.createElement(o.Provider,{value:{selectedValue:e}},l.Children.map(i,((e,t)=>l.createElement(r.Provider,{value:t},e))))))}));n.displayName="TabPanels";export{n as default}; diff --git a/dist/components/input-elements/Tabs/index.d.ts b/dist/components/input-elements/Tabs/index.d.ts new file mode 100644 index 000000000..ced74550c --- /dev/null +++ b/dist/components/input-elements/Tabs/index.d.ts @@ -0,0 +1,8 @@ +export { default as Tab } from "./Tab"; +export type { TabProps } from "./Tab"; +export { default as TabGroup } from "./TabGroup"; +export type { TabGroupProps } from "./TabGroup"; +export { default as TabList } from "./TabList"; +export type { TabListProps } from "./TabList"; +export { default as TabPanel } from "./TabPanel"; +export { default as TabPanels } from "./TabPanels"; diff --git a/dist/components/input-elements/TextInput/TextInput.cjs b/dist/components/input-elements/TextInput/TextInput.cjs new file mode 100644 index 000000000..96bdb7482 --- /dev/null +++ b/dist/components/input-elements/TextInput/TextInput.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs"),a=require("../BaseInput.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t);const i=r.makeClassName("TextInput"),l=u.default.forwardRef(((t,r)=>{const{type:s="text"}=t,l=e.__rest(t,["type"]);return u.default.createElement(a,Object.assign({ref:r,type:s,makeInputClassName:i},l))}));l.displayName="TextInput",module.exports=l; diff --git a/dist/components/input-elements/TextInput/TextInput.d.ts b/dist/components/input-elements/TextInput/TextInput.d.ts new file mode 100644 index 000000000..0b84ce657 --- /dev/null +++ b/dist/components/input-elements/TextInput/TextInput.d.ts @@ -0,0 +1,23 @@ +import React from "react"; +import { BaseInputProps } from "../BaseInput"; +export type TextInputProps = Omit & { + type?: "text" | "password" | "email" | "url"; + defaultValue?: string; + value?: string; + onValueChange?: (value: string) => void; + icon?: React.ElementType | React.JSXElementConstructor; + error?: boolean; + errorMessage?: string; + disabled?: boolean; +}; +declare const TextInput: React.ForwardRefExoticComponent & { + type?: "text" | "url" | "email" | "password" | undefined; + defaultValue?: string | undefined; + value?: string | undefined; + onValueChange?: ((value: string) => void) | undefined; + icon?: React.JSXElementConstructor | React.ElementType | undefined; + error?: boolean | undefined; + errorMessage?: string | undefined; + disabled?: boolean | undefined; +} & React.RefAttributes>; +export default TextInput; diff --git a/dist/components/input-elements/TextInput/TextInput.js b/dist/components/input-elements/TextInput/TextInput.js new file mode 100644 index 000000000..99fde48d8 --- /dev/null +++ b/dist/components/input-elements/TextInput/TextInput.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as t}from"tslib";import e from"react";import"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import m from"../BaseInput.js";const o=r("TextInput"),p=e.forwardRef(((r,p)=>{const{type:s="text"}=r,a=t(r,["type"]);return e.createElement(m,Object.assign({ref:p,type:s,makeInputClassName:o},a))}));p.displayName="TextInput";export{p as default}; diff --git a/dist/components/input-elements/TextInput/index.d.ts b/dist/components/input-elements/TextInput/index.d.ts new file mode 100644 index 000000000..927640751 --- /dev/null +++ b/dist/components/input-elements/TextInput/index.d.ts @@ -0,0 +1,2 @@ +export { default as TextInput } from "./TextInput"; +export type { TextInputProps } from "./TextInput"; diff --git a/dist/components/input-elements/Textarea/Textarea.cjs b/dist/components/input-elements/Textarea/Textarea.cjs new file mode 100644 index 000000000..65f858f00 --- /dev/null +++ b/dist/components/input-elements/Textarea/Textarea.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("../selectUtils.cjs"),t=require("../../../hooks/useInternalState.cjs"),a=require("react"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(a);const n=o.makeClassName("Textarea"),d=s.default.forwardRef(((u,d)=>{const{value:c,defaultValue:m="",placeholder:i="Type...",error:f=!1,errorMessage:g,disabled:b=!1,className:h,onChange:p,onValueChange:x}=u,k=e.__rest(u,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[v,w]=t(m,c),C=a.useRef(null),T=r.hasValue(v);return s.default.createElement(s.default.Fragment,null,s.default.createElement("textarea",Object.assign({ref:o.mergeRefs([C,d]),value:v,placeholder:i,disabled:b,className:l.tremorTwMerge(n("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",r.getSelectButtonColors(T,b,f),b?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",h),"data-testid":"text-area",onChange:e=>{null==p||p(e),w(e.target.value),null==x||x(e.target.value)}},k)),f&&g?s.default.createElement("p",{className:l.tremorTwMerge(n("errorMessage"),"text-sm text-red-500 mt-1")},g):null)}));d.displayName="Textarea",module.exports=d; diff --git a/dist/components/input-elements/Textarea/Textarea.d.ts b/dist/components/input-elements/Textarea/Textarea.d.ts new file mode 100644 index 000000000..e92a9652a --- /dev/null +++ b/dist/components/input-elements/Textarea/Textarea.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +export interface TextareaProps extends React.TextareaHTMLAttributes { + defaultValue?: string | number; + value?: string | number; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + onValueChange?: (value: any) => void; +} +declare const Textarea: React.ForwardRefExoticComponent>; +export default Textarea; diff --git a/dist/components/input-elements/Textarea/Textarea.js b/dist/components/input-elements/Textarea/Textarea.js new file mode 100644 index 000000000..2db39ef2b --- /dev/null +++ b/dist/components/input-elements/Textarea/Textarea.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{getSelectButtonColors as r,hasValue as t}from"../selectUtils.js";import a from"../../../hooks/useInternalState.js";import o,{useRef as l}from"react";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,makeClassName as d}from"../../../lib/utils.js";const m=d("Textarea"),u=o.forwardRef(((d,u)=>{const{value:c,defaultValue:i="",placeholder:f="Type...",error:p=!1,errorMessage:b,disabled:g=!1,className:h,onChange:x,onValueChange:k}=d,j=e(d,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[v,w]=a(i,c),C=l(null),N=t(v);return o.createElement(o.Fragment,null,o.createElement("textarea",Object.assign({ref:s([C,u]),value:v,placeholder:f,disabled:g,className:n(m("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",r(N,g,p),g?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",h),"data-testid":"text-area",onChange:e=>{null==x||x(e),w(e.target.value),null==k||k(e.target.value)}},j)),p&&b?o.createElement("p",{className:n(m("errorMessage"),"text-sm text-red-500 mt-1")},b):null)}));u.displayName="Textarea";export{u as default}; diff --git a/dist/components/input-elements/Textarea/index.d.ts b/dist/components/input-elements/Textarea/index.d.ts new file mode 100644 index 000000000..934962fa7 --- /dev/null +++ b/dist/components/input-elements/Textarea/index.d.ts @@ -0,0 +1,2 @@ +export { default as Textarea } from "./Textarea"; +export type { TextareaProps } from "./Textarea"; diff --git a/dist/components/input-elements/index.d.ts b/dist/components/input-elements/index.d.ts new file mode 100644 index 000000000..89f7fd3d3 --- /dev/null +++ b/dist/components/input-elements/index.d.ts @@ -0,0 +1,11 @@ +export * from "./Button"; +export * from "./DatePicker"; +export * from "./DateRangePicker"; +export * from "./MultiSelect"; +export * from "./NumberInput"; +export * from "./SearchSelect"; +export * from "./Select"; +export * from "./Switch"; +export * from "./Tabs"; +export * from "./Textarea"; +export * from "./TextInput"; diff --git a/dist/components/input-elements/selectUtils.cjs b/dist/components/input-elements/selectUtils.cjs new file mode 100644 index 000000000..618e1f79d --- /dev/null +++ b/dist/components/input-elements/selectUtils.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../lib/tremorTwMerge.cjs");function e(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var t=e(require("react"));const o=r=>["string","number"].includes(typeof r)?r:r instanceof Array?r.map(o).join(""):"object"==typeof r&&r?o(r.props.children):void 0;exports.constructValueToNameMapping=function(r){const e=new Map;return t.default.Children.map(r,(r=>{var t;e.set(r.props.value,null!==(t=o(r))&&void 0!==t?t:r.props.value)})),e},exports.getFilteredOptions=function(r,e){return t.default.Children.map(e,(e=>{var t;if((null!==(t=o(e))&&void 0!==t?t:e.props.value).toLowerCase().includes(r.toLowerCase()))return e}))},exports.getNodeText=o,exports.getSelectButtonColors=(e,t,o=!1)=>r.tremorTwMerge(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",o&&"text-red-500",o?"border-red-500":"border-tremor-border dark:border-dark-tremor-border"),exports.hasValue=function(r){return null!=r&&""!==r}; diff --git a/dist/components/input-elements/selectUtils.d.ts b/dist/components/input-elements/selectUtils.d.ts new file mode 100644 index 000000000..720c8300d --- /dev/null +++ b/dist/components/input-elements/selectUtils.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +export interface SelectItemProps { + value: string; + children?: React.ReactNode; +} +export declare const getNodeText: (node: React.ReactElement) => string | React.ReactElement | undefined; +export declare function constructValueToNameMapping(children: React.ReactElement[] | React.ReactElement): Map; +export declare function getFilteredOptions(searchQuery: string, children: React.ReactElement[]): React.ReactElement[]; +export declare const getSelectButtonColors: (hasSelection: boolean, isDisabled: boolean, hasError?: boolean) => string; +export declare function hasValue(value: T | null | undefined): boolean; diff --git a/dist/components/input-elements/selectUtils.js b/dist/components/input-elements/selectUtils.js new file mode 100644 index 000000000..813bb951c --- /dev/null +++ b/dist/components/input-elements/selectUtils.js @@ -0,0 +1 @@ +import{tremorTwMerge as r}from"../../lib/tremorTwMerge.js";import e from"react";const t=r=>["string","number"].includes(typeof r)?r:r instanceof Array?r.map(t).join(""):"object"==typeof r&&r?t(r.props.children):void 0;function o(r){const o=new Map;return e.Children.map(r,(r=>{var e;o.set(r.props.value,null!==(e=t(r))&&void 0!==e?e:r.props.value)})),o}function n(r,o){return e.Children.map(o,(e=>{var o;if((null!==(o=t(e))&&void 0!==o?o:e.props.value).toLowerCase().includes(r.toLowerCase()))return e}))}const d=(e,t,o=!1)=>r(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",o&&"text-red-500",o?"border-red-500":"border-tremor-border dark:border-dark-tremor-border");function a(r){return null!=r&&""!==r}export{o as constructValueToNameMapping,n as getFilteredOptions,t as getNodeText,d as getSelectButtonColors,a as hasValue}; diff --git a/dist/components/layout-elements/Accordion/Accordion.cjs b/dist/components/layout-elements/Accordion/Accordion.cjs new file mode 100644 index 000000000..8c511ff58 --- /dev/null +++ b/dist/components/layout-elements/Accordion/Accordion.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@headlessui/react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var t=require("../../../contexts/RootStylesContext.cjs");require("../../../contexts/SelectedValueContext.cjs");var o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),s=require("react");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=d(s);const c=a.makeClassName("Accordion"),l=s.createContext({isOpen:!1}),u=n.default.forwardRef(((a,d)=>{var u;const{defaultOpen:i=!1,children:f,className:m}=a,b=e.__rest(a,["defaultOpen","children","className"]),x=null!==(u=s.useContext(t))&&void 0!==u?u:o.tremorTwMerge("rounded-tremor-default border");return n.default.createElement(r.Disclosure,Object.assign({as:"div",ref:d,className:o.tremorTwMerge(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",x,m),defaultOpen:i},b),(({open:e})=>n.default.createElement(l.Provider,{value:{isOpen:e}},f)))}));u.displayName="Accordion",exports.OpenContext=l,exports.default=u; diff --git a/dist/components/layout-elements/Accordion/Accordion.d.ts b/dist/components/layout-elements/Accordion/Accordion.d.ts new file mode 100644 index 000000000..434579c5d --- /dev/null +++ b/dist/components/layout-elements/Accordion/Accordion.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +interface OpenContextValue { + isOpen: boolean; +} +export declare const OpenContext: React.Context; +export interface AccordionProps extends React.HTMLAttributes { + defaultOpen?: boolean; +} +declare const Accordion: React.ForwardRefExoticComponent>; +export default Accordion; diff --git a/dist/components/layout-elements/Accordion/Accordion.js b/dist/components/layout-elements/Accordion/Accordion.js new file mode 100644 index 000000000..aeb7da036 --- /dev/null +++ b/dist/components/layout-elements/Accordion/Accordion.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{Disclosure as r}from"@headlessui/react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import o from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import d,{createContext as s,useContext as n}from"react";const m=a("Accordion"),i=s({isOpen:!1}),l=d.forwardRef(((a,s)=>{var l;const{defaultOpen:c=!1,children:p,className:f}=a,u=e(a,["defaultOpen","children","className"]),b=null!==(l=n(o))&&void 0!==l?l:t("rounded-tremor-default border");return d.createElement(r,Object.assign({as:"div",ref:s,className:t(m("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",b,f),defaultOpen:c},u),(({open:e})=>d.createElement(i.Provider,{value:{isOpen:e}},p)))}));l.displayName="Accordion";export{i as OpenContext,l as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.cjs b/dist/components/layout-elements/Accordion/AccordionBody.cjs new file mode 100644 index 000000000..d11a57365 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionBody.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(r);const l=s.makeClassName("AccordionBody"),i=c.default.forwardRef(((r,s)=>{const{children:o,className:i}=r,u=e.__rest(r,["children","className"]);return c.default.createElement(t.Disclosure.Panel,Object.assign({ref:s,className:a.tremorTwMerge(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",i)},u),o)}));i.displayName="AccordionBody",module.exports=i; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.d.ts b/dist/components/layout-elements/Accordion/AccordionBody.d.ts new file mode 100644 index 000000000..3e710cfd0 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionBody.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const AccordionBody: React.ForwardRefExoticComponent & React.RefAttributes>; +export default AccordionBody; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.js b/dist/components/layout-elements/Accordion/AccordionBody.js new file mode 100644 index 000000000..0963f67d7 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionBody.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as r}from"tslib";import e from"react";import{Disclosure as t}from"@headlessui/react";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const m=a("AccordionBody"),s=e.forwardRef(((a,s)=>{const{children:c,className:l}=a,i=r(a,["children","className"]);return e.createElement(t.Panel,Object.assign({ref:s,className:o(m("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},i),c)}));s.displayName="AccordionBody";export{s as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.cjs b/dist/components/layout-elements/Accordion/AccordionHeader.cjs new file mode 100644 index 000000000..e0372f9ae --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionHeader.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("@headlessui/react"),a=require("../../../assets/ArrowUpHeadIcon.cjs"),s=require("./Accordion.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(t);const i=n.makeClassName("AccordionHeader"),u=c.default.forwardRef(((n,o)=>{const{children:u,className:d}=n,m=e.__rest(n,["children","className"]),{isOpen:f}=t.useContext(s.OpenContext);return c.default.createElement(r.Disclosure.Button,Object.assign({ref:o,className:l.tremorTwMerge(i("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},m),c.default.createElement("div",{className:l.tremorTwMerge(i("children"),"flex flex-1 text-inherit mr-4")},u),c.default.createElement("div",null,c.default.createElement(a,{className:l.tremorTwMerge(i("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))}));u.displayName="AccordionHeader",module.exports=u; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.d.ts b/dist/components/layout-elements/Accordion/AccordionHeader.d.ts new file mode 100644 index 000000000..3ceef3d30 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionHeader.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const AccordionHeader: React.ForwardRefExoticComponent & React.RefAttributes>; +export default AccordionHeader; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.js b/dist/components/layout-elements/Accordion/AccordionHeader.js new file mode 100644 index 000000000..e4d202bb3 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionHeader.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t,{useContext as r}from"react";import{Disclosure as o}from"@headlessui/react";import a from"../../../assets/ArrowUpHeadIcon.js";import{OpenContext as s}from"./Accordion.js";import{tremorTwMerge as m}from"../../../lib/tremorTwMerge.js";import{makeClassName as n}from"../../../lib/utils.js";const i=n("AccordionHeader"),l=t.forwardRef(((n,l)=>{const{children:c,className:d}=n,f=e(n,["children","className"]),{isOpen:p}=r(s);return t.createElement(o.Button,Object.assign({ref:l,className:m(i("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},f),t.createElement("div",{className:m(i("children"),"flex flex-1 text-inherit mr-4")},c),t.createElement("div",null,t.createElement(a,{className:m(i("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",p?"transition-all":"transition-all -rotate-180")})))}));l.displayName="AccordionHeader";export{l as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionList.cjs b/dist/components/layout-elements/Accordion/AccordionList.cjs new file mode 100644 index 000000000..821b281fd --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionList.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var t=require("../../../contexts/RootStylesContext.cjs");require("../../../contexts/SelectedValueContext.cjs");var o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(r);const c=a.makeClassName("AccordionList"),n=l.default.forwardRef(((r,a)=>{const{children:d,className:n}=r,u=e.__rest(r,["children","className"]),s=l.default.Children.count(d);return l.default.createElement("div",Object.assign({ref:a,className:o.tremorTwMerge(c("root"),"rounded-tremor-default","shadow-tremor-card","dark:shadow-dark-tremor-card",n)},u),l.default.Children.map(d,((e,r)=>0===r?l.default.createElement(t.Provider,{value:o.tremorTwMerge("rounded-t-tremor-default border")},l.default.cloneElement(e)):r===s-1?l.default.createElement(t.Provider,{value:o.tremorTwMerge("rounded-b-tremor-default border-l border-r border-b")},l.default.cloneElement(e)):l.default.createElement(t.Provider,{value:o.tremorTwMerge("border-l border-r border-b")},l.default.cloneElement(e)))))}));n.displayName="AccordionList",module.exports=n; diff --git a/dist/components/layout-elements/Accordion/AccordionList.d.ts b/dist/components/layout-elements/Accordion/AccordionList.d.ts new file mode 100644 index 000000000..387dfb722 --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionList.d.ts @@ -0,0 +1,6 @@ +import React from "react"; +export interface AccordionListProps extends React.HTMLAttributes { + children: React.ReactElement[] | React.ReactElement; +} +declare const AccordionList: React.ForwardRefExoticComponent>; +export default AccordionList; diff --git a/dist/components/layout-elements/Accordion/AccordionList.js b/dist/components/layout-elements/Accordion/AccordionList.js new file mode 100644 index 000000000..3b634797d --- /dev/null +++ b/dist/components/layout-elements/Accordion/AccordionList.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r from"react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import t from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{makeClassName as d}from"../../../lib/utils.js";const l=d("AccordionList"),n=r.forwardRef(((d,n)=>{const{children:a,className:m}=d,s=e(d,["children","className"]),c=r.Children.count(a);return r.createElement("div",Object.assign({ref:n,className:o(l("root"),"rounded-tremor-default","shadow-tremor-card","dark:shadow-dark-tremor-card",m)},s),r.Children.map(a,((e,d)=>0===d?r.createElement(t.Provider,{value:o("rounded-t-tremor-default border")},r.cloneElement(e)):d===c-1?r.createElement(t.Provider,{value:o("rounded-b-tremor-default border-l border-r border-b")},r.cloneElement(e)):r.createElement(t.Provider,{value:o("border-l border-r border-b")},r.cloneElement(e)))))}));n.displayName="AccordionList";export{n as default}; diff --git a/dist/components/layout-elements/Accordion/index.d.ts b/dist/components/layout-elements/Accordion/index.d.ts new file mode 100644 index 000000000..ed5cb11bb --- /dev/null +++ b/dist/components/layout-elements/Accordion/index.d.ts @@ -0,0 +1,6 @@ +export { default as Accordion } from "./Accordion"; +export type { AccordionProps } from "./Accordion"; +export { default as AccordionBody } from "./AccordionBody"; +export { default as AccordionHeader } from "./AccordionHeader"; +export { default as AccordionList } from "./AccordionList"; +export type { AccordionListProps } from "./AccordionList"; diff --git a/dist/components/layout-elements/Card/Card.cjs b/dist/components/layout-elements/Card/Card.cjs new file mode 100644 index 000000000..481ad162c --- /dev/null +++ b/dist/components/layout-elements/Card/Card.cjs @@ -0,0 +1 @@ +"use strict";var r=require("tslib"),e=require("react"),t=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var s=d(e);const n=i.makeClassName("Card"),l=r=>{if(!r)return"";switch(r){case t.HorizontalPositions.Left:return"border-l-4";case t.VerticalPositions.Top:return"border-t-4";case t.HorizontalPositions.Right:return"border-r-4";case t.VerticalPositions.Bottom:return"border-b-4";default:return""}},c=s.default.forwardRef(((e,t)=>{const{decoration:d="",decorationColor:c,children:u,className:b}=e,m=r.__rest(e,["decoration","decorationColor","children","className"]);return s.default.createElement("div",Object.assign({ref:t,className:a.tremorTwMerge(n("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",c?i.getColorClassNames(c,o.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",l(d),b)},m),u)}));c.displayName="Card",module.exports=c; diff --git a/dist/components/layout-elements/Card/Card.d.ts b/dist/components/layout-elements/Card/Card.d.ts new file mode 100644 index 000000000..3426bae53 --- /dev/null +++ b/dist/components/layout-elements/Card/Card.d.ts @@ -0,0 +1,8 @@ +import React from "react"; +import { Color, HorizontalPosition, VerticalPosition } from "lib"; +export interface CardProps extends React.HTMLAttributes { + decoration?: HorizontalPosition | VerticalPosition | ""; + decorationColor?: Color; +} +declare const Card: React.ForwardRefExoticComponent>; +export default Card; diff --git a/dist/components/layout-elements/Card/Card.js b/dist/components/layout-elements/Card/Card.js new file mode 100644 index 000000000..ef84af496 --- /dev/null +++ b/dist/components/layout-elements/Card/Card.js @@ -0,0 +1 @@ +import{__rest as r}from"tslib";import e from"react";import{VerticalPositions as o,HorizontalPositions as t}from"../../../lib/constants.js";import{colorPalette as a}from"../../../lib/theme.js";import{tremorTwMerge as d}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as i,makeClassName as m}from"../../../lib/utils.js";const n=m("Card"),s=r=>{if(!r)return"";switch(r){case t.Left:return"border-l-4";case o.Top:return"border-t-4";case t.Right:return"border-r-4";case o.Bottom:return"border-b-4";default:return""}},c=e.forwardRef(((o,t)=>{const{decoration:m="",decorationColor:c,children:l,className:b}=o,f=r(o,["decoration","decorationColor","children","className"]);return e.createElement("div",Object.assign({ref:t,className:d(n("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",c?i(c,a.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",s(m),b)},f),l)}));c.displayName="Card";export{c as default}; diff --git a/dist/components/layout-elements/Card/index.d.ts b/dist/components/layout-elements/Card/index.d.ts new file mode 100644 index 000000000..d26483de4 --- /dev/null +++ b/dist/components/layout-elements/Card/index.d.ts @@ -0,0 +1,2 @@ +export { default as Card } from "./Card"; +export type { CardProps } from "./Card"; diff --git a/dist/components/layout-elements/Dialog/Dialog.cjs b/dist/components/layout-elements/Dialog/Dialog.cjs new file mode 100644 index 000000000..103f5eb7c --- /dev/null +++ b/dist/components/layout-elements/Dialog/Dialog.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),a=require("react"),t=require("@headlessui/react"),r=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(a);const n=i.makeClassName("dialog"),o=s.default.forwardRef(((a,i)=>{const{children:l,className:o}=a,c=e.__rest(a,["children","className"]);return s.default.createElement(t.Transition,{as:s.default.Fragment,appear:!0,show:a.open},s.default.createElement(t.Dialog,Object.assign({as:"div",ref:i},c,{className:r.tremorTwMerge(n("root"),"relative z-50",o)}),s.default.createElement(t.Transition.Child,{as:s.default.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},s.default.createElement("div",{className:r.tremorTwMerge("fixed inset-0 bg-slate-950/30 dark:bg-slate-950/50 transition-opacity")})),s.default.createElement("div",{className:"fixed inset-0 overflow-y-auto w-screen"},s.default.createElement("div",{className:"flex min-h-full items-center justify-center p-4"},l))))}));o.displayName="Dialog",module.exports=o; diff --git a/dist/components/layout-elements/Dialog/Dialog.d.ts b/dist/components/layout-elements/Dialog/Dialog.d.ts new file mode 100644 index 000000000..1b6a50ec7 --- /dev/null +++ b/dist/components/layout-elements/Dialog/Dialog.d.ts @@ -0,0 +1,16 @@ +import React from "react"; +type Without = { + [P in Exclude]?: never; +}; +type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; +export type DialogProps = React.HTMLAttributes & { + open: boolean; + onClose: (val: boolean) => void; + role?: "dialog" | "alertdialog"; +} & XOR<{ + unmount?: boolean; +}, { + static?: boolean; +}>; +declare const Dialog: React.ForwardRefExoticComponent>; +export default Dialog; diff --git a/dist/components/layout-elements/Dialog/Dialog.js b/dist/components/layout-elements/Dialog/Dialog.js new file mode 100644 index 000000000..3b9d52f37 --- /dev/null +++ b/dist/components/layout-elements/Dialog/Dialog.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import a from"react";import{Transition as t,Dialog as r}from"@headlessui/react";import{tremorTwMerge as i}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";const o=s("dialog"),l=a.forwardRef(((s,l)=>{const{children:m,className:n}=s,c=e(s,["children","className"]);return a.createElement(t,{as:a.Fragment,appear:!0,show:s.open},a.createElement(r,Object.assign({as:"div",ref:l},c,{className:i(o("root"),"relative z-50",n)}),a.createElement(t.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},a.createElement("div",{className:i("fixed inset-0 bg-slate-950/30 dark:bg-slate-950/50 transition-opacity")})),a.createElement("div",{className:"fixed inset-0 overflow-y-auto w-screen"},a.createElement("div",{className:"flex min-h-full items-center justify-center p-4"},m))))}));l.displayName="Dialog";export{l as default}; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.cjs b/dist/components/layout-elements/Dialog/DialogPanel.cjs new file mode 100644 index 000000000..c66510422 --- /dev/null +++ b/dist/components/layout-elements/Dialog/DialogPanel.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var n=require("../../../contexts/RootStylesContext.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../contexts/SelectedValueContext.cjs");var s=l(r);const i=o.makeClassName("dialog"),c=s.default.forwardRef(((r,o)=>{var l;const{children:c,className:d}=r,u=e.__rest(r,["children","className"]),m=null!==(l=s.default.useContext(n))&&void 0!==l?l:a.tremorTwMerge("rounded-tremor-default p-6");return s.default.createElement(t.Transition.Child,{as:s.default.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},s.default.createElement(t.Dialog.Panel,Object.assign({ref:o,className:a.tremorTwMerge(i("panel"),"w-full max-w-lg overflow-hidden text-left ring-1 shadow-tremor transition-all transform","bg-tremor-background text-tremor-content ring-tremor-ring","dark:bg-dark-tremor-background dark:text-dark-tremor-content dark:ring-dark-tremor-ring",m,d)},u),c))}));c.displayName="DialogPanel",module.exports=c; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.d.ts b/dist/components/layout-elements/Dialog/DialogPanel.d.ts new file mode 100644 index 000000000..e8ef0b834 --- /dev/null +++ b/dist/components/layout-elements/Dialog/DialogPanel.d.ts @@ -0,0 +1,4 @@ +import React from "react"; +export type DialogPanelProps = React.HTMLAttributes; +declare const DialogPanel: React.ForwardRefExoticComponent>; +export default DialogPanel; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.js b/dist/components/layout-elements/Dialog/DialogPanel.js new file mode 100644 index 000000000..f9ac63224 --- /dev/null +++ b/dist/components/layout-elements/Dialog/DialogPanel.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{Transition as r,Dialog as o}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as n}from"../../../lib/utils.js";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import l from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";const s=n("dialog"),i=t.forwardRef(((n,i)=>{var m;const{children:c,className:d}=n,p=e(n,["children","className"]),f=null!==(m=t.useContext(l))&&void 0!==m?m:a("rounded-tremor-default p-6");return t.createElement(r.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},t.createElement(o.Panel,Object.assign({ref:i,className:a(s("panel"),"w-full max-w-lg overflow-hidden text-left ring-1 shadow-tremor transition-all transform","bg-tremor-background text-tremor-content ring-tremor-ring","dark:bg-dark-tremor-background dark:text-dark-tremor-content dark:ring-dark-tremor-ring",f,d)},p),c))}));i.displayName="DialogPanel";export{i as default}; diff --git a/dist/components/layout-elements/Dialog/index.d.ts b/dist/components/layout-elements/Dialog/index.d.ts new file mode 100644 index 000000000..945dcab0a --- /dev/null +++ b/dist/components/layout-elements/Dialog/index.d.ts @@ -0,0 +1,2 @@ +export { default as Dialog, type DialogProps } from "./Dialog"; +export { default as DialogPanel, type DialogPanelProps } from "./DialogPanel"; diff --git a/dist/components/layout-elements/Divider/Divider.cjs b/dist/components/layout-elements/Divider/Divider.cjs new file mode 100644 index 000000000..8466576ec --- /dev/null +++ b/dist/components/layout-elements/Divider/Divider.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(require("react"));const d=t.makeClassName("Divider"),m=l.default.forwardRef(((t,a)=>{const{className:m,children:o}=t,s=e.__rest(t,["className","children"]);return l.default.createElement("div",Object.assign({ref:a,className:r.tremorTwMerge(d("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",m)},s),o?l.default.createElement(l.default.Fragment,null,l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),l.default.createElement("div",{className:r.tremorTwMerge("text-inherit whitespace-nowrap")},o),l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))}));m.displayName="Divider",module.exports=m; diff --git a/dist/components/layout-elements/Divider/Divider.d.ts b/dist/components/layout-elements/Divider/Divider.d.ts new file mode 100644 index 000000000..a0eb9461f --- /dev/null +++ b/dist/components/layout-elements/Divider/Divider.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const Divider: React.ForwardRefExoticComponent & React.RefAttributes>; +export default Divider; diff --git a/dist/components/layout-elements/Divider/Divider.js b/dist/components/layout-elements/Divider/Divider.js new file mode 100644 index 000000000..62de13114 --- /dev/null +++ b/dist/components/layout-elements/Divider/Divider.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as t}from"../../../lib/utils.js";import a from"react";const m=t("Divider"),o=a.forwardRef(((t,o)=>{const{className:l,children:d}=t,s=e(t,["className","children"]);return a.createElement("div",Object.assign({ref:o,className:r(m("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",l)},s),d?a.createElement(a.Fragment,null,a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),a.createElement("div",{className:r("text-inherit whitespace-nowrap")},d),a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))}));o.displayName="Divider";export{o as default}; diff --git a/dist/components/layout-elements/Divider/index.d.ts b/dist/components/layout-elements/Divider/index.d.ts new file mode 100644 index 000000000..5aafb2563 --- /dev/null +++ b/dist/components/layout-elements/Divider/index.d.ts @@ -0,0 +1 @@ +export { default as Divider } from "./Divider"; diff --git a/dist/components/layout-elements/Flex/Flex.cjs b/dist/components/layout-elements/Flex/Flex.cjs new file mode 100644 index 000000000..a607569ee --- /dev/null +++ b/dist/components/layout-elements/Flex/Flex.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("react"));const i=r.makeClassName("Flex"),n={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},a={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},o=l.default.forwardRef(((r,s)=>{const{flexDirection:o="row",justifyContent:f="between",alignItems:u="center",children:m,className:d}=r,j=e.__rest(r,["flexDirection","justifyContent","alignItems","children","className"]);return l.default.createElement("div",Object.assign({ref:s,className:t.tremorTwMerge(i("root"),"flex w-full",c[o],n[f],a[u],d)},j),m)}));o.displayName="Flex",module.exports=o; diff --git a/dist/components/layout-elements/Flex/Flex.d.ts b/dist/components/layout-elements/Flex/Flex.d.ts new file mode 100644 index 000000000..e5cc7d7cc --- /dev/null +++ b/dist/components/layout-elements/Flex/Flex.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +import { AlignItems, FlexDirection, JustifyContent } from "../../../lib"; +export interface FlexProps extends React.HTMLAttributes { + flexDirection?: FlexDirection; + justifyContent?: JustifyContent; + alignItems?: AlignItems; + children: React.ReactNode; +} +declare const Flex: React.ForwardRefExoticComponent>; +export default Flex; diff --git a/dist/components/layout-elements/Flex/Flex.js b/dist/components/layout-elements/Flex/Flex.js new file mode 100644 index 000000000..5d57e811d --- /dev/null +++ b/dist/components/layout-elements/Flex/Flex.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import s from"react";const i=r("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},n={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},o={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},a=s.forwardRef(((r,a)=>{const{flexDirection:f="row",justifyContent:c="between",alignItems:m="center",children:u,className:d}=r,j=e(r,["flexDirection","justifyContent","alignItems","children","className"]);return s.createElement("div",Object.assign({ref:a,className:t(i("root"),"flex w-full",o[f],l[c],n[m],d)},j),u)}));a.displayName="Flex";export{a as default}; diff --git a/dist/components/layout-elements/Flex/index.d.ts b/dist/components/layout-elements/Flex/index.d.ts new file mode 100644 index 000000000..4cd8021c0 --- /dev/null +++ b/dist/components/layout-elements/Flex/index.d.ts @@ -0,0 +1,2 @@ +export { default as Flex } from "./Flex"; +export type { FlexProps } from "./Flex"; diff --git a/dist/components/layout-elements/Grid/Col.cjs b/dist/components/layout-elements/Grid/Col.cjs new file mode 100644 index 000000000..1dc36bb71 --- /dev/null +++ b/dist/components/layout-elements/Grid/Col.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs"),a=require("react"),l=require("./styles.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(a);const s=n.makeClassName("Col"),u=o.default.forwardRef(((n,a)=>{const{numColSpan:t=1,numColSpanSm:u,numColSpanMd:c,numColSpanLg:m,children:i,className:S}=n,p=e.__rest(n,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return o.default.createElement("div",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),(()=>{const e=d(t,l.colSpan),n=d(u,l.colSpanSm),a=d(c,l.colSpanMd),o=d(m,l.colSpanLg);return r.tremorTwMerge(e,n,a,o)})(),S)},p),i)}));u.displayName="Col",module.exports=u; diff --git a/dist/components/layout-elements/Grid/Col.d.ts b/dist/components/layout-elements/Grid/Col.d.ts new file mode 100644 index 000000000..0e5d758ef --- /dev/null +++ b/dist/components/layout-elements/Grid/Col.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface ColProps extends React.HTMLAttributes { + numColSpan?: number; + numColSpanSm?: number; + numColSpanMd?: number; + numColSpanLg?: number; +} +declare const Col: React.ForwardRefExoticComponent>; +export default Col; diff --git a/dist/components/layout-elements/Grid/Col.js b/dist/components/layout-elements/Grid/Col.js new file mode 100644 index 000000000..804227dea --- /dev/null +++ b/dist/components/layout-elements/Grid/Col.js @@ -0,0 +1 @@ +import{__rest as o}from"tslib";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import m from"react";import{colSpan as e,colSpanSm as l,colSpanMd as t,colSpanLg as a}from"./styles.js";const s=r("Col"),i=m.forwardRef(((r,i)=>{const{numColSpan:p=1,numColSpanSm:c,numColSpanMd:u,numColSpanLg:S,children:C,className:d}=r,f=o(r,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),b=(o,n)=>o&&Object.keys(n).includes(String(o))?n[o]:"";return m.createElement("div",Object.assign({ref:i,className:n(s("root"),(()=>{const o=b(p,e),r=b(c,l),m=b(u,t),s=b(S,a);return n(o,r,m,s)})(),d)},f),C)}));i.displayName="Col";export{i as default}; diff --git a/dist/components/layout-elements/Grid/Grid.cjs b/dist/components/layout-elements/Grid/Grid.cjs new file mode 100644 index 000000000..e63968a65 --- /dev/null +++ b/dist/components/layout-elements/Grid/Grid.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),t=require("react"),m=require("./styles.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=i(t);const l=s.makeClassName("Grid"),a=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",d=u.default.forwardRef(((s,t)=>{const{numItems:i=1,numItemsSm:d,numItemsMd:n,numItemsLg:c,children:o,className:g}=s,f=e.__rest(s,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),I=a(i,m.gridCols),b=a(d,m.gridColsSm),j=a(n,m.gridColsMd),M=a(c,m.gridColsLg),q=r.tremorTwMerge(I,b,j,M);return u.default.createElement("div",Object.assign({ref:t,className:r.tremorTwMerge(l("root"),"grid",q,g)},f),o)}));d.displayName="Grid",module.exports=d; diff --git a/dist/components/layout-elements/Grid/Grid.d.ts b/dist/components/layout-elements/Grid/Grid.d.ts new file mode 100644 index 000000000..fc83cddb7 --- /dev/null +++ b/dist/components/layout-elements/Grid/Grid.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +export interface GridProps extends React.HTMLAttributes { + numItems?: number; + numItemsSm?: number; + numItemsMd?: number; + numItemsLg?: number; + children: React.ReactNode; +} +declare const Grid: React.ForwardRefExoticComponent>; +export default Grid; diff --git a/dist/components/layout-elements/Grid/Grid.js b/dist/components/layout-elements/Grid/Grid.js new file mode 100644 index 000000000..c364c2e1d --- /dev/null +++ b/dist/components/layout-elements/Grid/Grid.js @@ -0,0 +1 @@ +import{__rest as m}from"tslib";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";import t from"react";import{gridCols as r,gridColsSm as i,gridColsMd as n,gridColsLg as o}from"./styles.js";const a=s("Grid"),l=(m,e)=>m&&Object.keys(e).includes(String(m))?e[m]:"",c=t.forwardRef(((s,c)=>{const{numItems:d=1,numItemsSm:u,numItemsMd:f,numItemsLg:I,children:p,className:g}=s,b=m(s,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),j=l(d,r),N=l(u,i),y=l(f,n),M=l(I,o),S=e(j,N,y,M);return t.createElement("div",Object.assign({ref:c,className:e(a("root"),"grid",S,g)},b),p)}));c.displayName="Grid";export{c as default}; diff --git a/dist/components/layout-elements/Grid/index.d.ts b/dist/components/layout-elements/Grid/index.d.ts new file mode 100644 index 000000000..b7bb8e691 --- /dev/null +++ b/dist/components/layout-elements/Grid/index.d.ts @@ -0,0 +1,4 @@ +export { default as Col } from "./Col"; +export type { ColProps } from "./Col"; +export { default as Grid } from "./Grid"; +export type { GridProps } from "./Grid"; diff --git a/dist/components/layout-elements/Grid/styles.cjs b/dist/components/layout-elements/Grid/styles.cjs new file mode 100644 index 000000000..c10a36c20 --- /dev/null +++ b/dist/components/layout-elements/Grid/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.colSpan={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},exports.colSpanLg={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"},exports.colSpanMd={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},exports.colSpanSm={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},exports.gridCols={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},exports.gridColsLg={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},exports.gridColsMd={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},exports.gridColsSm={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"}; diff --git a/dist/components/layout-elements/Grid/styles.d.ts b/dist/components/layout-elements/Grid/styles.d.ts new file mode 100644 index 000000000..f15a8629e --- /dev/null +++ b/dist/components/layout-elements/Grid/styles.d.ts @@ -0,0 +1,11 @@ +export type GridClassesMapping = { + [key: string]: string; +}; +export declare const gridCols: GridClassesMapping; +export declare const gridColsSm: GridClassesMapping; +export declare const gridColsMd: GridClassesMapping; +export declare const gridColsLg: GridClassesMapping; +export declare const colSpan: GridClassesMapping; +export declare const colSpanSm: GridClassesMapping; +export declare const colSpanMd: GridClassesMapping; +export declare const colSpanLg: GridClassesMapping; diff --git a/dist/components/layout-elements/Grid/styles.js b/dist/components/layout-elements/Grid/styles.js new file mode 100644 index 000000000..434cafd12 --- /dev/null +++ b/dist/components/layout-elements/Grid/styles.js @@ -0,0 +1 @@ +const s={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},l={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},o={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},c={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},d={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},g={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},n={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},p={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};export{d as colSpan,p as colSpanLg,n as colSpanMd,g as colSpanSm,s as gridCols,c as gridColsLg,o as gridColsMd,l as gridColsSm}; diff --git a/dist/components/layout-elements/index.d.ts b/dist/components/layout-elements/index.d.ts new file mode 100644 index 000000000..c92f948a4 --- /dev/null +++ b/dist/components/layout-elements/index.d.ts @@ -0,0 +1,6 @@ +export * from "./Accordion"; +export * from "./Card"; +export * from "./Divider"; +export * from "./Flex"; +export * from "./Grid"; +export * from "./Dialog"; diff --git a/dist/components/list-elements/List/List.cjs b/dist/components/list-elements/List/List.cjs new file mode 100644 index 000000000..ca013963a --- /dev/null +++ b/dist/components/list-elements/List/List.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(require("react"));const s=t.makeClassName("List"),d=i.default.forwardRef(((t,a)=>{const{children:d,className:l}=t,o=e.__rest(t,["children","className"]);return i.default.createElement("ul",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),"w-full divide-y","divide-tremor-border text-tremor-content","dark:divide-dark-tremor-border dark:text-dark-tremor-content",l)},o),d)}));d.displayName="List",module.exports=d; diff --git a/dist/components/list-elements/List/List.d.ts b/dist/components/list-elements/List/List.d.ts new file mode 100644 index 000000000..b56b0b54e --- /dev/null +++ b/dist/components/list-elements/List/List.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const List: React.ForwardRefExoticComponent & React.RefAttributes>; +export default List; diff --git a/dist/components/list-elements/List/List.js b/dist/components/list-elements/List/List.js new file mode 100644 index 000000000..66de5e7a7 --- /dev/null +++ b/dist/components/list-elements/List/List.js @@ -0,0 +1 @@ +import{__rest as r}from"tslib";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{makeClassName as t}from"../../../lib/utils.js";import o from"react";const i=t("List"),a=o.forwardRef(((t,a)=>{const{children:m,className:s}=t,d=r(t,["children","className"]);return o.createElement("ul",Object.assign({ref:a,className:e(i("root"),"w-full divide-y","divide-tremor-border text-tremor-content","dark:divide-dark-tremor-border dark:text-dark-tremor-content",s)},d),m)}));a.displayName="List";export{a as default}; diff --git a/dist/components/list-elements/List/ListItem.cjs b/dist/components/list-elements/List/ListItem.cjs new file mode 100644 index 000000000..64b7e2b1e --- /dev/null +++ b/dist/components/list-elements/List/ListItem.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(t);const i=l.makeClassName("ListItem"),u=s.default.forwardRef(((t,l)=>{const{children:a,className:u}=t,c=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("li",Object.assign({ref:l,className:r.tremorTwMerge(i("root"),"w-full flex justify-between items-center text-tremor-default py-2",u)},c),a))}));u.displayName="ListItem",module.exports=u; diff --git a/dist/components/list-elements/List/ListItem.d.ts b/dist/components/list-elements/List/ListItem.d.ts new file mode 100644 index 000000000..077c98a59 --- /dev/null +++ b/dist/components/list-elements/List/ListItem.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const ListItem: React.ForwardRefExoticComponent & React.RefAttributes>; +export default ListItem; diff --git a/dist/components/list-elements/List/ListItem.js b/dist/components/list-elements/List/ListItem.js new file mode 100644 index 000000000..b33600b01 --- /dev/null +++ b/dist/components/list-elements/List/ListItem.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const m=l("ListItem"),s=t.forwardRef(((l,s)=>{const{children:a,className:i}=l,o=e(l,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("li",Object.assign({ref:s,className:r(m("root"),"w-full flex justify-between items-center text-tremor-default py-2",i)},o),a))}));s.displayName="ListItem";export{s as default}; diff --git a/dist/components/list-elements/List/index.d.ts b/dist/components/list-elements/List/index.d.ts new file mode 100644 index 000000000..7944cfdf9 --- /dev/null +++ b/dist/components/list-elements/List/index.d.ts @@ -0,0 +1,2 @@ +export { default as List } from "./List"; +export { default as ListItem } from "./ListItem"; diff --git a/dist/components/list-elements/Table/Table.cjs b/dist/components/list-elements/Table/Table.cjs new file mode 100644 index 000000000..278427525 --- /dev/null +++ b/dist/components/list-elements/Table/Table.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const o=a.makeClassName("Table"),c=s.default.forwardRef(((t,a)=>{const{children:l,className:c}=t,u=e.__rest(t,["children","className"]);return s.default.createElement("div",{className:r.tremorTwMerge(o("root"),"overflow-auto",c)},s.default.createElement("table",Object.assign({ref:a,className:r.tremorTwMerge(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},u),l))}));c.displayName="Table",module.exports=c; diff --git a/dist/components/list-elements/Table/Table.d.ts b/dist/components/list-elements/Table/Table.d.ts new file mode 100644 index 000000000..615653b5e --- /dev/null +++ b/dist/components/list-elements/Table/Table.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const Table: React.ForwardRefExoticComponent & React.RefAttributes>; +export default Table; diff --git a/dist/components/list-elements/Table/Table.js b/dist/components/list-elements/Table/Table.js new file mode 100644 index 000000000..534c30d44 --- /dev/null +++ b/dist/components/list-elements/Table/Table.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const o=a("Table"),l=t.forwardRef(((a,l)=>{const{children:m,className:s}=a,c=e(a,["children","className"]);return t.createElement("div",{className:r(o("root"),"overflow-auto",s)},t.createElement("table",Object.assign({ref:l,className:r(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},c),m))}));l.displayName="Table";export{l as default}; diff --git a/dist/components/list-elements/Table/TableBody.cjs b/dist/components/list-elements/Table/TableBody.cjs new file mode 100644 index 000000000..fa99b806e --- /dev/null +++ b/dist/components/list-elements/Table/TableBody.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(r);const i=a.makeClassName("TableBody"),s=d.default.forwardRef(((r,a)=>{const{children:l,className:s}=r,o=e.__rest(r,["children","className"]);return d.default.createElement(d.default.Fragment,null,d.default.createElement("tbody",Object.assign({ref:a,className:t.tremorTwMerge(i("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",s)},o),l))}));s.displayName="TableBody",module.exports=s; diff --git a/dist/components/list-elements/Table/TableBody.d.ts b/dist/components/list-elements/Table/TableBody.d.ts new file mode 100644 index 000000000..322a2bcf6 --- /dev/null +++ b/dist/components/list-elements/Table/TableBody.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableBody: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableBody; diff --git a/dist/components/list-elements/Table/TableBody.js b/dist/components/list-elements/Table/TableBody.js new file mode 100644 index 000000000..9e102b25e --- /dev/null +++ b/dist/components/list-elements/Table/TableBody.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableBody"),i=r.forwardRef(((o,i)=>{const{children:d,className:l}=o,m=e(o,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tbody",Object.assign({ref:i,className:t(a("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},m),d))}));i.displayName="TableBody";export{i as default}; diff --git a/dist/components/list-elements/Table/TableCell.cjs b/dist/components/list-elements/Table/TableCell.cjs new file mode 100644 index 000000000..8382bd206 --- /dev/null +++ b/dist/components/list-elements/Table/TableCell.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);const i=l.makeClassName("TableCell"),c=s.default.forwardRef(((r,l)=>{const{children:a,className:c}=r,u=e.__rest(r,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("td",Object.assign({ref:l,className:t.tremorTwMerge(i("root"),"align-middle whitespace-nowrap text-left p-4",c)},u),a))}));c.displayName="TableCell",module.exports=c; diff --git a/dist/components/list-elements/Table/TableCell.d.ts b/dist/components/list-elements/Table/TableCell.d.ts new file mode 100644 index 000000000..7e7f6038d --- /dev/null +++ b/dist/components/list-elements/Table/TableCell.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableCell: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableCell; diff --git a/dist/components/list-elements/Table/TableCell.js b/dist/components/list-elements/Table/TableCell.js new file mode 100644 index 000000000..f5d90d18a --- /dev/null +++ b/dist/components/list-elements/Table/TableCell.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const a=l("TableCell"),m=r.forwardRef(((l,m)=>{const{children:s,className:o}=l,i=e(l,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("td",Object.assign({ref:m,className:t(a("root"),"align-middle whitespace-nowrap text-left p-4",o)},i),s))}));m.displayName="TableCell";export{m as default}; diff --git a/dist/components/list-elements/Table/TableFoot.cjs b/dist/components/list-elements/Table/TableFoot.cjs new file mode 100644 index 000000000..5ca929878 --- /dev/null +++ b/dist/components/list-elements/Table/TableFoot.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);const l=o.makeClassName("TableFoot"),d=s.default.forwardRef(((r,o)=>{const{children:a,className:d}=r,c=e.__rest(r,["children","className"]);return s.default.createElement("tfoot",Object.assign({ref:o,className:t.tremorTwMerge(l("root"),"text-left font-medium border-t-[1px] ","text-tremor-content border-tremor-border","dark:text-dark-tremor-content dark:border-dark-tremor-border",d)},c),a)}));d.displayName="TableFoot",module.exports=d; diff --git a/dist/components/list-elements/Table/TableFoot.d.ts b/dist/components/list-elements/Table/TableFoot.d.ts new file mode 100644 index 000000000..9571f1099 --- /dev/null +++ b/dist/components/list-elements/Table/TableFoot.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableFoot: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableFoot; diff --git a/dist/components/list-elements/Table/TableFoot.js b/dist/components/list-elements/Table/TableFoot.js new file mode 100644 index 000000000..5492e973a --- /dev/null +++ b/dist/components/list-elements/Table/TableFoot.js @@ -0,0 +1 @@ +import{__rest as r}from"tslib";import e from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableFoot"),m=e.forwardRef(((o,m)=>{const{children:s,className:d}=o,l=r(o,["children","className"]);return e.createElement("tfoot",Object.assign({ref:m,className:t(a("root"),"text-left font-medium border-t-[1px] ","text-tremor-content border-tremor-border","dark:text-dark-tremor-content dark:border-dark-tremor-border",d)},l),s)}));m.displayName="TableFoot";export{m as default}; diff --git a/dist/components/list-elements/Table/TableFooterCell.cjs b/dist/components/list-elements/Table/TableFooterCell.cjs new file mode 100644 index 000000000..e40275c16 --- /dev/null +++ b/dist/components/list-elements/Table/TableFooterCell.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(t);const s=a.makeClassName("TableFooterCell"),n=o.default.forwardRef(((t,a)=>{const{children:l,className:n}=t,c=e.__rest(t,["children","className"]);return o.default.createElement(o.default.Fragment,null,o.default.createElement("th",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),"top-0 px-4 py-3.5","text-tremor-content font-medium","dark:text-dark-tremor-content",n)},c),l))}));n.displayName="TableFooterCell",module.exports=n; diff --git a/dist/components/list-elements/Table/TableFooterCell.d.ts b/dist/components/list-elements/Table/TableFooterCell.d.ts new file mode 100644 index 000000000..baef22428 --- /dev/null +++ b/dist/components/list-elements/Table/TableFooterCell.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableFooterCell: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableFooterCell; diff --git a/dist/components/list-elements/Table/TableFooterCell.js b/dist/components/list-elements/Table/TableFooterCell.js new file mode 100644 index 000000000..5188d274c --- /dev/null +++ b/dist/components/list-elements/Table/TableFooterCell.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const l=o("TableFooterCell"),a=t.forwardRef(((o,a)=>{const{children:m,className:s}=o,n=e(o,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("th",Object.assign({ref:a,className:r(l("root"),"top-0 px-4 py-3.5","text-tremor-content font-medium","dark:text-dark-tremor-content",s)},n),m))}));a.displayName="TableFooterCell";export{a as default}; diff --git a/dist/components/list-elements/Table/TableHead.cjs b/dist/components/list-elements/Table/TableHead.cjs new file mode 100644 index 000000000..aef4ed5ed --- /dev/null +++ b/dist/components/list-elements/Table/TableHead.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const c=a.makeClassName("TableHead"),n=s.default.forwardRef(((t,a)=>{const{children:l,className:n}=t,u=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("thead",Object.assign({ref:a,className:r.tremorTwMerge(c("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",n)},u),l))}));n.displayName="TableHead",module.exports=n; diff --git a/dist/components/list-elements/Table/TableHead.d.ts b/dist/components/list-elements/Table/TableHead.d.ts new file mode 100644 index 000000000..69a2f410d --- /dev/null +++ b/dist/components/list-elements/Table/TableHead.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableHead: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableHead; diff --git a/dist/components/list-elements/Table/TableHead.js b/dist/components/list-elements/Table/TableHead.js new file mode 100644 index 000000000..ee75c7035 --- /dev/null +++ b/dist/components/list-elements/Table/TableHead.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const o=a("TableHead"),l=t.forwardRef(((a,l)=>{const{children:m,className:s}=a,n=e(a,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("thead",Object.assign({ref:l,className:r(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",s)},n),m))}));l.displayName="TableHead";export{l as default}; diff --git a/dist/components/list-elements/Table/TableHeaderCell.cjs b/dist/components/list-elements/Table/TableHeaderCell.cjs new file mode 100644 index 000000000..08b4da5a3 --- /dev/null +++ b/dist/components/list-elements/Table/TableHeaderCell.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const n=a.makeClassName("TableHeaderCell"),o=s.default.forwardRef(((t,a)=>{const{children:l,className:o}=t,c=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("th",Object.assign({ref:a,className:r.tremorTwMerge(n("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",o)},c),l))}));o.displayName="TableHeaderCell",module.exports=o; diff --git a/dist/components/list-elements/Table/TableHeaderCell.d.ts b/dist/components/list-elements/Table/TableHeaderCell.d.ts new file mode 100644 index 000000000..f665da95b --- /dev/null +++ b/dist/components/list-elements/Table/TableHeaderCell.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableHeaderCell: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableHeaderCell; diff --git a/dist/components/list-elements/Table/TableHeaderCell.js b/dist/components/list-elements/Table/TableHeaderCell.js new file mode 100644 index 000000000..c1c242a6e --- /dev/null +++ b/dist/components/list-elements/Table/TableHeaderCell.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableHeaderCell"),l=t.forwardRef(((o,l)=>{const{children:s,className:m}=o,n=e(o,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("th",Object.assign({ref:l,className:r(a("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",m)},n),s))}));l.displayName="TableHeaderCell";export{l as default}; diff --git a/dist/components/list-elements/Table/TableRow.cjs b/dist/components/list-elements/Table/TableRow.cjs new file mode 100644 index 000000000..7c0d8b5ba --- /dev/null +++ b/dist/components/list-elements/Table/TableRow.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r);const u=a.makeClassName("TableRow"),c=s.default.forwardRef(((r,a)=>{const{children:l,className:c}=r,i=e.__rest(r,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("tr",Object.assign({ref:a,className:t.tremorTwMerge(u("row"),c)},i),l))}));c.displayName="TableRow",module.exports=c; diff --git a/dist/components/list-elements/Table/TableRow.d.ts b/dist/components/list-elements/Table/TableRow.d.ts new file mode 100644 index 000000000..9e16ea2a2 --- /dev/null +++ b/dist/components/list-elements/Table/TableRow.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const TableRow: React.ForwardRefExoticComponent & React.RefAttributes>; +export default TableRow; diff --git a/dist/components/list-elements/Table/TableRow.js b/dist/components/list-elements/Table/TableRow.js new file mode 100644 index 000000000..53b8aad6e --- /dev/null +++ b/dist/components/list-elements/Table/TableRow.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const l=a("TableRow"),m=r.forwardRef(((a,m)=>{const{children:o,className:s}=a,i=e(a,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tr",Object.assign({ref:m,className:t(l("row"),s)},i),o))}));m.displayName="TableRow";export{m as default}; diff --git a/dist/components/list-elements/Table/index.d.ts b/dist/components/list-elements/Table/index.d.ts new file mode 100644 index 000000000..b63bbe265 --- /dev/null +++ b/dist/components/list-elements/Table/index.d.ts @@ -0,0 +1,8 @@ +export { default as Table } from "./Table"; +export { default as TableBody } from "./TableBody"; +export { default as TableCell } from "./TableCell"; +export { default as TableFoot } from "./TableFoot"; +export { default as TableFooterCell } from "./TableFooterCell"; +export { default as TableHead } from "./TableHead"; +export { default as TableHeaderCell } from "./TableHeaderCell"; +export { default as TableRow } from "./TableRow"; diff --git a/dist/components/list-elements/index.d.ts b/dist/components/list-elements/index.d.ts new file mode 100644 index 000000000..0667dd2d0 --- /dev/null +++ b/dist/components/list-elements/index.d.ts @@ -0,0 +1,2 @@ +export * from "./List"; +export * from "./Table"; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs new file mode 100644 index 000000000..55a2e6651 --- /dev/null +++ b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),n=require("../../chart-elements/common/utils.cjs"),i=require("../../chart-elements/common/NoData.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(t);const m=u.default.forwardRef(((t,c)=>{const{data:m=[],categories:d=[],index:f,stack:p=!1,colors:C=o.themeColorRange,showAnimation:y=!1,animationDuration:g=900,showGradient:x=!0,curveType:h="linear",connectNulls:N=!1,noDataText:v,autoMinValue:E=!1,minValue:k,maxValue:A,className:j}=t,q=e.__rest(t,["data","categories","index","stack","colors","showAnimation","animationDuration","showGradient","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),w=n.constructCategoryColors(d,C),b=n.getYAxisDomain(E,k,A);return u.default.createElement("div",Object.assign({ref:c,className:l.tremorTwMerge("w-28 h-12",j)},q),u.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?u.default.createElement(a.AreaChart,{data:m,margin:{top:1,left:1,right:1,bottom:1}},u.default.createElement(a.YAxis,{hide:!0,domain:b}),u.default.createElement(a.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var t,a;return u.default.createElement("defs",{key:e},x?u.default.createElement("linearGradient",{className:s.getColorClassNames(null!==(t=w.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).textColor,id:w.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},u.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),u.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):u.default.createElement("linearGradient",{className:s.getColorClassNames(null!==(a=w.get(e))&&void 0!==a?a:r.BaseColors.Gray,o.colorPalette.text).textColor,id:w.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},u.default.createElement("stop",{stopColor:"currentColor",stopOpacity:.3})))})),d.map((e=>{var t;return u.default.createElement(a.Area,{className:s.getColorClassNames(null!==(t=w.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).strokeColor,strokeOpacity:1,dot:!1,key:e,name:e,type:h,dataKey:e,stroke:"",fill:`url(#${w.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:y,animationDuration:g,stackId:p?"a":void 0,connectNulls:N})}))):u.default.createElement(i,{noDataText:v})))}));m.displayName="AreaChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts new file mode 100644 index 000000000..aaac77750 --- /dev/null +++ b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +import { CurveType } from "../../../lib/inputTypes"; +import BaseSparkChartProps from "../common/BaseSparkChartProps"; +export interface SparkAreaChartProps extends BaseSparkChartProps { + stack?: boolean; + curveType?: CurveType; + connectNulls?: boolean; + showGradient?: boolean; +} +declare const AreaChart: React.ForwardRefExoticComponent>; +export default AreaChart; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js new file mode 100644 index 000000000..e8e6590fd --- /dev/null +++ b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import{ResponsiveContainer as a,AreaChart as o,YAxis as r,XAxis as n,Area as l}from"recharts";import{BaseColors as i}from"../../../lib/constants.js";import{themeColorRange as s,colorPalette as m}from"../../../lib/theme.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as u}from"../../../lib/utils.js";import{constructCategoryColors as d,getYAxisDomain as p}from"../../chart-elements/common/utils.js";import f from"../../chart-elements/common/NoData.js";const y=t.forwardRef(((y,h)=>{const{data:x=[],categories:g=[],index:E,stack:N=!1,colors:k=s,showAnimation:v=!1,animationDuration:C=900,showGradient:j=!0,curveType:w="linear",connectNulls:b=!1,noDataText:D,autoMinValue:G=!1,minValue:A,maxValue:T,className:V}=y,O=e(y,["data","categories","index","stack","colors","showAnimation","animationDuration","showGradient","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),M=d(g,k),K=p(G,A,T);return t.createElement("div",Object.assign({ref:h,className:c("w-28 h-12",V)},O),t.createElement(a,{className:"h-full w-full"},(null==x?void 0:x.length)?t.createElement(o,{data:x,margin:{top:1,left:1,right:1,bottom:1}},t.createElement(r,{hide:!0,domain:K}),t.createElement(n,{hide:!0,dataKey:E}),g.map((e=>{var a,o;return t.createElement("defs",{key:e},j?t.createElement("linearGradient",{className:u(null!==(a=M.get(e))&&void 0!==a?a:i.Gray,m.text).textColor,id:M.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),t.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):t.createElement("linearGradient",{className:u(null!==(o=M.get(e))&&void 0!==o?o:i.Gray,m.text).textColor,id:M.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{stopColor:"currentColor",stopOpacity:.3})))})),g.map((e=>{var a;return t.createElement(l,{className:u(null!==(a=M.get(e))&&void 0!==a?a:i.Gray,m.text).strokeColor,strokeOpacity:1,dot:!1,key:e,name:e,type:w,dataKey:e,stroke:"",fill:`url(#${M.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:v,animationDuration:C,stackId:N?"a":void 0,connectNulls:b})}))):t.createElement(f,{noDataText:D})))}));y.displayName="AreaChart";export{y as default}; diff --git a/dist/components/spark-elements/SparkAreaChart/index.d.ts b/dist/components/spark-elements/SparkAreaChart/index.d.ts new file mode 100644 index 000000000..adf7015d5 --- /dev/null +++ b/dist/components/spark-elements/SparkAreaChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as SparkAreaChart } from "./SparkAreaChart"; +export type { SparkAreaChartProps } from "./SparkAreaChart"; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs b/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs new file mode 100644 index 000000000..a37d279f0 --- /dev/null +++ b/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),a=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),r=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("react"),o=require("recharts"),n=require("../../chart-elements/common/utils.cjs"),s=require("../../chart-elements/common/NoData.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(l);const m=u.default.forwardRef(((l,c)=>{const{data:m=[],categories:d=[],index:f,colors:g=t.themeColorRange,stack:h=!1,relative:x=!1,animationDuration:v=900,showAnimation:C=!1,noDataText:b,autoMinValue:p=!1,minValue:q,maxValue:j,className:w}=l,y=e.__rest(l,["data","categories","index","colors","stack","relative","animationDuration","showAnimation","noDataText","autoMinValue","minValue","maxValue","className"]),D=n.constructCategoryColors(d,g),N=n.getYAxisDomain(p,q,j);return u.default.createElement("div",Object.assign({ref:c,className:r.tremorTwMerge("w-28 h-12",w)},y),u.default.createElement(o.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?u.default.createElement(o.BarChart,{data:m,stackOffset:x?"expand":"none",margin:{top:0,left:-1.5,right:-1.5,bottom:0}},u.default.createElement(o.YAxis,{hide:!0,domain:N}),u.default.createElement(o.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var l;return u.default.createElement(o.Bar,{className:r.tremorTwMerge(i.getColorClassNames(null!==(l=D.get(e))&&void 0!==l?l:a.BaseColors.Gray,t.colorPalette.background).fillColor),key:e,name:e,type:"linear",stackId:h||x?"a":void 0,dataKey:e,fill:"",isAnimationActive:C,animationDuration:v})}))):u.default.createElement(s,{noDataText:b})))}));m.displayName="SparkBarChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts b/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts new file mode 100644 index 000000000..58a69eb2a --- /dev/null +++ b/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts @@ -0,0 +1,8 @@ +import React from "react"; +import BaseSparkChartProps from "../common/BaseSparkChartProps"; +export interface SparkBarChartProps extends BaseSparkChartProps { + stack?: boolean; + relative?: boolean; +} +declare const SparkBarChart: React.ForwardRefExoticComponent>; +export default SparkBarChart; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.js b/dist/components/spark-elements/SparkBarChart/SparkBarChart.js new file mode 100644 index 000000000..9982486f1 --- /dev/null +++ b/dist/components/spark-elements/SparkBarChart/SparkBarChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as a}from"tslib";import{BaseColors as e}from"../../../lib/constants.js";import{themeColorRange as t,colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as i}from"../../../lib/utils.js";import m from"react";import{ResponsiveContainer as n,BarChart as l,YAxis as s,XAxis as c,Bar as u}from"recharts";import{constructCategoryColors as d,getYAxisDomain as f}from"../../chart-elements/common/utils.js";import p from"../../chart-elements/common/NoData.js";const h=m.forwardRef(((h,g)=>{const{data:x=[],categories:b=[],index:v,colors:j=t,stack:k=!1,relative:D=!1,animationDuration:E=900,showAnimation:N=!1,noDataText:w,autoMinValue:y=!1,minValue:V,maxValue:A,className:T}=h,M=a(h,["data","categories","index","colors","stack","relative","animationDuration","showAnimation","noDataText","autoMinValue","minValue","maxValue","className"]),C=d(b,j),K=f(y,V,A);return m.createElement("div",Object.assign({ref:g,className:r("w-28 h-12",T)},M),m.createElement(n,{className:"h-full w-full"},(null==x?void 0:x.length)?m.createElement(l,{data:x,stackOffset:D?"expand":"none",margin:{top:0,left:-1.5,right:-1.5,bottom:0}},m.createElement(s,{hide:!0,domain:K}),m.createElement(c,{hide:!0,dataKey:v}),b.map((a=>{var t;return m.createElement(u,{className:r(i(null!==(t=C.get(a))&&void 0!==t?t:e.Gray,o.background).fillColor),key:a,name:a,type:"linear",stackId:k||D?"a":void 0,dataKey:a,fill:"",isAnimationActive:N,animationDuration:E})}))):m.createElement(p,{noDataText:w})))}));h.displayName="SparkBarChart";export{h as default}; diff --git a/dist/components/spark-elements/SparkBarChart/index.d.ts b/dist/components/spark-elements/SparkBarChart/index.d.ts new file mode 100644 index 000000000..ea3b365e8 --- /dev/null +++ b/dist/components/spark-elements/SparkBarChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as SparkBarChart } from "./SparkBarChart"; +export type { SparkBarChartProps } from "./SparkBarChart"; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs b/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs new file mode 100644 index 000000000..d564bbea6 --- /dev/null +++ b/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("../../chart-elements/common/utils.cjs"),s=require("../../chart-elements/common/NoData.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);const m=c.default.forwardRef(((t,u)=>{const{data:m=[],categories:d=[],index:f,colors:h=o.themeColorRange,animationDuration:g=900,showAnimation:p=!1,curveType:x="linear",connectNulls:y=!1,noDataText:N,autoMinValue:v=!1,minValue:C,maxValue:j,className:q}=t,b=e.__rest(t,["data","categories","index","colors","animationDuration","showAnimation","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),k=l.constructCategoryColors(d,h),w=l.getYAxisDomain(v,C,j);return c.default.createElement("div",Object.assign({ref:u,className:n.tremorTwMerge("w-28 h-12",q)},b),c.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?c.default.createElement(a.LineChart,{data:m,margin:{top:1,left:1,right:1,bottom:1}},c.default.createElement(a.YAxis,{hide:!0,domain:w}),c.default.createElement(a.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var t;return c.default.createElement(a.Line,{className:n.tremorTwMerge(i.getColorClassNames(null!==(t=k.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).strokeColor),strokeOpacity:1,dot:!1,key:e,name:e,type:x,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:g,connectNulls:y})}))):c.default.createElement(s,{noDataText:N})))}));m.displayName="SparkLineChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts b/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts new file mode 100644 index 000000000..245cf9cc3 --- /dev/null +++ b/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +import { CurveType } from "../../../lib/inputTypes"; +import BaseSparkChartProps from "../common/BaseSparkChartProps"; +export interface SparkLineChartProps extends BaseSparkChartProps { + curveType?: CurveType; + connectNulls?: boolean; +} +declare const SparkLineChart: React.ForwardRefExoticComponent>; +export default SparkLineChart; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.js b/dist/components/spark-elements/SparkLineChart/SparkLineChart.js new file mode 100644 index 000000000..c63959998 --- /dev/null +++ b/dist/components/spark-elements/SparkLineChart/SparkLineChart.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import{ResponsiveContainer as a,LineChart as o,YAxis as r,XAxis as n,Line as i}from"recharts";import{BaseColors as m}from"../../../lib/constants.js";import{themeColorRange as l,colorPalette as s}from"../../../lib/theme.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as u}from"../../../lib/utils.js";import{constructCategoryColors as d,getYAxisDomain as p}from"../../chart-elements/common/utils.js";import f from"../../chart-elements/common/NoData.js";const h=t.forwardRef(((h,N)=>{const{data:x=[],categories:y=[],index:g,colors:j=l,animationDuration:k=900,showAnimation:b=!1,curveType:v="linear",connectNulls:D=!1,noDataText:E,autoMinValue:w=!1,minValue:T,maxValue:V,className:A}=h,L=e(h,["data","categories","index","colors","animationDuration","showAnimation","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),M=d(y,j),C=p(w,T,V);return t.createElement("div",Object.assign({ref:N,className:c("w-28 h-12",A)},L),t.createElement(a,{className:"h-full w-full"},(null==x?void 0:x.length)?t.createElement(o,{data:x,margin:{top:1,left:1,right:1,bottom:1}},t.createElement(r,{hide:!0,domain:C}),t.createElement(n,{hide:!0,dataKey:g}),y.map((e=>{var a;return t.createElement(i,{className:c(u(null!==(a=M.get(e))&&void 0!==a?a:m.Gray,s.text).strokeColor),strokeOpacity:1,dot:!1,key:e,name:e,type:v,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:b,animationDuration:k,connectNulls:D})}))):t.createElement(f,{noDataText:E})))}));h.displayName="SparkLineChart";export{h as default}; diff --git a/dist/components/spark-elements/SparkLineChart/index.d.ts b/dist/components/spark-elements/SparkLineChart/index.d.ts new file mode 100644 index 000000000..5e93d8e5c --- /dev/null +++ b/dist/components/spark-elements/SparkLineChart/index.d.ts @@ -0,0 +1,2 @@ +export { default as SparkLineChart } from "./SparkLineChart"; +export type { SparkLineChartProps } from "./SparkLineChart"; diff --git a/dist/components/spark-elements/common/BaseSparkChartProps.d.ts b/dist/components/spark-elements/common/BaseSparkChartProps.d.ts new file mode 100644 index 000000000..3e41dbeab --- /dev/null +++ b/dist/components/spark-elements/common/BaseSparkChartProps.d.ts @@ -0,0 +1,22 @@ +/// +import BaseAnimationTimingProps from "components/chart-elements/common/BaseAnimationTimingProps"; +import { Color } from "../../../lib"; +type FixedProps = { + eventType: "dot" | "category" | "bar" | "slice" | "bubble"; + categoryClicked: string; +}; +type BaseEventProps = FixedProps & { + [key: string]: number | string; +}; +export type EventProps = BaseEventProps | null | undefined; +interface BaseSparkChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { + data: any[]; + categories: string[]; + index: string; + colors?: (Color | string)[]; + noDataText?: string; + autoMinValue?: boolean; + minValue?: number; + maxValue?: number; +} +export default BaseSparkChartProps; diff --git a/dist/components/spark-elements/index.d.ts b/dist/components/spark-elements/index.d.ts new file mode 100644 index 000000000..b81686344 --- /dev/null +++ b/dist/components/spark-elements/index.d.ts @@ -0,0 +1,3 @@ +export * from "./SparkBarChart"; +export * from "./SparkLineChart"; +export * from "./SparkAreaChart"; diff --git a/dist/components/text-elements/Bold/Bold.cjs b/dist/components/text-elements/Bold/Bold.cjs new file mode 100644 index 000000000..c132c49c6 --- /dev/null +++ b/dist/components/text-elements/Bold/Bold.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));const s=a.default.forwardRef(((t,s)=>{const{children:l,className:c}=t,i=e.__rest(t,["children","className"]);return a.default.createElement("b",Object.assign({ref:s,className:r.tremorTwMerge("text-inherit font-bold",c)},i),l)}));s.displayName="Bold",module.exports=s; diff --git a/dist/components/text-elements/Bold/Bold.d.ts b/dist/components/text-elements/Bold/Bold.d.ts new file mode 100644 index 000000000..ff7cdeddb --- /dev/null +++ b/dist/components/text-elements/Bold/Bold.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const Bold: React.ForwardRefExoticComponent & React.RefAttributes>; +export default Bold; diff --git a/dist/components/text-elements/Bold/Bold.js b/dist/components/text-elements/Bold/Bold.js new file mode 100644 index 000000000..d9a20c0e1 --- /dev/null +++ b/dist/components/text-elements/Bold/Bold.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import t from"react";const a=t.forwardRef(((a,o)=>{const{children:s,className:l}=a,m=e(a,["children","className"]);return t.createElement("b",Object.assign({ref:o,className:r("text-inherit font-bold",l)},m),s)}));a.displayName="Bold";export{a as default}; diff --git a/dist/components/text-elements/Bold/index.d.ts b/dist/components/text-elements/Bold/index.d.ts new file mode 100644 index 000000000..3ad208e46 --- /dev/null +++ b/dist/components/text-elements/Bold/index.d.ts @@ -0,0 +1 @@ +export { default as Bold } from "./Bold"; diff --git a/dist/components/text-elements/Callout/Callout.cjs b/dist/components/text-elements/Callout/Callout.cjs new file mode 100644 index 000000000..38c4af015 --- /dev/null +++ b/dist/components/text-elements/Callout/Callout.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r);const d=o.makeClassName("Callout"),m=s.default.forwardRef(((r,l)=>{const{title:m,icon:c,color:i,className:n,children:u}=r,b=e.__rest(r,["title","icon","color","className","children"]),f=c;return s.default.createElement("div",Object.assign({ref:l,className:a.tremorTwMerge(d("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?a.tremorTwMerge(o.getColorClassNames(i,t.colorPalette.background).bgColor,o.getColorClassNames(i,t.colorPalette.darkBorder).borderColor,o.getColorClassNames(i,t.colorPalette.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):a.tremorTwMerge("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),n)},b),s.default.createElement("div",{className:a.tremorTwMerge(d("header"),"flex items-start")},f?s.default.createElement(f,{className:a.tremorTwMerge(d("icon"),"flex-none h-5 w-5 mr-1.5")}):null,s.default.createElement("h4",{className:a.tremorTwMerge(d("title"),"font-semibold")},m)),s.default.createElement("p",{className:a.tremorTwMerge(d("body"),"overflow-y-auto",u?"mt-2":"")},u))}));m.displayName="Callout",module.exports=m; diff --git a/dist/components/text-elements/Callout/Callout.d.ts b/dist/components/text-elements/Callout/Callout.d.ts new file mode 100644 index 000000000..2724d09ed --- /dev/null +++ b/dist/components/text-elements/Callout/Callout.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +import { Color } from "lib"; +export interface CalloutProps extends React.HTMLAttributes { + title: string; + icon?: React.ElementType; + color?: Color; +} +declare const Callout: React.ForwardRefExoticComponent>; +export default Callout; diff --git a/dist/components/text-elements/Callout/Callout.js b/dist/components/text-elements/Callout/Callout.js new file mode 100644 index 000000000..5f0eb6402 --- /dev/null +++ b/dist/components/text-elements/Callout/Callout.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import r from"react";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as l}from"../../../lib/utils.js";const m=l("Callout"),d=r.forwardRef(((l,d)=>{const{title:s,icon:i,color:n,className:c,children:b}=l,f=e(l,["title","icon","color","className","children"]),p=i;return r.createElement("div",Object.assign({ref:d,className:o(m("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",n?o(a(n,t.background).bgColor,a(n,t.darkBorder).borderColor,a(n,t.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):o("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),c)},f),r.createElement("div",{className:o(m("header"),"flex items-start")},p?r.createElement(p,{className:o(m("icon"),"flex-none h-5 w-5 mr-1.5")}):null,r.createElement("h4",{className:o(m("title"),"font-semibold")},s)),r.createElement("p",{className:o(m("body"),"overflow-y-auto",b?"mt-2":"")},b))}));d.displayName="Callout";export{d as default}; diff --git a/dist/components/text-elements/Callout/index.d.ts b/dist/components/text-elements/Callout/index.d.ts new file mode 100644 index 000000000..8880eb860 --- /dev/null +++ b/dist/components/text-elements/Callout/index.d.ts @@ -0,0 +1,2 @@ +export { default as Callout } from "./Callout"; +export type { CalloutProps } from "./Callout"; diff --git a/dist/components/text-elements/Italic/Italic.cjs b/dist/components/text-elements/Italic/Italic.cjs new file mode 100644 index 000000000..f79786bcb --- /dev/null +++ b/dist/components/text-elements/Italic/Italic.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));const i=a.default.forwardRef(((t,i)=>{const{children:s,className:c}=t,l=e.__rest(t,["children","className"]);return a.default.createElement("i",Object.assign({ref:i,className:r.tremorTwMerge("italic text-inherit",c)},l),s)}));i.displayName="Italic",module.exports=i; diff --git a/dist/components/text-elements/Italic/Italic.d.ts b/dist/components/text-elements/Italic/Italic.d.ts new file mode 100644 index 000000000..d28eec613 --- /dev/null +++ b/dist/components/text-elements/Italic/Italic.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +declare const Italic: React.ForwardRefExoticComponent & React.RefAttributes>; +export default Italic; diff --git a/dist/components/text-elements/Italic/Italic.js b/dist/components/text-elements/Italic/Italic.js new file mode 100644 index 000000000..873e2353f --- /dev/null +++ b/dist/components/text-elements/Italic/Italic.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import t from"react";const a=t.forwardRef(((a,i)=>{const{children:s,className:c}=a,l=e(a,["children","className"]);return t.createElement("i",Object.assign({ref:i,className:r("italic text-inherit",c)},l),s)}));a.displayName="Italic";export{a as default}; diff --git a/dist/components/text-elements/Italic/index.d.ts b/dist/components/text-elements/Italic/index.d.ts new file mode 100644 index 000000000..833e33144 --- /dev/null +++ b/dist/components/text-elements/Italic/index.d.ts @@ -0,0 +1 @@ +export { default as Italic } from "./Italic"; diff --git a/dist/components/text-elements/Legend/Legend.cjs b/dist/components/text-elements/Legend/Legend.cjs new file mode 100644 index 000000000..79ccd4a0b --- /dev/null +++ b/dist/components/text-elements/Legend/Legend.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),n=require("../../../assets/ChevronLeftFill.cjs"),a=require("../../../assets/ChevronRightFill.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);const s=o.makeClassName("Legend"),i=({name:e,color:t,onClick:n,activeLegend:a})=>{const u=!!n;return c.default.createElement("li",{className:l.tremorTwMerge(s("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",u?"cursor-pointer":"cursor-default","text-tremor-content",u?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",u?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:r=>{r.stopPropagation(),null==n||n(e,t)}},c.default.createElement("svg",{className:l.tremorTwMerge("flex-none h-2 w-2 mr-1.5",o.getColorClassNames(t,r.colorPalette.text).textColor,a&&a!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},c.default.createElement("circle",{cx:4,cy:4,r:4})),c.default.createElement("p",{className:l.tremorTwMerge("whitespace-nowrap truncate text-tremor-default","text-tremor-content",u?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==e?"opacity-40":"opacity-100",u?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},d=({icon:e,onClick:r,disabled:o})=>{const n=e,[a,u]=c.default.useState(!1),i=c.default.useRef(null);return c.default.useEffect((()=>(a?i.current=setInterval((()=>{null==r||r()}),300):clearInterval(i.current),()=>clearInterval(i.current))),[a,r]),t.useEffect((()=>{o&&(clearInterval(i.current),u(!1))}),[o]),c.default.createElement("button",{type:"button",className:l.tremorTwMerge(s("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==r||r()},onMouseDown:e=>{e.stopPropagation(),u(!0)},onMouseUp:e=>{e.stopPropagation(),u(!1)}},c.default.createElement(n,{className:"w-full"}))},m=c.default.forwardRef(((o,u)=>{var m,f;const{categories:g,colors:v=r.themeColorRange,className:p,onClickLegendItem:k,activeLegend:b,enableLegendSlider:h=!1}=o,w=e.__rest(o,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=c.default.useRef(null),[E,L]=c.default.useState(null),[y,C]=c.default.useState(null),N=c.default.useRef(null),M=t.useCallback((()=>{const e=null==x?void 0:x.current;if(!e)return;const t=e.scrollLeft>0,r=e.scrollWidth-e.clientWidth>e.scrollLeft;L({left:t,right:r})}),[L]),T=t.useCallback((e=>{var t;const r=null==x?void 0:x.current,l=null!==(t=null==r?void 0:r.clientWidth)&&void 0!==t?t:0;r&&h&&(r.scrollTo({left:"left"===e?r.scrollLeft-l:r.scrollLeft+l,behavior:"smooth"}),setTimeout((()=>{M()}),400))}),[h,M]);c.default.useEffect((()=>{const e=e=>{"ArrowLeft"===e?T("left"):"ArrowRight"===e&&T("right")};return y?(e(y),N.current=setInterval((()=>{e(y)}),300)):clearInterval(N.current),()=>clearInterval(N.current)}),[y,T]);const I=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),C(e.key))},j=e=>{e.stopPropagation(),C(null)};return c.default.useEffect((()=>{const e=null==x?void 0:x.current;return h&&(M(),null==e||e.addEventListener("keydown",I),null==e||e.addEventListener("keyup",j)),()=>{null==e||e.removeEventListener("keydown",I),null==e||e.removeEventListener("keyup",j)}}),[M,h]),c.default.createElement("ol",Object.assign({ref:u,className:l.tremorTwMerge(s("root"),"relative overflow-hidden",p)},w),c.default.createElement("div",{ref:x,tabIndex:0,className:l.tremorTwMerge("h-full flex",h?(null==E?void 0:E.right)||(null==E?void 0:E.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},g.map(((e,t)=>c.default.createElement(i,{key:`item-${t}`,name:e,color:v[t],onClick:k,activeLegend:b})))),h&&((null==E?void 0:E.right)||(null==E?void 0:E.left))?c.default.createElement(c.default.Fragment,null,c.default.createElement("div",{className:l.tremorTwMerge("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),c.default.createElement("div",{className:l.tremorTwMerge("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),c.default.createElement("div",{className:l.tremorTwMerge("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},c.default.createElement(d,{icon:n,onClick:()=>{C(null),T("left")},disabled:null===(m=!(null==E?void 0:E.left))||void 0===m||m}),c.default.createElement(d,{icon:a,onClick:()=>{C(null),T("right")},disabled:null===(f=!(null==E?void 0:E.right))||void 0===f||f}))):null)}));m.displayName="Legend",module.exports=m; diff --git a/dist/components/text-elements/Legend/Legend.d.ts b/dist/components/text-elements/Legend/Legend.d.ts new file mode 100644 index 000000000..ba90e50fc --- /dev/null +++ b/dist/components/text-elements/Legend/Legend.d.ts @@ -0,0 +1,22 @@ +import React from "react"; +import { Color } from "lib"; +export interface LegendItemProps { + name: string; + color: Color | string; + onClick?: (name: string, color: Color | string) => void; + activeLegend?: string; +} +export interface ScrollButtonProps { + icon: React.ElementType; + onClick?: () => void; + disabled?: boolean; +} +export interface LegendProps extends React.OlHTMLAttributes { + categories: string[]; + colors?: (Color | string)[]; + onClickLegendItem?: (category: string, color: Color | string) => void; + activeLegend?: string; + enableLegendSlider?: boolean; +} +declare const Legend: React.ForwardRefExoticComponent>; +export default Legend; diff --git a/dist/components/text-elements/Legend/Legend.js b/dist/components/text-elements/Legend/Legend.js new file mode 100644 index 000000000..52999c0df --- /dev/null +++ b/dist/components/text-elements/Legend/Legend.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t,{useCallback as r,useEffect as o}from"react";import{colorPalette as n,themeColorRange as l}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as c,getColorClassNames as s}from"../../../lib/utils.js";import i from"../../../assets/ChevronLeftFill.js";import u from"../../../assets/ChevronRightFill.js";const d=c("Legend"),m=({name:e,color:r,onClick:o,activeLegend:l})=>{const c=!!o;return t.createElement("li",{className:a(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:t=>{t.stopPropagation(),null==o||o(e,r)}},t.createElement("svg",{className:a("flex-none h-2 w-2 mr-1.5",s(r,n.text).textColor,l&&l!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},t.createElement("circle",{cx:4,cy:4,r:4})),t.createElement("p",{className:a("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",l&&l!==e?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},p=({icon:e,onClick:r,disabled:n})=>{const l=e,[c,s]=t.useState(!1),i=t.useRef(null);return t.useEffect((()=>(c?i.current=setInterval((()=>{null==r||r()}),300):clearInterval(i.current),()=>clearInterval(i.current))),[c,r]),o((()=>{n&&(clearInterval(i.current),s(!1))}),[n]),t.createElement("button",{type:"button",className:a(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",n?"cursor-not-allowed":"cursor-pointer",n?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",n?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:n,onClick:e=>{e.stopPropagation(),null==r||r()},onMouseDown:e=>{e.stopPropagation(),s(!0)},onMouseUp:e=>{e.stopPropagation(),s(!1)}},t.createElement(l,{className:"w-full"}))},g=t.forwardRef(((o,n)=>{var c,s;const{categories:g,colors:f=l,className:v,onClickLegendItem:k,activeLegend:b,enableLegendSlider:h=!1}=o,x=e(o,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),w=t.useRef(null),[E,L]=t.useState(null),[y,C]=t.useState(null),N=t.useRef(null),I=r((()=>{const e=null==w?void 0:w.current;if(!e)return;const t=e.scrollLeft>0,r=e.scrollWidth-e.clientWidth>e.scrollLeft;L({left:t,right:r})}),[L]),j=r((e=>{var t;const r=null==w?void 0:w.current,o=null!==(t=null==r?void 0:r.clientWidth)&&void 0!==t?t:0;r&&h&&(r.scrollTo({left:"left"===e?r.scrollLeft-o:r.scrollLeft+o,behavior:"smooth"}),setTimeout((()=>{I()}),400))}),[h,I]);t.useEffect((()=>{const e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return y?(e(y),N.current=setInterval((()=>{e(y)}),300)):clearInterval(N.current),()=>clearInterval(N.current)}),[y,j]);const R=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),C(e.key))},P=e=>{e.stopPropagation(),C(null)};return t.useEffect((()=>{const e=null==w?void 0:w.current;return h&&(I(),null==e||e.addEventListener("keydown",R),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",R),null==e||e.removeEventListener("keyup",P)}}),[I,h]),t.createElement("ol",Object.assign({ref:n,className:a(d("root"),"relative overflow-hidden",v)},x),t.createElement("div",{ref:w,tabIndex:0,className:a("h-full flex",h?(null==E?void 0:E.right)||(null==E?void 0:E.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},g.map(((e,r)=>t.createElement(m,{key:`item-${r}`,name:e,color:f[r],onClick:k,activeLegend:b})))),h&&((null==E?void 0:E.right)||(null==E?void 0:E.left))?t.createElement(t.Fragment,null,t.createElement("div",{className:a("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),t.createElement("div",{className:a("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),t.createElement("div",{className:a("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},t.createElement(p,{icon:i,onClick:()=>{C(null),j("left")},disabled:null===(c=!(null==E?void 0:E.left))||void 0===c||c}),t.createElement(p,{icon:u,onClick:()=>{C(null),j("right")},disabled:null===(s=!(null==E?void 0:E.right))||void 0===s||s}))):null)}));g.displayName="Legend";export{g as default}; diff --git a/dist/components/text-elements/Legend/index.d.ts b/dist/components/text-elements/Legend/index.d.ts new file mode 100644 index 000000000..3a8906ef1 --- /dev/null +++ b/dist/components/text-elements/Legend/index.d.ts @@ -0,0 +1,2 @@ +export { default as Legend } from "./Legend"; +export type { LegendProps } from "./Legend"; diff --git a/dist/components/text-elements/Metric/Metric.cjs b/dist/components/text-elements/Metric/Metric.cjs new file mode 100644 index 000000000..0714b5038 --- /dev/null +++ b/dist/components/text-elements/Metric/Metric.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("react"));const a=l.default.forwardRef(((s,a)=>{const{color:c,children:i,className:n}=s,m=e.__rest(s,["color","children","className"]);return l.default.createElement("p",Object.assign({ref:a,className:t.tremorTwMerge("font-semibold text-tremor-metric",c?o.getColorClassNames(c,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",n)},m),i)}));a.displayName="Metric",module.exports=a; diff --git a/dist/components/text-elements/Metric/Metric.d.ts b/dist/components/text-elements/Metric/Metric.d.ts new file mode 100644 index 000000000..e5bc8beb3 --- /dev/null +++ b/dist/components/text-elements/Metric/Metric.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +import { Color } from "../../../lib"; +export interface MetricProps extends React.HTMLAttributes { + color?: Color; +} +declare const Metric: React.ForwardRefExoticComponent>; +export default Metric; diff --git a/dist/components/text-elements/Metric/Metric.js b/dist/components/text-elements/Metric/Metric.js new file mode 100644 index 000000000..e9abc3b45 --- /dev/null +++ b/dist/components/text-elements/Metric/Metric.js @@ -0,0 +1 @@ +import{__rest as r}from"tslib";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,a)=>{const{color:i,children:l,className:c}=s,n=r(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:a,className:e("font-semibold text-tremor-metric",i?o(i,t.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},n),l)}));s.displayName="Metric";export{s as default}; diff --git a/dist/components/text-elements/Metric/index.d.ts b/dist/components/text-elements/Metric/index.d.ts new file mode 100644 index 000000000..8637311c2 --- /dev/null +++ b/dist/components/text-elements/Metric/index.d.ts @@ -0,0 +1,2 @@ +export { default as Metric } from "./Metric"; +export type { MetricProps } from "./Metric"; diff --git a/dist/components/text-elements/Subtitle/Subtitle.cjs b/dist/components/text-elements/Subtitle/Subtitle.cjs new file mode 100644 index 000000000..fd0437570 --- /dev/null +++ b/dist/components/text-elements/Subtitle/Subtitle.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(require("react"));const o=a.default.forwardRef(((l,o)=>{const{color:c,children:i,className:u}=l,n=e.__rest(l,["color","children","className"]);return a.default.createElement("p",Object.assign({ref:o,className:t.tremorTwMerge(c?s.getColorClassNames(c,r.colorPalette.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",u)},n),i)}));o.displayName="Subtitle",module.exports=o; diff --git a/dist/components/text-elements/Subtitle/Subtitle.d.ts b/dist/components/text-elements/Subtitle/Subtitle.d.ts new file mode 100644 index 000000000..aab8d06fa --- /dev/null +++ b/dist/components/text-elements/Subtitle/Subtitle.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +import { Color } from "../../../lib"; +export interface SubtitleProps extends React.HTMLAttributes { + color?: Color; +} +declare const Subtitle: React.ForwardRefExoticComponent>; +export default Subtitle; diff --git a/dist/components/text-elements/Subtitle/Subtitle.js b/dist/components/text-elements/Subtitle/Subtitle.js new file mode 100644 index 000000000..d77ac5672 --- /dev/null +++ b/dist/components/text-elements/Subtitle/Subtitle.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import{colorPalette as e}from"../../../lib/theme.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,a)=>{const{color:i,children:l,className:c}=s,n=t(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:a,className:r(i?o(i,e.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},n),l)}));s.displayName="Subtitle";export{s as default}; diff --git a/dist/components/text-elements/Subtitle/index.d.ts b/dist/components/text-elements/Subtitle/index.d.ts new file mode 100644 index 000000000..f345945e8 --- /dev/null +++ b/dist/components/text-elements/Subtitle/index.d.ts @@ -0,0 +1,2 @@ +export { default as Subtitle } from "./Subtitle"; +export type { SubtitleProps } from "./Subtitle"; diff --git a/dist/components/text-elements/Text/Text.cjs b/dist/components/text-elements/Text/Text.cjs new file mode 100644 index 000000000..84e31d231 --- /dev/null +++ b/dist/components/text-elements/Text/Text.cjs @@ -0,0 +1 @@ +"use strict";var e=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(require("react"));const l=a.default.forwardRef(((o,l)=>{const{color:c,className:s,children:u}=o;return a.default.createElement("p",{ref:l,className:t.tremorTwMerge("text-tremor-default",c?r.getColorClassNames(c,e.colorPalette.text).textColor:t.tremorTwMerge("text-tremor-content","dark:text-dark-tremor-content"),s)},u)}));l.displayName="Text",module.exports=l; diff --git a/dist/components/text-elements/Text/Text.d.ts b/dist/components/text-elements/Text/Text.d.ts new file mode 100644 index 000000000..9499898aa --- /dev/null +++ b/dist/components/text-elements/Text/Text.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +import { Color } from "../../../lib/inputTypes"; +export interface TextProps extends React.HTMLAttributes { + color?: Color; +} +declare const Text: React.ForwardRefExoticComponent>; +export default Text; diff --git a/dist/components/text-elements/Text/Text.js b/dist/components/text-elements/Text/Text.js new file mode 100644 index 000000000..8f81dab0b --- /dev/null +++ b/dist/components/text-elements/Text/Text.js @@ -0,0 +1 @@ +import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as r}from"../../../lib/utils.js";import o from"react";const m=o.forwardRef(((m,a)=>{const{color:l,className:s,children:c}=m;return o.createElement("p",{ref:a,className:e("text-tremor-default",l?r(l,t.text).textColor:e("text-tremor-content","dark:text-dark-tremor-content"),s)},c)}));m.displayName="Text";export{m as default}; diff --git a/dist/components/text-elements/Text/index.d.ts b/dist/components/text-elements/Text/index.d.ts new file mode 100644 index 000000000..bd1f8e517 --- /dev/null +++ b/dist/components/text-elements/Text/index.d.ts @@ -0,0 +1,2 @@ +export { default as Text } from "./Text"; +export type { TextProps } from "./Text"; diff --git a/dist/components/text-elements/Title/Title.cjs b/dist/components/text-elements/Title/Title.cjs new file mode 100644 index 000000000..b2fc7b56a --- /dev/null +++ b/dist/components/text-elements/Title/Title.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("../../../lib/theme.cjs"),r=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(require("react"));const a=s.default.forwardRef(((l,a)=>{const{color:c,children:i,className:n}=l,u=e.__rest(l,["color","children","className"]);return s.default.createElement("p",Object.assign({ref:a,className:r.tremorTwMerge("font-medium text-tremor-title",c?o.getColorClassNames(c,t.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",n)},u),i)}));a.displayName="Title",module.exports=a; diff --git a/dist/components/text-elements/Title/Title.d.ts b/dist/components/text-elements/Title/Title.d.ts new file mode 100644 index 000000000..1dc669769 --- /dev/null +++ b/dist/components/text-elements/Title/Title.d.ts @@ -0,0 +1,7 @@ +import React from "react"; +import { Color } from "../../../lib"; +export interface TitleProps extends React.HTMLAttributes { + color?: Color; +} +declare const Title: React.ForwardRefExoticComponent>; +export default Title; diff --git a/dist/components/text-elements/Title/Title.js b/dist/components/text-elements/Title/Title.js new file mode 100644 index 000000000..b21076e02 --- /dev/null +++ b/dist/components/text-elements/Title/Title.js @@ -0,0 +1 @@ +import{__rest as t}from"tslib";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,l)=>{const{color:a,children:i,className:c}=s,n=t(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:l,className:e("font-medium text-tremor-title",a?o(a,r.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},n),i)}));s.displayName="Title";export{s as default}; diff --git a/dist/components/text-elements/Title/index.d.ts b/dist/components/text-elements/Title/index.d.ts new file mode 100644 index 000000000..b9308cc23 --- /dev/null +++ b/dist/components/text-elements/Title/index.d.ts @@ -0,0 +1,2 @@ +export { default as Title } from "./Title"; +export type { TitleProps } from "./Title"; diff --git a/dist/components/text-elements/index.d.ts b/dist/components/text-elements/index.d.ts new file mode 100644 index 000000000..fdfc25228 --- /dev/null +++ b/dist/components/text-elements/index.d.ts @@ -0,0 +1,8 @@ +export * from "./Bold"; +export * from "./Callout"; +export * from "./Italic"; +export * from "./Legend"; +export * from "./Metric"; +export * from "./Subtitle"; +export * from "./Text"; +export * from "./Title"; diff --git a/dist/components/util-elements/Tooltip/Tooltip.cjs b/dist/components/util-elements/Tooltip/Tooltip.cjs new file mode 100644 index 000000000..5e072b5c8 --- /dev/null +++ b/dist/components/util-elements/Tooltip/Tooltip.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@floating-ui/react"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(o);const a=({text:e,open:o,x:r,y:a,refs:i,strategy:l,getFloatingProps:n})=>o&&e?s.default.createElement("div",Object.assign({className:t.tremorTwMerge("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1 whitespace-nowrap","text-white bg-tremor-background-emphasis","text-white dark:bg-dark-tremor-background-subtle"),ref:i.setFloating,style:{position:l,top:null!=a?a:0,left:null!=r?r:0}},n()),e):null;a.displayName="Tooltip",exports.default=a,exports.useTooltip=t=>{const[r,s]=o.useState(!1),[a,i]=o.useState(),{x:l,y:n,refs:u,strategy:p,context:c}=e.useFloating({open:r,onOpenChange:e=>{if(e&&t){const o=setTimeout((()=>{s(e)}),t);i(o)}else clearTimeout(a),s(e)},placement:"top",whileElementsMounted:e.autoUpdate,middleware:[e.offset(5),e.flip({fallbackAxisSideDirection:"start"}),e.shift()]}),f=e.useHover(c,{move:!1}),g=e.useFocus(c),d=e.useDismiss(c),m=e.useRole(c,{role:"tooltip"}),{getReferenceProps:x,getFloatingProps:y}=e.useInteractions([f,g,d,m]);return{tooltipProps:{open:r,x:l,y:n,refs:u,strategy:p,getFloatingProps:y},getReferenceProps:x}}; diff --git a/dist/components/util-elements/Tooltip/Tooltip.d.ts b/dist/components/util-elements/Tooltip/Tooltip.d.ts new file mode 100644 index 000000000..520f1e676 --- /dev/null +++ b/dist/components/util-elements/Tooltip/Tooltip.d.ts @@ -0,0 +1,27 @@ +import { ExtendedRefs, ReferenceType, Strategy } from "@floating-ui/react"; +import React from "react"; +export declare const useTooltip: (delay?: number) => { + tooltipProps: { + open: boolean; + x: number | null; + y: number | null; + refs: ExtendedRefs; + strategy: Strategy; + getFloatingProps: (userProps?: React.HTMLProps | undefined) => Record; + }; + getReferenceProps: (userProps?: React.HTMLProps | undefined) => Record; +}; +export interface TooltipProps { + text?: string; + open: boolean; + x: number | null; + y: number | null; + refs: ExtendedRefs; + strategy: Strategy; + getFloatingProps: (userProps?: React.HTMLProps | undefined) => Record; +} +declare const Tooltip: { + ({ text, open, x, y, refs, strategy, getFloatingProps }: TooltipProps): React.JSX.Element | null; + displayName: string; +}; +export default Tooltip; diff --git a/dist/components/util-elements/Tooltip/Tooltip.js b/dist/components/util-elements/Tooltip/Tooltip.js new file mode 100644 index 000000000..66a0e2f3e --- /dev/null +++ b/dist/components/util-elements/Tooltip/Tooltip.js @@ -0,0 +1 @@ +import{useFloating as e,autoUpdate as t,offset as o,flip as r,shift as s,useHover as a,useFocus as i,useDismiss as l,useRole as n,useInteractions as p}from"@floating-ui/react";import{tremorTwMerge as m}from"../../../lib/tremorTwMerge.js";import g,{useState as c}from"react";const f=m=>{const[g,f]=c(!1),[d,u]=c(),{x:x,y:y,refs:b,strategy:w,context:h}=e({open:g,onOpenChange:e=>{if(e&&m){const t=setTimeout((()=>{f(e)}),m);u(t)}else clearTimeout(d),f(e)},placement:"top",whileElementsMounted:t,middleware:[o(5),r({fallbackAxisSideDirection:"start"}),s()]}),P=a(h,{move:!1}),k=i(h),F=l(h),T=n(h,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:v}=p([P,k,F,T]);return{tooltipProps:{open:g,x:x,y:y,refs:b,strategy:w,getFloatingProps:v},getReferenceProps:j}},d=({text:e,open:t,x:o,y:r,refs:s,strategy:a,getFloatingProps:i})=>t&&e?g.createElement("div",Object.assign({className:m("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1 whitespace-nowrap","text-white bg-tremor-background-emphasis","text-white dark:bg-dark-tremor-background-subtle"),ref:s.setFloating,style:{position:a,top:null!=r?r:0,left:null!=o?o:0}},i()),e):null;d.displayName="Tooltip";export{d as default,f as useTooltip}; diff --git a/dist/components/util-elements/Tooltip/index.d.ts b/dist/components/util-elements/Tooltip/index.d.ts new file mode 100644 index 000000000..72248a58c --- /dev/null +++ b/dist/components/util-elements/Tooltip/index.d.ts @@ -0,0 +1,2 @@ +export { default as Tooltip } from "./Tooltip"; +export type { TooltipProps } from "./Tooltip"; diff --git a/dist/components/util-elements/index.d.ts b/dist/components/util-elements/index.d.ts new file mode 100644 index 000000000..46bb2f247 --- /dev/null +++ b/dist/components/util-elements/index.d.ts @@ -0,0 +1 @@ +export * from "./Tooltip"; diff --git a/dist/components/vis-elements/BarList/BarList.cjs b/dist/components/vis-elements/BarList/BarList.cjs new file mode 100644 index 000000000..b9a7d8f4a --- /dev/null +++ b/dist/components/vis-elements/BarList/BarList.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);const m=l.makeClassName("BarList");function s(t,n){const{data:s=[],color:c,valueFormatter:i=l.defaultValueFormatter,showAnimation:u=!1,onValueChange:d,className:f}=t,b=e.__rest(t,["data","color","valueFormatter","showAnimation","onValueChange","className"]),p=(e=>{let t=-1/0;return e.forEach((e=>{t=Math.max(t,e)})),e.map((e=>0===e?0:Math.max(e/t*100,1)))})(s.map((e=>e.value)));return o.default.createElement("div",Object.assign({ref:n,className:a.tremorTwMerge(m("root"),"flex justify-between space-x-6",f)},b),o.default.createElement("div",{className:a.tremorTwMerge(m("bars"),"relative w-full")},s.map(((e,t)=>{var n,i,f;const b=e.icon;return o.default.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:a.tremorTwMerge(m("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||c?l.getColorClassNames(null!==(i=e.color)&&void 0!==i?i:c,r.colorPalette.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===s.length-1?"mb-0":"mb-2"),style:{width:`${p[t]}%`,transition:u?"all 1s":""}},o.default.createElement("div",{className:a.tremorTwMerge("absolute max-w-full flex left-2",d?"cursor-pointer":""),onClick:()=>{null==d||d(e)}},b?o.default.createElement(b,{className:a.tremorTwMerge(m("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.default.createElement("a",{href:e.href,target:null!==(f=e.target)&&void 0!==f?f:"_blank",rel:"noreferrer",className:a.tremorTwMerge(m("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",d?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==d||d(e)}},e.name):o.default.createElement("p",{className:a.tremorTwMerge(m("barText"),"whitespace-nowrap truncate text-tremor-default",d?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==d||d(e)}},e.name)))}))),o.default.createElement("div",{className:"text-right min-w-min"},s.map(((e,t)=>{var r;return o.default.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:a.tremorTwMerge(m("labelWrapper"),"flex justify-end items-center","h-9",t===s.length-1?"mb-0":"mb-2")},o.default.createElement("p",{className:a.tremorTwMerge(m("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},i(e.value)))}))))}s.displayName="BarList";const c=o.default.forwardRef(s);module.exports=c; diff --git a/dist/components/vis-elements/BarList/BarList.d.ts b/dist/components/vis-elements/BarList/BarList.d.ts new file mode 100644 index 000000000..fa5004301 --- /dev/null +++ b/dist/components/vis-elements/BarList/BarList.d.ts @@ -0,0 +1,26 @@ +import React from "react"; +import { Color, ValueFormatter } from "lib"; +type Bar = T & { + key?: string; + value: number; + name: string; + icon?: React.JSXElementConstructor; + href?: string; + target?: string; + color?: Color; +}; +export interface BarListProps extends React.HTMLAttributes { + data: Bar[]; + valueFormatter?: ValueFormatter; + color?: Color; + showAnimation?: boolean; + onValueChange?: (payload: Bar) => void; +} +declare function BarListInner(props: BarListProps, ref: React.ForwardedRef): React.JSX.Element; +declare namespace BarListInner { + var displayName: string; +} +declare const BarList: (p: BarListProps & { + ref?: React.ForwardedRef | undefined; +}) => ReturnType; +export default BarList; diff --git a/dist/components/vis-elements/BarList/BarList.js b/dist/components/vis-elements/BarList/BarList.js new file mode 100644 index 000000000..8a2d3186f --- /dev/null +++ b/dist/components/vis-elements/BarList/BarList.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import t from"react";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as l,defaultValueFormatter as o}from"../../../lib/utils.js";const m=l("BarList");function s(l,s){const{data:c=[],color:i,valueFormatter:u=o,showAnimation:d=!1,onValueChange:p,className:b}=l,f=e(l,["data","color","valueFormatter","showAnimation","onValueChange","className"]),h=(e=>{let t=-1/0;return e.forEach((e=>{t=Math.max(t,e)})),e.map((e=>0===e?0:Math.max(e/t*100,1)))})(c.map((e=>e.value)));return t.createElement("div",Object.assign({ref:s,className:a(m("root"),"flex justify-between space-x-6",b)},f),t.createElement("div",{className:a(m("bars"),"relative w-full")},c.map(((e,l)=>{var o,s,u;const b=e.icon;return t.createElement("div",{key:null!==(o=e.key)&&void 0!==o?o:e.name,className:a(m("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||i?n(null!==(s=e.color)&&void 0!==s?s:i,r.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",l===c.length-1?"mb-0":"mb-2"),style:{width:`${h[l]}%`,transition:d?"all 1s":""}},t.createElement("div",{className:a("absolute max-w-full flex left-2",p?"cursor-pointer":""),onClick:()=>{null==p||p(e)}},b?t.createElement(b,{className:a(m("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?t.createElement("a",{href:e.href,target:null!==(u=e.target)&&void 0!==u?u:"_blank",rel:"noreferrer",className:a(m("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",p?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==p||p(e)}},e.name):t.createElement("p",{className:a(m("barText"),"whitespace-nowrap truncate text-tremor-default",p?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==p||p(e)}},e.name)))}))),t.createElement("div",{className:"text-right min-w-min"},c.map(((e,r)=>{var n;return t.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:a(m("labelWrapper"),"flex justify-end items-center","h-9",r===c.length-1?"mb-0":"mb-2")},t.createElement("p",{className:a(m("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))}))))}s.displayName="BarList";const c=t.forwardRef(s);export{c as default}; diff --git a/dist/components/vis-elements/BarList/index.d.ts b/dist/components/vis-elements/BarList/index.d.ts new file mode 100644 index 000000000..ad0bc6366 --- /dev/null +++ b/dist/components/vis-elements/BarList/index.d.ts @@ -0,0 +1,2 @@ +export { default as BarList } from "./BarList"; +export type { BarListProps } from "./BarList"; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.cjs b/dist/components/vis-elements/CategoryBar/CategoryBar.cjs new file mode 100644 index 000000000..03e46b86d --- /dev/null +++ b/dist/components/vis-elements/CategoryBar/CategoryBar.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),t=require("react"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),l=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(t);const m=o.makeClassName("CategoryBar"),i=({values:e})=>{const t=o.sumNumericArray(e);let r=0,l=0;return n.default.createElement("div",{className:a.tremorTwMerge(m("labels"),"relative flex w-full text-tremor-default h-5 mb-2","text-tremor-content","dark:text-dark-tremor-content")},e.slice(0,e.length).map(((e,o)=>{r+=e;const s=(e>=.1*t||l>=.09*t)&&t-r>=.15*t&&r>=.1*t;return l=s?0:l+=e,n.default.createElement("div",{key:`item-${o}`,className:"flex items-center justify-end",style:{width:`${e}%`}},n.default.createElement("span",{className:a.tremorTwMerge(s?"block":"hidden","left-1/2 translate-x-1/2")},r))})),n.default.createElement("div",{className:a.tremorTwMerge("absolute bottom-0 flex items-center left-0")},"0"),n.default.createElement("div",{className:a.tremorTwMerge("absolute bottom-0 flex items-center right-0")},t))},u=n.default.forwardRef(((t,s)=>{const{values:u=[],colors:c=l.themeColorRange,markerValue:d,showLabels:f=!0,tooltip:g,showAnimation:b=!1,className:v}=t,w=e.__rest(t,["values","colors","markerValue","showLabels","tooltip","showAnimation","className"]),h=((e,t,r)=>{if(void 0===e)return"";let a=0;for(let s=0;s=e)return m}return""})(d,u,c),{tooltipProps:p,getReferenceProps:N}=r.useTooltip();return n.default.createElement(n.default.Fragment,null,n.default.createElement(r.default,Object.assign({text:g},p)),n.default.createElement("div",Object.assign({ref:s,className:a.tremorTwMerge(m("root"),v)},w),f?n.default.createElement(i,{values:u}):null,n.default.createElement("div",{className:a.tremorTwMerge(m("barWrapper"),"relative w-full flex items-center h-2")},n.default.createElement("div",{className:a.tremorTwMerge("flex-1 flex items-center h-full overflow-hidden rounded-tremor-full")},u.map(((e,t)=>{var r;const s=null!==(r=c[t])&&void 0!==r?r:"gray";return n.default.createElement("div",{key:`item-${t}`,className:a.tremorTwMerge(m("categoryBar"),"h-full",o.getColorClassNames(s,l.colorPalette.background).bgColor),style:{width:`${e}%`}})}))),void 0!==d?n.default.createElement("div",Object.assign({ref:p.refs.setReference,className:a.tremorTwMerge(m("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${d}%`,transition:b?"all 1s":""}},N),n.default.createElement("div",{className:a.tremorTwMerge(m("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",h)})):null)))}));u.displayName="CategoryBar",module.exports=u; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts b/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts new file mode 100644 index 000000000..ebd4c3d1e --- /dev/null +++ b/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts @@ -0,0 +1,12 @@ +import React from "react"; +import { Color } from "../../../lib"; +export interface CategoryBarProps extends React.HTMLAttributes { + values: number[]; + colors?: Color[]; + markerValue?: number; + showLabels?: boolean; + tooltip?: string; + showAnimation?: boolean; +} +declare const CategoryBar: React.ForwardRefExoticComponent>; +export default CategoryBar; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.js b/dist/components/vis-elements/CategoryBar/CategoryBar.js new file mode 100644 index 000000000..d28107f48 --- /dev/null +++ b/dist/components/vis-elements/CategoryBar/CategoryBar.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import t from"react";import r,{useTooltip as l}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as a,themeColorRange as s}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as m,sumNumericArray as i}from"../../../lib/utils.js";const c=m("CategoryBar"),d=({values:e})=>{const r=i(e);let l=0,a=0;return t.createElement("div",{className:o(c("labels"),"relative flex w-full text-tremor-default h-5 mb-2","text-tremor-content","dark:text-dark-tremor-content")},e.slice(0,e.length).map(((e,s)=>{l+=e;const n=(e>=.1*r||a>=.09*r)&&r-l>=.15*r&&l>=.1*r;return a=n?0:a+=e,t.createElement("div",{key:`item-${s}`,className:"flex items-center justify-end",style:{width:`${e}%`}},t.createElement("span",{className:o(n?"block":"hidden","left-1/2 translate-x-1/2")},l))})),t.createElement("div",{className:o("absolute bottom-0 flex items-center left-0")},"0"),t.createElement("div",{className:o("absolute bottom-0 flex items-center right-0")},r))},f=t.forwardRef(((m,i)=>{const{values:f=[],colors:u=s,markerValue:b,showLabels:v=!0,tooltip:p,showAnimation:g=!1,className:h}=m,x=e(m,["values","colors","markerValue","showLabels","tooltip","showAnimation","className"]),E=((e,t,r)=>{if(void 0===e)return"";let l=0;for(let s=0;s=e)return m}return""})(b,f,u),{tooltipProps:N,getReferenceProps:k}=l();return t.createElement(t.Fragment,null,t.createElement(r,Object.assign({text:p},N)),t.createElement("div",Object.assign({ref:i,className:o(c("root"),h)},x),v?t.createElement(d,{values:f}):null,t.createElement("div",{className:o(c("barWrapper"),"relative w-full flex items-center h-2")},t.createElement("div",{className:o("flex-1 flex items-center h-full overflow-hidden rounded-tremor-full")},f.map(((e,r)=>{var l;const s=null!==(l=u[r])&&void 0!==l?l:"gray";return t.createElement("div",{key:`item-${r}`,className:o(c("categoryBar"),"h-full",n(s,a.background).bgColor),style:{width:`${e}%`}})}))),void 0!==b?t.createElement("div",Object.assign({ref:N.refs.setReference,className:o(c("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${b}%`,transition:g?"all 1s":""}},k),t.createElement("div",{className:o(c("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",E)})):null)))}));f.displayName="CategoryBar";export{f as default}; diff --git a/dist/components/vis-elements/CategoryBar/index.d.ts b/dist/components/vis-elements/CategoryBar/index.d.ts new file mode 100644 index 000000000..fcfb2a7a7 --- /dev/null +++ b/dist/components/vis-elements/CategoryBar/index.d.ts @@ -0,0 +1,2 @@ +export { default as CategoryBar } from "./CategoryBar"; +export type { CategoryBarProps } from "./CategoryBar"; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.cjs b/dist/components/vis-elements/DeltaBar/DeltaBar.cjs new file mode 100644 index 000000000..854583d3f --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/DeltaBar.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/constants.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),o=require("./styles.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(r);const u=s.makeClassName("DeltaBar"),d=n.default.forwardRef(((r,i)=>{const{value:d,isIncreasePositive:c=!0,showAnimation:m=!1,className:f,tooltip:g}=r,b=e.__rest(r,["value","isIncreasePositive","showAnimation","className","tooltip"]),p=s.mapInputsToDeltaType((e=>e>=0?a.DeltaTypes.Increase:a.DeltaTypes.Decrease)(d),c),{tooltipProps:v,getReferenceProps:w}=t.useTooltip();return n.default.createElement(n.default.Fragment,null,n.default.createElement(t.default,Object.assign({text:g},v)),n.default.createElement("div",Object.assign({ref:i,className:l.tremorTwMerge(u("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",f)},b),n.default.createElement("div",{className:"flex justify-end h-full w-1/2"},d<0?n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(u("negativeDeltaBar"),"rounded-l-tremor-full",o.colors[p].bgColor),style:{width:`${Math.abs(d)}%`,transition:m?"all 1s":""}},w)):null),n.default.createElement("div",{className:l.tremorTwMerge(u("separator"),"ring-2 z-10 rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted bg-tremor-background-emphasis","dark:ring-dark-tremor-brand-inverted dark:bg-dark-tremor-background-emphasis")}),n.default.createElement("div",{className:l.tremorTwMerge(u("positiveDeltaBarWrapper"),"flex justify-start h-full w-1/2")},d>=0?n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(u("positiveDeltaBar"),"rounded-r-tremor-full",o.colors[p].bgColor),style:{width:`${Math.abs(d)}%`,transition:m?"all 1s":""}},w)):null)))}));d.displayName="DeltaBar",module.exports=d; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts b/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts new file mode 100644 index 000000000..0d8c8b457 --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts @@ -0,0 +1,9 @@ +import React from "react"; +export interface DeltaBarProps extends React.HTMLAttributes { + value: number; + isIncreasePositive?: boolean; + tooltip?: string; + showAnimation?: boolean; +} +declare const DeltaBar: React.ForwardRefExoticComponent>; +export default DeltaBar; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.js b/dist/components/vis-elements/DeltaBar/DeltaBar.js new file mode 100644 index 000000000..999e824df --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/DeltaBar.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{DeltaTypes as s}from"../../../lib/constants.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{makeClassName as o,mapInputsToDeltaType as i}from"../../../lib/utils.js";import{colors as n}from"./styles.js";const m=o("DeltaBar"),c=r.forwardRef(((o,c)=>{const{value:d,isIncreasePositive:f=!0,showAnimation:u=!1,className:b,tooltip:p}=o,g=e(o,["value","isIncreasePositive","showAnimation","className","tooltip"]),v=i((e=>e>=0?s.Increase:s.Decrease)(d),f),{tooltipProps:h,getReferenceProps:j}=a();return r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:p},h)),r.createElement("div",Object.assign({ref:c,className:l(m("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",b)},g),r.createElement("div",{className:"flex justify-end h-full w-1/2"},d<0?r.createElement("div",Object.assign({ref:h.refs.setReference,className:l(m("negativeDeltaBar"),"rounded-l-tremor-full",n[v].bgColor),style:{width:`${Math.abs(d)}%`,transition:u?"all 1s":""}},j)):null),r.createElement("div",{className:l(m("separator"),"ring-2 z-10 rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted bg-tremor-background-emphasis","dark:ring-dark-tremor-brand-inverted dark:bg-dark-tremor-background-emphasis")}),r.createElement("div",{className:l(m("positiveDeltaBarWrapper"),"flex justify-start h-full w-1/2")},d>=0?r.createElement("div",Object.assign({ref:h.refs.setReference,className:l(m("positiveDeltaBar"),"rounded-r-tremor-full",n[v].bgColor),style:{width:`${Math.abs(d)}%`,transition:u?"all 1s":""}},j)):null)))}));c.displayName="DeltaBar";export{c as default}; diff --git a/dist/components/vis-elements/DeltaBar/index.d.ts b/dist/components/vis-elements/DeltaBar/index.d.ts new file mode 100644 index 000000000..be676dfaa --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/index.d.ts @@ -0,0 +1,2 @@ +export { default as DeltaBar } from "./DeltaBar"; +export type { DeltaBarProps } from "./DeltaBar"; diff --git a/dist/components/vis-elements/DeltaBar/styles.cjs b/dist/components/vis-elements/DeltaBar/styles.cjs new file mode 100644 index 000000000..9f9b76917 --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/styles.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs");const l={[e.DeltaTypes.Increase]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor},[e.DeltaTypes.ModerateIncrease]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor},[e.DeltaTypes.Decrease]:{bgColor:r.getColorClassNames(e.BaseColors.Rose,o.colorPalette.background).bgColor},[e.DeltaTypes.ModerateDecrease]:{bgColor:r.getColorClassNames(e.BaseColors.Rose,o.colorPalette.background).bgColor},[e.DeltaTypes.Unchanged]:{bgColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.background).bgColor}};exports.colors=l; diff --git a/dist/components/vis-elements/DeltaBar/styles.d.ts b/dist/components/vis-elements/DeltaBar/styles.d.ts new file mode 100644 index 000000000..181eb3a7c --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/styles.d.ts @@ -0,0 +1,6 @@ +export type ColorTypes = { + bgColor: string; +}; +export declare const colors: { + [key: string]: ColorTypes; +}; diff --git a/dist/components/vis-elements/DeltaBar/styles.js b/dist/components/vis-elements/DeltaBar/styles.js new file mode 100644 index 000000000..769be43fa --- /dev/null +++ b/dist/components/vis-elements/DeltaBar/styles.js @@ -0,0 +1 @@ +import{DeltaTypes as o,BaseColors as r}from"../../../lib/constants.js";import{colorPalette as e}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as b}from"../../../lib/utils.js";const g={[o.Increase]:{bgColor:b(r.Emerald,e.background).bgColor},[o.ModerateIncrease]:{bgColor:b(r.Emerald,e.background).bgColor},[o.Decrease]:{bgColor:b(r.Rose,e.background).bgColor},[o.ModerateDecrease]:{bgColor:b(r.Rose,e.background).bgColor},[o.Unchanged]:{bgColor:b(r.Orange,e.background).bgColor}};export{g as colors}; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.cjs b/dist/components/vis-elements/MarkerBar/MarkerBar.cjs new file mode 100644 index 000000000..0352b6810 --- /dev/null +++ b/dist/components/vis-elements/MarkerBar/MarkerBar.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(r);const i=o.makeClassName("MarkerBar"),u=n.default.forwardRef(((r,s)=>{const{value:u,minValue:m,maxValue:d,markerTooltip:c,rangeTooltip:f,showAnimation:g=!1,color:b,className:p}=r,k=e.__rest(r,["value","minValue","maxValue","markerTooltip","rangeTooltip","showAnimation","color","className"]),{tooltipProps:v,getReferenceProps:T}=t.useTooltip(),{tooltipProps:w,getReferenceProps:j}=t.useTooltip();return n.default.createElement("div",Object.assign({ref:s,className:l.tremorTwMerge(i("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",p)},k),void 0!==m&&void 0!==d?n.default.createElement(n.default.Fragment,null,n.default.createElement(t.default,Object.assign({text:f},w)),n.default.createElement("div",Object.assign({ref:w.refs.setReference,className:l.tremorTwMerge(i("rangeBar"),"absolute h-full rounded-tremor-full","bg-tremor-content-subtle","dark:bg-dark-tremor-content-subtle"),style:{left:`${m}%`,width:d-m+"%",transition:g?"all 1s":""}},j))):null,n.default.createElement(t.default,Object.assign({text:c},v)),n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(i("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${u}%`,transition:g?"all 1s":""}},T),n.default.createElement("div",{className:l.tremorTwMerge(i("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",b?o.getColorClassNames(b,a.colorPalette.background).bgColor:"dark:bg-dark-tremor-brand bg-tremor-brand")})))}));u.displayName="MarkerBar",module.exports=u; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts b/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts new file mode 100644 index 000000000..4fcd91332 --- /dev/null +++ b/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts @@ -0,0 +1,13 @@ +import React from "react"; +import { Color } from "../../../lib"; +export interface MarkerBarProps extends React.HTMLAttributes { + value: number; + minValue?: number; + maxValue?: number; + markerTooltip?: string; + rangeTooltip?: string; + showAnimation?: boolean; + color?: Color; +} +declare const MarkerBar: React.ForwardRefExoticComponent>; +export default MarkerBar; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.js b/dist/components/vis-elements/MarkerBar/MarkerBar.js new file mode 100644 index 000000000..6cd0bf397 --- /dev/null +++ b/dist/components/vis-elements/MarkerBar/MarkerBar.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as s}from"../../../lib/utils.js";const m=s("MarkerBar"),i=r.forwardRef(((s,i)=>{const{value:c,minValue:d,maxValue:u,markerTooltip:b,rangeTooltip:f,showAnimation:g=!1,color:p,className:k}=s,v=e(s,["value","minValue","maxValue","markerTooltip","rangeTooltip","showAnimation","color","className"]),{tooltipProps:j,getReferenceProps:h}=a(),{tooltipProps:w,getReferenceProps:x}=a();return r.createElement("div",Object.assign({ref:i,className:l(m("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",k)},v),void 0!==d&&void 0!==u?r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:f},w)),r.createElement("div",Object.assign({ref:w.refs.setReference,className:l(m("rangeBar"),"absolute h-full rounded-tremor-full","bg-tremor-content-subtle","dark:bg-dark-tremor-content-subtle"),style:{left:`${d}%`,width:u-d+"%",transition:g?"all 1s":""}},x))):null,r.createElement(t,Object.assign({text:b},j)),r.createElement("div",Object.assign({ref:j.refs.setReference,className:l(m("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${c}%`,transition:g?"all 1s":""}},h),r.createElement("div",{className:l(m("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",p?n(p,o.background).bgColor:"dark:bg-dark-tremor-brand bg-tremor-brand")})))}));i.displayName="MarkerBar";export{i as default}; diff --git a/dist/components/vis-elements/MarkerBar/index.d.ts b/dist/components/vis-elements/MarkerBar/index.d.ts new file mode 100644 index 000000000..f74b2f487 --- /dev/null +++ b/dist/components/vis-elements/MarkerBar/index.d.ts @@ -0,0 +1,2 @@ +export { default as MarkerBar } from "./MarkerBar"; +export type { MarkerBarProps } from "./MarkerBar"; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.cjs b/dist/components/vis-elements/ProgressBar/ProgressBar.cjs new file mode 100644 index 000000000..eb8f2533c --- /dev/null +++ b/dist/components/vis-elements/ProgressBar/ProgressBar.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=s(r);const n=o.makeClassName("ProgressBar"),i=m.default.forwardRef(((r,s)=>{const{value:i,label:c,color:u,tooltip:d,showAnimation:f=!1,className:g}=r,b=e.__rest(r,["value","label","color","tooltip","showAnimation","className"]),{tooltipProps:p,getReferenceProps:w}=t.useTooltip();return m.default.createElement(m.default.Fragment,null,m.default.createElement(t.default,Object.assign({text:d},p)),m.default.createElement("div",Object.assign({ref:s,className:l.tremorTwMerge(n("root"),"flex items-center w-full",g)},b),m.default.createElement("div",Object.assign({ref:p.refs.setReference,className:l.tremorTwMerge(n("progressBarWrapper"),"relative flex items-center w-full rounded-tremor-full bg-opacity-20 h-2",u?o.getColorClassNames(u,a.colorPalette.background).bgColor:"bg-tremor-brand-muted/50 dark:bg-dark-tremor-brand-muted")},w),m.default.createElement("div",{className:l.tremorTwMerge(n("progressBar"),"flex-col h-full rounded-tremor-full",u?o.getColorClassNames(u,a.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand"),style:{width:`${i}%`,transition:f?"all 1s":""}})),c?m.default.createElement("div",{className:l.tremorTwMerge(n("labelWrapper"),"w-16 truncate text-right ml-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},m.default.createElement("p",{className:l.tremorTwMerge(n("label"),"shrink-0 whitespace-nowrap truncate text-tremor-default")},c)):null))}));i.displayName="ProgressBar",module.exports=i; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts b/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts new file mode 100644 index 000000000..b0bbe8f29 --- /dev/null +++ b/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts @@ -0,0 +1,11 @@ +import React from "react"; +import { Color } from "../../../lib/inputTypes"; +export interface ProgressBarProps extends React.HTMLAttributes { + value: number; + label?: string; + tooltip?: string; + showAnimation?: boolean; + color?: Color; +} +declare const ProgressBar: React.ForwardRefExoticComponent>; +export default ProgressBar; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.js b/dist/components/vis-elements/ProgressBar/ProgressBar.js new file mode 100644 index 000000000..5ab3f7b30 --- /dev/null +++ b/dist/components/vis-elements/ProgressBar/ProgressBar.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as l}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as s,makeClassName as m}from"../../../lib/utils.js";const n=m("ProgressBar"),i=r.forwardRef(((m,i)=>{const{value:c,label:d,color:p,tooltip:b,showAnimation:f=!1,className:u}=m,g=e(m,["value","label","color","tooltip","showAnimation","className"]),{tooltipProps:h,getReferenceProps:w}=a();return r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:b},h)),r.createElement("div",Object.assign({ref:i,className:o(n("root"),"flex items-center w-full",u)},g),r.createElement("div",Object.assign({ref:h.refs.setReference,className:o(n("progressBarWrapper"),"relative flex items-center w-full rounded-tremor-full bg-opacity-20 h-2",p?s(p,l.background).bgColor:"bg-tremor-brand-muted/50 dark:bg-dark-tremor-brand-muted")},w),r.createElement("div",{className:o(n("progressBar"),"flex-col h-full rounded-tremor-full",p?s(p,l.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand"),style:{width:`${c}%`,transition:f?"all 1s":""}})),d?r.createElement("div",{className:o(n("labelWrapper"),"w-16 truncate text-right ml-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r.createElement("p",{className:o(n("label"),"shrink-0 whitespace-nowrap truncate text-tremor-default")},d)):null))}));i.displayName="ProgressBar";export{i as default}; diff --git a/dist/components/vis-elements/ProgressBar/index.d.ts b/dist/components/vis-elements/ProgressBar/index.d.ts new file mode 100644 index 000000000..96162c4a3 --- /dev/null +++ b/dist/components/vis-elements/ProgressBar/index.d.ts @@ -0,0 +1,2 @@ +export { default as ProgressBar } from "./ProgressBar"; +export type { ProgressBarProps } from "./ProgressBar"; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs b/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs new file mode 100644 index 000000000..7dec3e228 --- /dev/null +++ b/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs @@ -0,0 +1 @@ +"use strict";var e=require("tslib"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),t=require("../../../lib/theme.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("react"));const i=a.makeClassName("ProgressBar"),n={xs:{radius:15,strokeWidth:3},sm:{radius:19,strokeWidth:4},md:{radius:32,strokeWidth:6},lg:{radius:52,strokeWidth:8},xl:{radius:80,strokeWidth:10}};const c=l.default.forwardRef(((o,c)=>{const{value:d,size:u="md",className:m,showAnimation:f=!0,color:k,tooltip:h,radius:g,strokeWidth:p,children:b}=o,N=e.__rest(o,["value","size","className","showAnimation","color","tooltip","radius","strokeWidth","children"]),v=void 0===(w=d)?0:w>100?100:w;var w;const x=null!=g?g:n[u].radius,W=null!=p?p:n[u].strokeWidth,j=x-W/2,y=2*j*Math.PI,C=y-v/100*y,{tooltipProps:T,getReferenceProps:E}=r.useTooltip();return l.default.createElement(l.default.Fragment,null,l.default.createElement(r.default,Object.assign({text:h},T)),l.default.createElement("div",Object.assign({ref:c,className:s.tremorTwMerge(i("root"),"flex flex-col items-center justify-center",m)},N),l.default.createElement("svg",Object.assign({ref:T.refs.setReference,width:2*x,height:2*x,viewBox:`0 0 ${2*x} ${2*x}`,className:"transform -rotate-90"},E),l.default.createElement("circle",{r:j,cx:x,cy:x,strokeWidth:W,fill:"transparent",stroke:"",strokeLinecap:"round",className:s.tremorTwMerge("transition-colors ease-linear",k?`${a.getColorClassNames(k,t.colorPalette.background).strokeColor} opacity-20 dark:opacity-25`:"stroke-tremor-brand-muted/50 dark:stroke-dark-tremor-brand-muted")}),v>=0?l.default.createElement("circle",{r:j,cx:x,cy:x,strokeWidth:W,strokeDasharray:y+" "+y,strokeDashoffset:C,fill:"transparent",stroke:"",strokeLinecap:"round",className:s.tremorTwMerge("transition-colors ease-linear",k?a.getColorClassNames(k,t.colorPalette.background).strokeColor:"stroke-tremor-brand dark:stroke-dark-tremor-brand",f?"transition-all duration-300 ease-in-out":"")}):null),l.default.createElement("div",{className:s.tremorTwMerge("absolute flex")},b)))}));c.displayName="ProgressCircle",module.exports=c; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts b/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts new file mode 100644 index 000000000..3fd551a36 --- /dev/null +++ b/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts @@ -0,0 +1,15 @@ +import { Color } from "lib"; +import React from "react"; +export type Size = "xs" | "sm" | "md" | "lg" | "xl"; +export interface ProgressCircleProps extends React.HTMLAttributes { + value?: number; + size?: Size; + color?: Color; + showAnimation?: boolean; + tooltip?: string; + radius?: number; + strokeWidth?: number; + children?: React.ReactNode; +} +declare const ProgressCircle: React.ForwardRefExoticComponent>; +export default ProgressCircle; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.js b/dist/components/vis-elements/ProgressCircle/ProgressCircle.js new file mode 100644 index 000000000..7cd0e907e --- /dev/null +++ b/dist/components/vis-elements/ProgressCircle/ProgressCircle.js @@ -0,0 +1 @@ +import{__rest as e}from"tslib";import r,{useTooltip as t}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as i}from"../../../lib/utils.js";import l from"react";const n=i("ProgressBar"),c={xs:{radius:15,strokeWidth:3},sm:{radius:19,strokeWidth:4},md:{radius:32,strokeWidth:6},lg:{radius:52,strokeWidth:8},xl:{radius:80,strokeWidth:10}};const d=l.forwardRef(((i,d)=>{const{value:m,size:k="md",className:u,showAnimation:f=!0,color:h,tooltip:p,radius:b,strokeWidth:g,children:x}=i,W=e(i,["value","size","className","showAnimation","color","tooltip","radius","strokeWidth","children"]),j=void 0===(v=m)?0:v>100?100:v;var v;const N=null!=b?b:c[k].radius,y=null!=g?g:c[k].strokeWidth,E=N-y/2,w=2*E*Math.PI,P=w-j/100*w,{tooltipProps:C,getReferenceProps:O}=t();return l.createElement(l.Fragment,null,l.createElement(r,Object.assign({text:p},C)),l.createElement("div",Object.assign({ref:d,className:s(n("root"),"flex flex-col items-center justify-center",u)},W),l.createElement("svg",Object.assign({ref:C.refs.setReference,width:2*N,height:2*N,viewBox:`0 0 ${2*N} ${2*N}`,className:"transform -rotate-90"},O),l.createElement("circle",{r:E,cx:N,cy:N,strokeWidth:y,fill:"transparent",stroke:"",strokeLinecap:"round",className:s("transition-colors ease-linear",h?`${a(h,o.background).strokeColor} opacity-20 dark:opacity-25`:"stroke-tremor-brand-muted/50 dark:stroke-dark-tremor-brand-muted")}),j>=0?l.createElement("circle",{r:E,cx:N,cy:N,strokeWidth:y,strokeDasharray:w+" "+w,strokeDashoffset:P,fill:"transparent",stroke:"",strokeLinecap:"round",className:s("transition-colors ease-linear",h?a(h,o.background).strokeColor:"stroke-tremor-brand dark:stroke-dark-tremor-brand",f?"transition-all duration-300 ease-in-out":"")}):null),l.createElement("div",{className:s("absolute flex")},x)))}));d.displayName="ProgressCircle";export{d as default}; diff --git a/dist/components/vis-elements/ProgressCircle/index.d.ts b/dist/components/vis-elements/ProgressCircle/index.d.ts new file mode 100644 index 000000000..5f5fd0e44 --- /dev/null +++ b/dist/components/vis-elements/ProgressCircle/index.d.ts @@ -0,0 +1,2 @@ +export { default as ProgressCircle } from "./ProgressCircle"; +export type { ProgressCircleProps } from "./ProgressCircle"; diff --git a/dist/components/vis-elements/Tracker/Tracker.cjs b/dist/components/vis-elements/Tracker/Tracker.cjs new file mode 100644 index 000000000..95c6f33c3 --- /dev/null +++ b/dist/components/vis-elements/Tracker/Tracker.cjs @@ -0,0 +1,2 @@ +'use client'; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs"),a=require("react"),o=require("../../util-elements/Tooltip/Tooltip.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(a);const i=l.makeClassName("Tracker"),u=c.default.forwardRef(((a,s)=>{const{color:u,tooltip:n}=a,d=e.__rest(a,["color","tooltip"]),{tooltipProps:f,getReferenceProps:m}=o.useTooltip();return c.default.createElement("div",Object.assign({ref:l.mergeRefs([s,f.refs.setReference]),className:t.tremorTwMerge(i("trackingBlock"),"w-full h-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",l.getColorClassNames(null!=u?u:"gray",r.colorPalette.background).bgColor)},d,m),c.default.createElement(o.default,Object.assign({text:n},f)))}));u.displayName="TrackerBlock";const n=c.default.forwardRef(((r,l)=>{const{data:a=[],className:o}=r,s=e.__rest(r,["data","className"]);return c.default.createElement("div",Object.assign({ref:l,className:t.tremorTwMerge(i("root"),"h-10 flex items-center space-x-0.5",o)},s),a.map(((e,r)=>{var t;return c.default.createElement(u,{key:null!==(t=e.key)&&void 0!==t?t:r,color:e.color,tooltip:e.tooltip})})))}));n.displayName="Tracker",exports.default=n,exports.makeTrackerClassName=i; diff --git a/dist/components/vis-elements/Tracker/Tracker.d.ts b/dist/components/vis-elements/Tracker/Tracker.d.ts new file mode 100644 index 000000000..6e9fd1003 --- /dev/null +++ b/dist/components/vis-elements/Tracker/Tracker.d.ts @@ -0,0 +1,13 @@ +import React from "react"; +import { Color } from "../../../lib/inputTypes"; +export declare const makeTrackerClassName: (className: string) => string; +export interface TrackerBlockProps { + key?: string | number; + color?: Color | string; + tooltip?: string; +} +export interface TrackerProps extends React.HTMLAttributes { + data: TrackerBlockProps[]; +} +declare const Tracker: React.ForwardRefExoticComponent>; +export default Tracker; diff --git a/dist/components/vis-elements/Tracker/Tracker.js b/dist/components/vis-elements/Tracker/Tracker.js new file mode 100644 index 000000000..4ce61a108 --- /dev/null +++ b/dist/components/vis-elements/Tracker/Tracker.js @@ -0,0 +1,2 @@ +'use client'; +import{__rest as e}from"tslib";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{mergeRefs as o,getColorClassNames as l,makeClassName as a}from"../../../lib/utils.js";import s from"react";import c,{useTooltip as i}from"../../util-elements/Tooltip/Tooltip.js";const m=a("Tracker"),n=s.forwardRef(((a,n)=>{const{color:p,tooltip:f}=a,d=e(a,["color","tooltip"]),{tooltipProps:u,getReferenceProps:b}=i();return s.createElement("div",Object.assign({ref:o([n,u.refs.setReference]),className:t(m("trackingBlock"),"w-full h-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",l(null!=p?p:"gray",r.background).bgColor)},d,b),s.createElement(c,Object.assign({text:f},u)))}));n.displayName="TrackerBlock";const p=s.forwardRef(((r,o)=>{const{data:l=[],className:a}=r,c=e(r,["data","className"]);return s.createElement("div",Object.assign({ref:o,className:t(m("root"),"h-10 flex items-center space-x-0.5",a)},c),l.map(((e,r)=>{var t;return s.createElement(n,{key:null!==(t=e.key)&&void 0!==t?t:r,color:e.color,tooltip:e.tooltip})})))}));p.displayName="Tracker";export{p as default,m as makeTrackerClassName}; diff --git a/dist/components/vis-elements/Tracker/index.d.ts b/dist/components/vis-elements/Tracker/index.d.ts new file mode 100644 index 000000000..97ef3771f --- /dev/null +++ b/dist/components/vis-elements/Tracker/index.d.ts @@ -0,0 +1,2 @@ +export { default as Tracker } from "./Tracker"; +export type { TrackerProps } from "./Tracker"; diff --git a/dist/components/vis-elements/index.d.ts b/dist/components/vis-elements/index.d.ts new file mode 100644 index 000000000..08a881ec5 --- /dev/null +++ b/dist/components/vis-elements/index.d.ts @@ -0,0 +1,7 @@ +export * from "./BarList"; +export * from "./CategoryBar"; +export * from "./DeltaBar"; +export * from "./MarkerBar"; +export * from "./ProgressBar"; +export * from "./ProgressCircle"; +export * from "./Tracker"; diff --git a/dist/contexts/BaseColorContext.cjs b/dist/contexts/BaseColorContext.cjs new file mode 100644 index 000000000..2b7c86aec --- /dev/null +++ b/dist/contexts/BaseColorContext.cjs @@ -0,0 +1 @@ +"use strict";var e=require("react"),r=require("../lib/constants.cjs");require("../lib/tremorTwMerge.cjs");const t=e.createContext(r.BaseColors.Blue);module.exports=t; diff --git a/dist/contexts/BaseColorContext.d.ts b/dist/contexts/BaseColorContext.d.ts new file mode 100644 index 000000000..7797235b1 --- /dev/null +++ b/dist/contexts/BaseColorContext.d.ts @@ -0,0 +1,3 @@ +/// +declare const BaseColorContext: import("react").Context<"slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined>; +export default BaseColorContext; diff --git a/dist/contexts/BaseColorContext.js b/dist/contexts/BaseColorContext.js new file mode 100644 index 000000000..c4a1dc800 --- /dev/null +++ b/dist/contexts/BaseColorContext.js @@ -0,0 +1 @@ +import{createContext as r}from"react";import{BaseColors as t}from"../lib/constants.js";import"../lib/tremorTwMerge.js";const o=r(t.Blue);export{o as default}; diff --git a/dist/contexts/IndexContext.cjs b/dist/contexts/IndexContext.cjs new file mode 100644 index 000000000..7792a5991 --- /dev/null +++ b/dist/contexts/IndexContext.cjs @@ -0,0 +1 @@ +"use strict";const e=require("react").createContext(0);module.exports=e; diff --git a/dist/contexts/IndexContext.d.ts b/dist/contexts/IndexContext.d.ts new file mode 100644 index 000000000..075814450 --- /dev/null +++ b/dist/contexts/IndexContext.d.ts @@ -0,0 +1,3 @@ +/// +declare const IndexContext: import("react").Context; +export default IndexContext; diff --git a/dist/contexts/IndexContext.js b/dist/contexts/IndexContext.js new file mode 100644 index 000000000..b6666d72d --- /dev/null +++ b/dist/contexts/IndexContext.js @@ -0,0 +1 @@ +import{createContext as t}from"react";const o=t(0);export{o as default}; diff --git a/dist/contexts/RootStylesContext.cjs b/dist/contexts/RootStylesContext.cjs new file mode 100644 index 000000000..065822017 --- /dev/null +++ b/dist/contexts/RootStylesContext.cjs @@ -0,0 +1 @@ +"use strict";const e=require("react").createContext(void 0);module.exports=e; diff --git a/dist/contexts/RootStylesContext.d.ts b/dist/contexts/RootStylesContext.d.ts new file mode 100644 index 000000000..4871da86f --- /dev/null +++ b/dist/contexts/RootStylesContext.d.ts @@ -0,0 +1,3 @@ +/// +declare const RootStylesContext: import("react").Context; +export default RootStylesContext; diff --git a/dist/contexts/RootStylesContext.js b/dist/contexts/RootStylesContext.js new file mode 100644 index 000000000..775c7c326 --- /dev/null +++ b/dist/contexts/RootStylesContext.js @@ -0,0 +1 @@ +import{createContext as o}from"react";const t=o(void 0);export{t as default}; diff --git a/dist/contexts/SelectedValueContext.cjs b/dist/contexts/SelectedValueContext.cjs new file mode 100644 index 000000000..fa366699d --- /dev/null +++ b/dist/contexts/SelectedValueContext.cjs @@ -0,0 +1 @@ +"use strict";const e=require("react").createContext({selectedValue:void 0,handleValueChange:void 0});module.exports=e; diff --git a/dist/contexts/SelectedValueContext.d.ts b/dist/contexts/SelectedValueContext.d.ts new file mode 100644 index 000000000..e930debf0 --- /dev/null +++ b/dist/contexts/SelectedValueContext.d.ts @@ -0,0 +1,7 @@ +/// +export interface SelectedValueContextValue { + selectedValue: any; + handleValueChange?: (value: any) => void; +} +declare const SelectedValueContext: import("react").Context; +export default SelectedValueContext; diff --git a/dist/contexts/SelectedValueContext.js b/dist/contexts/SelectedValueContext.js new file mode 100644 index 000000000..b25807acf --- /dev/null +++ b/dist/contexts/SelectedValueContext.js @@ -0,0 +1 @@ +import{createContext as e}from"react";const a=e({selectedValue:void 0,handleValueChange:void 0});export{a as default}; diff --git a/dist/contexts/index.d.ts b/dist/contexts/index.d.ts new file mode 100644 index 000000000..55a639eae --- /dev/null +++ b/dist/contexts/index.d.ts @@ -0,0 +1,4 @@ +export { default as BaseColorContext } from "./BaseColorContext"; +export { default as IndexContext } from "./IndexContext"; +export { default as RootStylesContext } from "./RootStylesContext"; +export { default as SelectedValueContext } from "./SelectedValueContext"; diff --git a/dist/hooks/index.d.ts b/dist/hooks/index.d.ts new file mode 100644 index 000000000..98e2bb4d2 --- /dev/null +++ b/dist/hooks/index.d.ts @@ -0,0 +1,2 @@ +export { default as useInternalState } from "./useInternalState"; +export { default as useOnWindowResize } from "./useOnWindowResize"; diff --git a/dist/hooks/useInternalState.cjs b/dist/hooks/useInternalState.cjs new file mode 100644 index 000000000..a985ce745 --- /dev/null +++ b/dist/hooks/useInternalState.cjs @@ -0,0 +1 @@ +"use strict";var e=require("react");module.exports=(r,t)=>{const s=void 0!==t,[u,o]=e.useState(r);return[s?t:u,e=>{s||o(e)}]}; diff --git a/dist/hooks/useInternalState.d.ts b/dist/hooks/useInternalState.d.ts new file mode 100644 index 000000000..00e1b6b60 --- /dev/null +++ b/dist/hooks/useInternalState.d.ts @@ -0,0 +1,3 @@ +/// +declare const useInternalState: (defaultValueProp: T, valueProp: T) => [T, import("react").Dispatch>]; +export default useInternalState; diff --git a/dist/hooks/useInternalState.js b/dist/hooks/useInternalState.js new file mode 100644 index 000000000..092166aaf --- /dev/null +++ b/dist/hooks/useInternalState.js @@ -0,0 +1 @@ +import{useState as t}from"react";const o=(o,r)=>{const e=void 0!==r,[a,c]=t(o);return[e?r:a,t=>{e||c(t)}]};export{o as default}; diff --git a/dist/hooks/useOnWindowResize.cjs b/dist/hooks/useOnWindowResize.cjs new file mode 100644 index 000000000..b49de5e9b --- /dev/null +++ b/dist/hooks/useOnWindowResize.cjs @@ -0,0 +1 @@ +"use strict";var e=require("react");module.exports=(t,r)=>{const[n,i]=e.useState(r);e.useEffect((()=>{const e=()=>{i(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t,n])}; diff --git a/dist/hooks/useOnWindowResize.d.ts b/dist/hooks/useOnWindowResize.d.ts new file mode 100644 index 000000000..a9b277247 --- /dev/null +++ b/dist/hooks/useOnWindowResize.d.ts @@ -0,0 +1,4 @@ +declare const useOnWindowResize: (handler: { + (): void; +}, initialWindowSize?: number) => void; +export default useOnWindowResize; diff --git a/dist/hooks/useOnWindowResize.js b/dist/hooks/useOnWindowResize.js new file mode 100644 index 000000000..a7b81d3bf --- /dev/null +++ b/dist/hooks/useOnWindowResize.js @@ -0,0 +1 @@ +import{useState as e,useEffect as n}from"react";const t=(t,r)=>{const[i,o]=e(r);n((()=>{const e=()=>{o(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t,i])};export{t as default}; diff --git a/dist/index.cjs b/dist/index.cjs new file mode 100644 index 000000000..ce4f8df61 --- /dev/null +++ b/dist/index.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./components/chart-elements/AreaChart/AreaChart.cjs"),t=require("./components/chart-elements/BarChart/BarChart.cjs"),r=require("./components/chart-elements/DonutChart/DonutChart.cjs"),s=require("./components/chart-elements/LineChart/LineChart.cjs"),o=require("./components/chart-elements/ScatterChart/ScatterChart.cjs"),n=require("./components/icon-elements/Badge/Badge.cjs"),c=require("./components/icon-elements/BadgeDelta/BadgeDelta.cjs"),a=require("./components/icon-elements/Icon/Icon.cjs"),l=require("./components/input-elements/Button/Button.cjs"),i=require("./components/input-elements/DatePicker/DatePicker.cjs"),p=require("./components/input-elements/DateRangePicker/DateRangePicker.cjs"),m=require("./components/input-elements/DateRangePicker/DateRangePickerItem.cjs"),u=require("./components/input-elements/MultiSelect/MultiSelect.cjs"),x=require("./components/input-elements/MultiSelect/MultiSelectItem.cjs"),j=require("./components/input-elements/NumberInput/NumberInput.cjs"),q=require("./components/input-elements/SearchSelect/SearchSelect.cjs"),T=require("./components/input-elements/SearchSelect/SearchSelectItem.cjs"),d=require("./components/input-elements/Select/Select.cjs"),b=require("./components/input-elements/Select/SelectItem.cjs"),C=require("./components/input-elements/Switch/Switch.cjs"),S=require("./components/input-elements/Tabs/Tab.cjs"),B=require("./components/input-elements/Tabs/TabGroup.cjs"),h=require("./components/input-elements/Tabs/TabList.cjs"),g=require("./components/input-elements/Tabs/TabPanel.cjs"),k=require("./components/input-elements/Tabs/TabPanels.cjs"),D=require("./components/input-elements/Textarea/Textarea.cjs"),I=require("./components/input-elements/TextInput/TextInput.cjs"),L=require("./components/layout-elements/Accordion/Accordion.cjs"),P=require("./components/layout-elements/Accordion/AccordionBody.cjs"),y=require("./components/layout-elements/Accordion/AccordionHeader.cjs"),A=require("./components/layout-elements/Accordion/AccordionList.cjs"),M=require("./components/layout-elements/Card/Card.cjs"),v=require("./components/layout-elements/Divider/Divider.cjs"),R=require("./components/layout-elements/Flex/Flex.cjs"),F=require("./components/layout-elements/Grid/Col.cjs"),f=require("./components/layout-elements/Grid/Grid.cjs"),G=require("./components/layout-elements/Dialog/Dialog.cjs"),H=require("./components/layout-elements/Dialog/DialogPanel.cjs"),w=require("./components/list-elements/List/List.cjs"),N=require("./components/list-elements/List/ListItem.cjs"),_=require("./components/list-elements/Table/Table.cjs"),O=require("./components/list-elements/Table/TableBody.cjs"),z=require("./components/list-elements/Table/TableCell.cjs"),E=require("./components/list-elements/Table/TableFoot.cjs"),J=require("./components/list-elements/Table/TableFooterCell.cjs"),K=require("./components/list-elements/Table/TableHead.cjs"),Q=require("./components/list-elements/Table/TableHeaderCell.cjs"),U=require("./components/list-elements/Table/TableRow.cjs"),V=require("./components/spark-elements/SparkBarChart/SparkBarChart.cjs"),W=require("./components/spark-elements/SparkLineChart/SparkLineChart.cjs"),X=require("./components/spark-elements/SparkAreaChart/SparkAreaChart.cjs"),Y=require("./components/text-elements/Bold/Bold.cjs"),Z=require("./components/text-elements/Callout/Callout.cjs"),$=require("./components/text-elements/Italic/Italic.cjs"),ee=require("./components/text-elements/Legend/Legend.cjs"),te=require("./components/text-elements/Metric/Metric.cjs"),re=require("./components/text-elements/Subtitle/Subtitle.cjs"),se=require("./components/text-elements/Text/Text.cjs"),oe=require("./components/text-elements/Title/Title.cjs"),ne=require("./components/vis-elements/BarList/BarList.cjs"),ce=require("./components/vis-elements/CategoryBar/CategoryBar.cjs"),ae=require("./components/vis-elements/DeltaBar/DeltaBar.cjs"),le=require("./components/vis-elements/MarkerBar/MarkerBar.cjs"),ie=require("./components/vis-elements/ProgressBar/ProgressBar.cjs"),pe=require("./components/vis-elements/ProgressCircle/ProgressCircle.cjs"),me=require("./components/vis-elements/Tracker/Tracker.cjs"),ue=require("./lib/inputTypes.cjs");exports.AreaChart=e,exports.BarChart=t,exports.DonutChart=r,exports.LineChart=s,exports.ScatterChart=o,exports.Badge=n,exports.BadgeDelta=c,exports.Icon=a.default,exports.Button=l.default,exports.DatePicker=i,exports.DateRangePicker=p,exports.DateRangePickerItem=m,exports.MultiSelect=u,exports.MultiSelectItem=x,exports.NumberInput=j,exports.SearchSelect=q,exports.SearchSelectItem=T,exports.Select=d,exports.SelectItem=b,exports.Switch=C,exports.Tab=S,exports.TabGroup=B,exports.TabList=h.default,exports.TabPanel=g,exports.TabPanels=k,exports.Textarea=D,exports.TextInput=I,exports.Accordion=L.default,exports.AccordionBody=P,exports.AccordionHeader=y,exports.AccordionList=A,exports.Card=M,exports.Divider=v,exports.Flex=R,exports.Col=F,exports.Grid=f,exports.Dialog=G,exports.DialogPanel=H,exports.List=w,exports.ListItem=N,exports.Table=_,exports.TableBody=O,exports.TableCell=z,exports.TableFoot=E,exports.TableFooterCell=J,exports.TableHead=K,exports.TableHeaderCell=Q,exports.TableRow=U,exports.SparkBarChart=V,exports.SparkLineChart=W,exports.SparkAreaChart=X,exports.Bold=Y,exports.Callout=Z,exports.Italic=$,exports.Legend=ee,exports.Metric=te,exports.Subtitle=re,exports.Text=se,exports.Title=oe,exports.BarList=ne,exports.CategoryBar=ce,exports.DeltaBar=ae,exports.MarkerBar=le,exports.ProgressBar=ie,exports.ProgressCircle=pe,exports.Tracker=me.default,exports.getIsBaseColor=ue.getIsBaseColor; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 000000000..49e00b868 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,660 @@ +/// +import React$1, { ReactNode } from 'react'; +import { Payload, NameType } from 'recharts/types/component/DefaultTooltipContent'; +import { EventProps as EventProps$1 } from 'components/chart-elements/common'; +import { CustomTooltipProps as CustomTooltipProps$1 } from 'components/chart-elements/common/CustomTooltipProps'; +import { Color as Color$1, Size as Size$2, DeltaType as DeltaType$1, HorizontalPosition as HorizontalPosition$1, VerticalPosition as VerticalPosition$1, ValueFormatter as ValueFormatter$1 } from 'lib'; +import { enUS } from 'date-fns/locale'; +import BaseAnimationTimingProps$1 from 'components/chart-elements/common/BaseAnimationTimingProps'; + +type ValueFormatter = { + (value: number): string; +}; +type CurveType = "linear" | "natural" | "monotone" | "step"; +type Interval = "preserveStartEnd" | "equidistantPreserveStart"; +type IntervalType = "preserveStartEnd" | Interval; +declare const iconVariantValues: readonly ["simple", "light", "shadow", "solid", "outlined"]; +type IconVariant = (typeof iconVariantValues)[number]; +type HorizontalPosition = "left" | "right"; +type VerticalPosition = "top" | "bottom"; +type ButtonVariant = "primary" | "secondary" | "light"; +declare const deltaTypeValues: readonly ["increase", "moderateIncrease", "decrease", "moderateDecrease", "unchanged"]; +type DeltaType = (typeof deltaTypeValues)[number]; +declare const sizeValues: readonly ["xs", "sm", "md", "lg", "xl"]; +type Size$1 = (typeof sizeValues)[number]; +declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"]; +type Color = (typeof colorValues)[number]; +type CustomColor = Color | string; +declare const getIsBaseColor: (color: Color | string) => boolean; +declare const justifyContentValues: readonly ["start", "end", "center", "between", "around", "evenly"]; +type JustifyContent = (typeof justifyContentValues)[number]; +declare const alignItemsValues: readonly ["start", "end", "center", "baseline", "stretch"]; +type AlignItems = (typeof alignItemsValues)[number]; +type FlexDirection = "row" | "col" | "row-reverse" | "col-reverse"; + +interface BaseAnimationTimingProps { + animationDuration?: number; + showAnimation?: boolean; +} + +type CustomTooltipProps = { + payload: Payload[] | undefined; + active: boolean | undefined; + label: NameType | undefined; +}; + +type FixedProps = { + eventType: "dot" | "category" | "bar" | "slice" | "bubble"; + categoryClicked: string; +}; +type BaseEventProps = FixedProps & { + [key: string]: number | string; +}; +type EventProps = BaseEventProps | null | undefined; +interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { + data: any[]; + categories: string[]; + index: string; + colors?: (Color | string)[]; + valueFormatter?: ValueFormatter; + startEndOnly?: boolean; + showXAxis?: boolean; + showYAxis?: boolean; + yAxisWidth?: number; + intervalType?: IntervalType; + showTooltip?: boolean; + showLegend?: boolean; + showGridLines?: boolean; + autoMinValue?: boolean; + minValue?: number; + maxValue?: number; + allowDecimals?: boolean; + noDataText?: string; + onValueChange?: (value: EventProps) => void; + enableLegendSlider?: boolean; + customTooltip?: React.ComponentType; + rotateLabelX?: { + angle: number; + verticalShift?: number; + xAxisHeight?: number; + }; + tickGap?: number; +} + +interface AreaChartProps extends BaseChartProps { + stack?: boolean; + curveType?: CurveType; + connectNulls?: boolean; + showGradient?: boolean; +} +declare const AreaChart$1: React$1.ForwardRefExoticComponent>; + +interface BarChartProps extends BaseChartProps { + layout?: "vertical" | "horizontal"; + stack?: boolean; + relative?: boolean; +} +declare const BarChart: React$1.ForwardRefExoticComponent>; + +type DonutChartVariant = "donut" | "pie"; +interface DonutChartProps extends BaseAnimationTimingProps { + data: any[]; + category?: string; + index?: string; + colors?: (Color | string)[]; + variant?: DonutChartVariant; + valueFormatter?: ValueFormatter; + label?: string; + showLabel?: boolean; + showAnimation?: boolean; + showTooltip?: boolean; + noDataText?: string; + className?: string; + onValueChange?: (value: EventProps$1) => void; + customTooltip?: React$1.ComponentType; +} +declare const DonutChart: React$1.ForwardRefExoticComponent>; + +interface LineChartProps extends BaseChartProps { + curveType?: CurveType; + connectNulls?: boolean; +} +declare const LineChart: React$1.ForwardRefExoticComponent>; + +type ScatterChartValueFormatter = { + x?: ValueFormatter; + y?: ValueFormatter; + size?: ValueFormatter; +}; +interface ScatterChartProps extends BaseAnimationTimingProps, React$1.HTMLAttributes { + data: any[]; + x: string; + y: string; + category: string; + size?: string; + valueFormatter?: ScatterChartValueFormatter; + sizeRange?: number[]; + colors?: (Color | string)[]; + showOpacity?: boolean; + startEndOnly?: boolean; + showXAxis?: boolean; + showYAxis?: boolean; + yAxisWidth?: number; + intervalType?: IntervalType; + showTooltip?: boolean; + showLegend?: boolean; + showGridLines?: boolean; + autoMinXValue?: boolean; + minXValue?: number; + maxXValue?: number; + autoMinYValue?: boolean; + minYValue?: number; + maxYValue?: number; + allowDecimals?: boolean; + noDataText?: string; + enableLegendSlider?: boolean; + onValueChange?: (value: EventProps$1) => void; + customTooltip?: React$1.ComponentType; + rotateLabelX?: { + angle: number; + verticalShift: number; + xAxisHeight: number; + }; + tickGap?: number; +} +declare const ScatterChart: React$1.ForwardRefExoticComponent>; + +interface BadgeProps extends React$1.HTMLAttributes { + color?: Color$1; + size?: Size$2; + icon?: React$1.ElementType; + tooltip?: string; +} +declare const Badge: React$1.ForwardRefExoticComponent>; + +interface BadgeDeltaProps extends React$1.HTMLAttributes { + deltaType?: DeltaType$1; + isIncreasePositive?: boolean; + size?: Size$2; + tooltip?: string; +} +declare const BadgeDelta: React$1.ForwardRefExoticComponent>; + +interface IconProps extends React$1.HTMLAttributes { + icon: React$1.ElementType; + variant?: IconVariant; + tooltip?: string; + size?: Size$1; + color?: Color; +} +declare const Icon: React$1.ForwardRefExoticComponent>; + +interface ButtonProps extends React$1.ButtonHTMLAttributes { + icon?: React$1.ElementType; + iconPosition?: HorizontalPosition; + size?: Size$1; + color?: Color; + variant?: ButtonVariant; + disabled?: boolean; + loading?: boolean; + loadingText?: string; + tooltip?: string; +} +declare const Button: React$1.ForwardRefExoticComponent>; + +type Locale$1 = typeof enUS; +type DatePickerValue = Date | undefined; +interface DatePickerProps extends Omit, "value" | "defaultValue"> { + value?: Date; + defaultValue?: Date; + onValueChange?: (value: DatePickerValue) => void; + minDate?: Date; + maxDate?: Date; + placeholder?: string; + disabled?: boolean; + color?: Color; + locale?: Locale$1; + enableClear?: boolean; + displayFormat?: string; + enableYearNavigation?: boolean; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + disabledDates?: Date[]; + children?: React$1.ReactElement[] | React$1.ReactElement; +} +declare const DatePicker: React$1.ForwardRefExoticComponent>; + +type Locale = typeof enUS; +type DateRangePickerValue = { + from?: Date; + to?: Date; + selectValue?: string; +}; +interface DateRangePickerProps extends Omit, "value" | "defaultValue"> { + value?: DateRangePickerValue; + defaultValue?: DateRangePickerValue; + onValueChange?: (value: DateRangePickerValue) => void; + enableSelect?: boolean; + minDate?: Date; + maxDate?: Date; + placeholder?: string; + selectPlaceholder?: string; + disabled?: boolean; + color?: Color; + locale?: Locale; + enableClear?: boolean; + displayFormat?: string; + enableYearNavigation?: boolean; + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; + disabledDates?: Date[]; + children?: React$1.ReactElement[] | React$1.ReactElement; +} +declare const DateRangePicker: React$1.ForwardRefExoticComponent>; + +interface DateRangePickerItemProps extends React$1.HTMLAttributes { + value: string; + from: Date; + to?: Date; +} +declare const DateRangePickerItem: React$1.ForwardRefExoticComponent>; + +interface MultiSelectProps extends React$1.HTMLAttributes { + defaultValue?: string[]; + name?: string; + value?: string[]; + onValueChange?: (value: string[]) => void; + placeholder?: string; + placeholderSearch?: string; + disabled?: boolean; + icon?: React$1.ElementType | React$1.JSXElementConstructor; + required?: boolean; + error?: boolean; + errorMessage?: string; + children: React$1.ReactNode; +} +declare const MultiSelect: React$1.ForwardRefExoticComponent>; + +interface MultiSelectItemProps extends React$1.HTMLAttributes { + value: string; +} +declare const MultiSelectItem: React$1.ForwardRefExoticComponent>; + +interface BaseInputProps extends React$1.InputHTMLAttributes { + type?: "text" | "password" | "email" | "url" | "number"; + defaultValue?: string | number; + value?: string | number; + icon?: React$1.ElementType | React$1.JSXElementConstructor; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + stepper?: ReactNode; + onValueChange?: (value: any) => void; + makeInputClassName: (className: string) => string; +} + +interface NumberInputProps extends Omit { + step?: string | number; + enableStepper?: boolean; + onSubmit?: (value: number) => void; + onValueChange?: (value: number) => void; +} +declare const NumberInput: React$1.ForwardRefExoticComponent>; + +interface SearchSelectProps extends React$1.HTMLAttributes { + defaultValue?: string; + name?: string; + searchValue?: string; + onSearchValueChange?: (value: string) => void; + value?: string; + onValueChange?: (value: string) => void; + placeholder?: string; + disabled?: boolean; + icon?: React$1.ElementType | React$1.JSXElementConstructor; + required?: boolean; + error?: boolean; + errorMessage?: string; + enableClear?: boolean; + children: React$1.ReactNode; +} +declare const SearchSelect: React$1.ForwardRefExoticComponent>; + +interface SearchSelectItemProps extends React$1.HTMLAttributes { + value: string; + icon?: React$1.ElementType; +} +declare const SearchSelectItem: React$1.ForwardRefExoticComponent>; + +interface SelectProps extends React$1.HTMLAttributes { + value?: string; + name?: string; + defaultValue?: string; + onValueChange?: (value: string) => void; + placeholder?: string; + disabled?: boolean; + icon?: React$1.JSXElementConstructor; + enableClear?: boolean; + required?: boolean; + error?: boolean; + errorMessage?: string; + children: React$1.ReactNode; +} +declare const Select: React$1.ForwardRefExoticComponent>; + +interface SelectItemProps extends React$1.HTMLAttributes { + value: string; + icon?: React$1.ElementType; +} +declare const SelectItem: React$1.ForwardRefExoticComponent>; + +interface SwitchProps extends Omit, "onChange"> { + checked?: boolean; + defaultChecked?: boolean; + onChange?: (value: boolean) => void; + color?: Color$1; + name?: string; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + required?: boolean; + id?: string; + tooltip?: string; +} +declare const Switch: React$1.ForwardRefExoticComponent>; + +interface TabProps extends React$1.ButtonHTMLAttributes { + icon?: React$1.ElementType; +} +declare const Tab: React$1.ForwardRefExoticComponent>; + +interface TabGroupProps extends React$1.HTMLAttributes { + defaultIndex?: number; + index?: number; + onIndexChange?: (index: number) => void; + children: React$1.ReactElement[] | React$1.ReactElement; +} +declare const TabGroup: React$1.ForwardRefExoticComponent>; + +type TabVariant = "line" | "solid"; +interface TabListProps extends React$1.HTMLAttributes { + color?: Color$1; + variant?: TabVariant; + children: React$1.ReactElement[] | React$1.ReactElement; +} +declare const TabList: React$1.ForwardRefExoticComponent>; + +declare const TabPanel: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TabPanels: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface TextareaProps extends React$1.TextareaHTMLAttributes { + defaultValue?: string | number; + value?: string | number; + error?: boolean; + errorMessage?: string; + disabled?: boolean; + onValueChange?: (value: any) => void; +} +declare const Textarea: React$1.ForwardRefExoticComponent>; + +type TextInputProps = Omit & { + type?: "text" | "password" | "email" | "url"; + defaultValue?: string; + value?: string; + onValueChange?: (value: string) => void; + icon?: React$1.ElementType | React$1.JSXElementConstructor; + error?: boolean; + errorMessage?: string; + disabled?: boolean; +}; +declare const TextInput: React$1.ForwardRefExoticComponent & { + type?: "text" | "url" | "email" | "password" | undefined; + defaultValue?: string | undefined; + value?: string | undefined; + onValueChange?: ((value: string) => void) | undefined; + icon?: React$1.JSXElementConstructor | React$1.ElementType | undefined; + error?: boolean | undefined; + errorMessage?: string | undefined; + disabled?: boolean | undefined; +} & React$1.RefAttributes>; + +interface AccordionProps extends React$1.HTMLAttributes { + defaultOpen?: boolean; +} +declare const Accordion: React$1.ForwardRefExoticComponent>; + +declare const AccordionBody: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const AccordionHeader: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface AccordionListProps extends React$1.HTMLAttributes { + children: React$1.ReactElement[] | React$1.ReactElement; +} +declare const AccordionList: React$1.ForwardRefExoticComponent>; + +interface CardProps extends React$1.HTMLAttributes { + decoration?: HorizontalPosition$1 | VerticalPosition$1 | ""; + decorationColor?: Color$1; +} +declare const Card: React$1.ForwardRefExoticComponent>; + +declare const Divider: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface FlexProps extends React$1.HTMLAttributes { + flexDirection?: FlexDirection; + justifyContent?: JustifyContent; + alignItems?: AlignItems; + children: React$1.ReactNode; +} +declare const Flex: React$1.ForwardRefExoticComponent>; + +interface ColProps extends React$1.HTMLAttributes { + numColSpan?: number; + numColSpanSm?: number; + numColSpanMd?: number; + numColSpanLg?: number; +} +declare const Col: React$1.ForwardRefExoticComponent>; + +interface GridProps extends React$1.HTMLAttributes { + numItems?: number; + numItemsSm?: number; + numItemsMd?: number; + numItemsLg?: number; + children: React$1.ReactNode; +} +declare const Grid: React$1.ForwardRefExoticComponent>; + +type Without = { + [P in Exclude]?: never; +}; +type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; +type DialogProps = React$1.HTMLAttributes & { + open: boolean; + onClose: (val: boolean) => void; + role?: "dialog" | "alertdialog"; +} & XOR<{ + unmount?: boolean; +}, { + static?: boolean; +}>; +declare const Dialog: React$1.ForwardRefExoticComponent>; + +type DialogPanelProps = React$1.HTMLAttributes; +declare const DialogPanel: React$1.ForwardRefExoticComponent>; + +declare const List: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const ListItem: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const Table: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableBody: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableFoot: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableFooterCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableHead: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableHeaderCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +declare const TableRow: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface BaseSparkChartProps extends BaseAnimationTimingProps$1, React.HTMLAttributes { + data: any[]; + categories: string[]; + index: string; + colors?: (Color | string)[]; + noDataText?: string; + autoMinValue?: boolean; + minValue?: number; + maxValue?: number; +} + +interface SparkBarChartProps extends BaseSparkChartProps { + stack?: boolean; + relative?: boolean; +} +declare const SparkBarChart: React$1.ForwardRefExoticComponent>; + +interface SparkLineChartProps extends BaseSparkChartProps { + curveType?: CurveType; + connectNulls?: boolean; +} +declare const SparkLineChart: React$1.ForwardRefExoticComponent>; + +interface SparkAreaChartProps extends BaseSparkChartProps { + stack?: boolean; + curveType?: CurveType; + connectNulls?: boolean; + showGradient?: boolean; +} +declare const AreaChart: React$1.ForwardRefExoticComponent>; + +declare const Bold: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface CalloutProps extends React$1.HTMLAttributes { + title: string; + icon?: React$1.ElementType; + color?: Color$1; +} +declare const Callout: React$1.ForwardRefExoticComponent>; + +declare const Italic: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; + +interface LegendProps extends React$1.OlHTMLAttributes { + categories: string[]; + colors?: (Color$1 | string)[]; + onClickLegendItem?: (category: string, color: Color$1 | string) => void; + activeLegend?: string; + enableLegendSlider?: boolean; +} +declare const Legend: React$1.ForwardRefExoticComponent>; + +interface MetricProps extends React$1.HTMLAttributes { + color?: Color; +} +declare const Metric: React$1.ForwardRefExoticComponent>; + +interface SubtitleProps extends React$1.HTMLAttributes { + color?: Color; +} +declare const Subtitle: React$1.ForwardRefExoticComponent>; + +interface TextProps extends React$1.HTMLAttributes { + color?: Color; +} +declare const Text: React$1.ForwardRefExoticComponent>; + +interface TitleProps extends React$1.HTMLAttributes { + color?: Color; +} +declare const Title: React$1.ForwardRefExoticComponent>; + +type Bar = T & { + key?: string; + value: number; + name: string; + icon?: React$1.JSXElementConstructor; + href?: string; + target?: string; + color?: Color$1; +}; +interface BarListProps extends React$1.HTMLAttributes { + data: Bar[]; + valueFormatter?: ValueFormatter$1; + color?: Color$1; + showAnimation?: boolean; + onValueChange?: (payload: Bar) => void; +} +declare function BarListInner(props: BarListProps, ref: React$1.ForwardedRef): React$1.JSX.Element; +declare namespace BarListInner { + var displayName: string; +} +declare const BarList: (p: BarListProps & { + ref?: React$1.ForwardedRef | undefined; +}) => ReturnType; + +interface CategoryBarProps extends React$1.HTMLAttributes { + values: number[]; + colors?: Color[]; + markerValue?: number; + showLabels?: boolean; + tooltip?: string; + showAnimation?: boolean; +} +declare const CategoryBar: React$1.ForwardRefExoticComponent>; + +interface DeltaBarProps extends React$1.HTMLAttributes { + value: number; + isIncreasePositive?: boolean; + tooltip?: string; + showAnimation?: boolean; +} +declare const DeltaBar: React$1.ForwardRefExoticComponent>; + +interface MarkerBarProps extends React$1.HTMLAttributes { + value: number; + minValue?: number; + maxValue?: number; + markerTooltip?: string; + rangeTooltip?: string; + showAnimation?: boolean; + color?: Color; +} +declare const MarkerBar: React$1.ForwardRefExoticComponent>; + +interface ProgressBarProps extends React$1.HTMLAttributes { + value: number; + label?: string; + tooltip?: string; + showAnimation?: boolean; + color?: Color; +} +declare const ProgressBar: React$1.ForwardRefExoticComponent>; + +type Size = "xs" | "sm" | "md" | "lg" | "xl"; +interface ProgressCircleProps extends React$1.HTMLAttributes { + value?: number; + size?: Size; + color?: Color$1; + showAnimation?: boolean; + tooltip?: string; + radius?: number; + strokeWidth?: number; + children?: React$1.ReactNode; +} +declare const ProgressCircle: React$1.ForwardRefExoticComponent>; + +interface TrackerBlockProps { + key?: string | number; + color?: Color | string; + tooltip?: string; +} +interface TrackerProps extends React$1.HTMLAttributes { + data: TrackerBlockProps[]; +} +declare const Tracker: React$1.ForwardRefExoticComponent>; + +export { Accordion, AccordionBody, AccordionHeader, AccordionList, AccordionListProps, AccordionProps, AlignItems, AreaChart$1 as AreaChart, AreaChartProps, Badge, BadgeDelta, BadgeDeltaProps, BadgeProps, BarChart, BarChartProps, BarList, BarListProps, Bold, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, Card, CardProps, CategoryBar, CategoryBarProps, Col, ColProps, Color, CurveType, CustomColor, CustomTooltipProps, DatePicker, DatePickerProps, DatePickerValue, DateRangePicker, DateRangePickerItem, DateRangePickerItemProps, DateRangePickerProps, DateRangePickerValue, DeltaBar, DeltaBarProps, DeltaType, Dialog, DialogPanel, DialogPanelProps, DialogProps, Divider, DonutChart, DonutChartProps, EventProps, Flex, FlexDirection, FlexProps, Grid, GridProps, HorizontalPosition, Icon, IconProps, IconVariant, Interval, IntervalType, Italic, JustifyContent, Legend, LegendProps, LineChart, LineChartProps, List, ListItem, MarkerBar, MarkerBarProps, Metric, MetricProps, MultiSelect, MultiSelectItem, MultiSelectItemProps, MultiSelectProps, NumberInput, NumberInputProps, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ScatterChart, ScatterChartProps, SearchSelect, SearchSelectItem, SearchSelectItemProps, SearchSelectProps, Select, SelectItem, SelectItemProps, SelectProps, Size$1 as Size, AreaChart as SparkAreaChart, SparkAreaChartProps, SparkBarChart, SparkBarChartProps, SparkLineChart, SparkLineChartProps, Subtitle, SubtitleProps, Switch, SwitchProps, Tab, TabGroup, TabGroupProps, TabList, TabListProps, TabPanel, TabPanels, TabProps, Table, TableBody, TableCell, TableFoot, TableFooterCell, TableHead, TableHeaderCell, TableRow, Text, TextInput, TextInputProps, TextProps, Textarea, TextareaProps, Title, TitleProps, Tracker, TrackerProps, ValueFormatter, VerticalPosition, getIsBaseColor }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 000000000..d63c99e91 --- /dev/null +++ b/dist/index.js @@ -0,0 +1 @@ +export{default as AreaChart}from"./components/chart-elements/AreaChart/AreaChart.js";export{default as BarChart}from"./components/chart-elements/BarChart/BarChart.js";export{default as DonutChart}from"./components/chart-elements/DonutChart/DonutChart.js";export{default as LineChart}from"./components/chart-elements/LineChart/LineChart.js";export{default as ScatterChart}from"./components/chart-elements/ScatterChart/ScatterChart.js";export{default as Badge}from"./components/icon-elements/Badge/Badge.js";export{default as BadgeDelta}from"./components/icon-elements/BadgeDelta/BadgeDelta.js";export{default as Icon}from"./components/icon-elements/Icon/Icon.js";export{default as Button}from"./components/input-elements/Button/Button.js";export{default as DatePicker}from"./components/input-elements/DatePicker/DatePicker.js";export{default as DateRangePicker}from"./components/input-elements/DateRangePicker/DateRangePicker.js";export{default as DateRangePickerItem}from"./components/input-elements/DateRangePicker/DateRangePickerItem.js";export{default as MultiSelect}from"./components/input-elements/MultiSelect/MultiSelect.js";export{default as MultiSelectItem}from"./components/input-elements/MultiSelect/MultiSelectItem.js";export{default as NumberInput}from"./components/input-elements/NumberInput/NumberInput.js";export{default as SearchSelect}from"./components/input-elements/SearchSelect/SearchSelect.js";export{default as SearchSelectItem}from"./components/input-elements/SearchSelect/SearchSelectItem.js";export{default as Select}from"./components/input-elements/Select/Select.js";export{default as SelectItem}from"./components/input-elements/Select/SelectItem.js";export{default as Switch}from"./components/input-elements/Switch/Switch.js";export{default as Tab}from"./components/input-elements/Tabs/Tab.js";export{default as TabGroup}from"./components/input-elements/Tabs/TabGroup.js";export{default as TabList}from"./components/input-elements/Tabs/TabList.js";export{default as TabPanel}from"./components/input-elements/Tabs/TabPanel.js";export{default as TabPanels}from"./components/input-elements/Tabs/TabPanels.js";export{default as Textarea}from"./components/input-elements/Textarea/Textarea.js";export{default as TextInput}from"./components/input-elements/TextInput/TextInput.js";export{default as Accordion}from"./components/layout-elements/Accordion/Accordion.js";export{default as AccordionBody}from"./components/layout-elements/Accordion/AccordionBody.js";export{default as AccordionHeader}from"./components/layout-elements/Accordion/AccordionHeader.js";export{default as AccordionList}from"./components/layout-elements/Accordion/AccordionList.js";export{default as Card}from"./components/layout-elements/Card/Card.js";export{default as Divider}from"./components/layout-elements/Divider/Divider.js";export{default as Flex}from"./components/layout-elements/Flex/Flex.js";export{default as Col}from"./components/layout-elements/Grid/Col.js";export{default as Grid}from"./components/layout-elements/Grid/Grid.js";export{default as Dialog}from"./components/layout-elements/Dialog/Dialog.js";export{default as DialogPanel}from"./components/layout-elements/Dialog/DialogPanel.js";export{default as List}from"./components/list-elements/List/List.js";export{default as ListItem}from"./components/list-elements/List/ListItem.js";export{default as Table}from"./components/list-elements/Table/Table.js";export{default as TableBody}from"./components/list-elements/Table/TableBody.js";export{default as TableCell}from"./components/list-elements/Table/TableCell.js";export{default as TableFoot}from"./components/list-elements/Table/TableFoot.js";export{default as TableFooterCell}from"./components/list-elements/Table/TableFooterCell.js";export{default as TableHead}from"./components/list-elements/Table/TableHead.js";export{default as TableHeaderCell}from"./components/list-elements/Table/TableHeaderCell.js";export{default as TableRow}from"./components/list-elements/Table/TableRow.js";export{default as SparkBarChart}from"./components/spark-elements/SparkBarChart/SparkBarChart.js";export{default as SparkLineChart}from"./components/spark-elements/SparkLineChart/SparkLineChart.js";export{default as SparkAreaChart}from"./components/spark-elements/SparkAreaChart/SparkAreaChart.js";export{default as Bold}from"./components/text-elements/Bold/Bold.js";export{default as Callout}from"./components/text-elements/Callout/Callout.js";export{default as Italic}from"./components/text-elements/Italic/Italic.js";export{default as Legend}from"./components/text-elements/Legend/Legend.js";export{default as Metric}from"./components/text-elements/Metric/Metric.js";export{default as Subtitle}from"./components/text-elements/Subtitle/Subtitle.js";export{default as Text}from"./components/text-elements/Text/Text.js";export{default as Title}from"./components/text-elements/Title/Title.js";export{default as BarList}from"./components/vis-elements/BarList/BarList.js";export{default as CategoryBar}from"./components/vis-elements/CategoryBar/CategoryBar.js";export{default as DeltaBar}from"./components/vis-elements/DeltaBar/DeltaBar.js";export{default as MarkerBar}from"./components/vis-elements/MarkerBar/MarkerBar.js";export{default as ProgressBar}from"./components/vis-elements/ProgressBar/ProgressBar.js";export{default as ProgressCircle}from"./components/vis-elements/ProgressCircle/ProgressCircle.js";export{default as Tracker}from"./components/vis-elements/Tracker/Tracker.js";export{getIsBaseColor}from"./lib/inputTypes.js"; diff --git a/dist/lib/constants.cjs b/dist/lib/constants.cjs new file mode 100644 index 000000000..a1ac1cace --- /dev/null +++ b/dist/lib/constants.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BaseColors={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},exports.DeltaTypes={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},exports.HorizontalPositions={Left:"left",Right:"right"},exports.Sizes={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},exports.VerticalPositions={Top:"top",Bottom:"bottom"}; diff --git a/dist/lib/constants.d.ts b/dist/lib/constants.d.ts new file mode 100644 index 000000000..cf13a1d2f --- /dev/null +++ b/dist/lib/constants.d.ts @@ -0,0 +1,16 @@ +import { Color, DeltaType, HorizontalPosition, Size, VerticalPosition } from "./inputTypes"; +export declare const DeltaTypes: { + [key: string]: DeltaType; +}; +export declare const BaseColors: { + [key: string]: Color; +}; +export declare const Sizes: { + [key: string]: Size; +}; +export declare const HorizontalPositions: { + [key: string]: HorizontalPosition; +}; +export declare const VerticalPositions: { + [key: string]: VerticalPosition; +}; diff --git a/dist/lib/constants.js b/dist/lib/constants.js new file mode 100644 index 000000000..662ddbf96 --- /dev/null +++ b/dist/lib/constants.js @@ -0,0 +1 @@ +const e={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},a={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},r={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},n={Left:"left",Right:"right"},t={Top:"top",Bottom:"bottom"};export{a as BaseColors,e as DeltaTypes,n as HorizontalPositions,r as Sizes,t as VerticalPositions}; diff --git a/dist/lib/index.d.ts b/dist/lib/index.d.ts new file mode 100644 index 000000000..4bccf16dc --- /dev/null +++ b/dist/lib/index.d.ts @@ -0,0 +1,5 @@ +export * from "./constants"; +export * from "./inputTypes"; +export * from "./theme"; +export * from "./tremorTwMerge"; +export * from "./utils"; diff --git a/dist/lib/inputTypes.cjs b/dist/lib/inputTypes.cjs new file mode 100644 index 000000000..dbab92490 --- /dev/null +++ b/dist/lib/inputTypes.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"];exports.getIsBaseColor=r=>e.includes(r); diff --git a/dist/lib/inputTypes.d.ts b/dist/lib/inputTypes.d.ts new file mode 100644 index 000000000..56df6e4c3 --- /dev/null +++ b/dist/lib/inputTypes.d.ts @@ -0,0 +1,25 @@ +export type ValueFormatter = { + (value: number): string; +}; +export type CurveType = "linear" | "natural" | "monotone" | "step"; +export type Interval = "preserveStartEnd" | "equidistantPreserveStart"; +export type IntervalType = "preserveStartEnd" | Interval; +declare const iconVariantValues: readonly ["simple", "light", "shadow", "solid", "outlined"]; +export type IconVariant = (typeof iconVariantValues)[number]; +export type HorizontalPosition = "left" | "right"; +export type VerticalPosition = "top" | "bottom"; +export type ButtonVariant = "primary" | "secondary" | "light"; +declare const deltaTypeValues: readonly ["increase", "moderateIncrease", "decrease", "moderateDecrease", "unchanged"]; +export type DeltaType = (typeof deltaTypeValues)[number]; +declare const sizeValues: readonly ["xs", "sm", "md", "lg", "xl"]; +export type Size = (typeof sizeValues)[number]; +declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"]; +export type Color = (typeof colorValues)[number]; +export type CustomColor = Color | string; +export declare const getIsBaseColor: (color: Color | string) => boolean; +declare const justifyContentValues: readonly ["start", "end", "center", "between", "around", "evenly"]; +export type JustifyContent = (typeof justifyContentValues)[number]; +declare const alignItemsValues: readonly ["start", "end", "center", "baseline", "stretch"]; +export type AlignItems = (typeof alignItemsValues)[number]; +export type FlexDirection = "row" | "col" | "row-reverse" | "col-reverse"; +export {}; diff --git a/dist/lib/inputTypes.js b/dist/lib/inputTypes.js new file mode 100644 index 000000000..da6e0e71c --- /dev/null +++ b/dist/lib/inputTypes.js @@ -0,0 +1 @@ +const e=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],l=l=>e.includes(l);export{l as getIsBaseColor}; diff --git a/dist/lib/theme.cjs b/dist/lib/theme.cjs new file mode 100644 index 000000000..c2c17ca8b --- /dev/null +++ b/dist/lib/theme.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("./constants.cjs");const e=[o.BaseColors.Blue,o.BaseColors.Cyan,o.BaseColors.Sky,o.BaseColors.Indigo,o.BaseColors.Violet,o.BaseColors.Purple,o.BaseColors.Fuchsia,o.BaseColors.Slate,o.BaseColors.Gray,o.BaseColors.Zinc,o.BaseColors.Neutral,o.BaseColors.Stone,o.BaseColors.Red,o.BaseColors.Orange,o.BaseColors.Amber,o.BaseColors.Yellow,o.BaseColors.Lime,o.BaseColors.Green,o.BaseColors.Emerald,o.BaseColors.Teal,o.BaseColors.Pink,o.BaseColors.Rose];exports.colorPalette={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},exports.themeColorRange=e; diff --git a/dist/lib/theme.d.ts b/dist/lib/theme.d.ts new file mode 100644 index 000000000..6146d8891 --- /dev/null +++ b/dist/lib/theme.d.ts @@ -0,0 +1,24 @@ +import { Color } from "./inputTypes"; +export declare const DEFAULT_COLOR: Color; +export declare const WHITE = "white"; +export declare const TRANSPARENT = "transparent"; +export declare const colorPalette: { + canvasBackground: number; + lightBackground: number; + background: number; + darkBackground: number; + darkestBackground: number; + lightBorder: number; + border: number; + darkBorder: number; + lightRing: number; + ring: number; + iconRing: number; + lightText: number; + text: number; + iconText: number; + darkText: number; + darkestText: number; + icon: number; +}; +export declare const themeColorRange: Color[]; diff --git a/dist/lib/theme.js b/dist/lib/theme.js new file mode 100644 index 000000000..4247dcf1d --- /dev/null +++ b/dist/lib/theme.js @@ -0,0 +1 @@ +import{BaseColors as e}from"./constants.js";const r={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},n=[e.Blue,e.Cyan,e.Sky,e.Indigo,e.Violet,e.Purple,e.Fuchsia,e.Slate,e.Gray,e.Zinc,e.Neutral,e.Stone,e.Red,e.Orange,e.Amber,e.Yellow,e.Lime,e.Green,e.Emerald,e.Teal,e.Pink,e.Rose];export{r as colorPalette,n as themeColorRange}; diff --git a/dist/lib/tremorTwMerge.cjs b/dist/lib/tremorTwMerge.cjs new file mode 100644 index 000000000..ab8677a4b --- /dev/null +++ b/dist/lib/tremorTwMerge.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("tailwind-merge").extendTailwindMerge({classGroups:{boxShadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],borderRadius:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],fontSize:[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}});exports.tremorTwMerge=e; diff --git a/dist/lib/tremorTwMerge.d.ts b/dist/lib/tremorTwMerge.d.ts new file mode 100644 index 000000000..1482cc885 --- /dev/null +++ b/dist/lib/tremorTwMerge.d.ts @@ -0,0 +1 @@ +export declare const tremorTwMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string; diff --git a/dist/lib/tremorTwMerge.js b/dist/lib/tremorTwMerge.js new file mode 100644 index 000000000..e488706e2 --- /dev/null +++ b/dist/lib/tremorTwMerge.js @@ -0,0 +1 @@ +import{extendTailwindMerge as r}from"tailwind-merge";const t=r({classGroups:{boxShadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],borderRadius:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],fontSize:[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}});export{t as tremorTwMerge}; diff --git a/dist/lib/utils.cjs b/dist/lib/utils.cjs new file mode 100644 index 000000000..16582cca2 --- /dev/null +++ b/dist/lib/utils.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./constants.cjs"),r=require("./inputTypes.cjs");exports.defaultValueFormatter=e=>e.toString(),exports.getColorClassNames=function(e,o){const t=r.getIsBaseColor(e);if("white"===e||"black"===e||"transparent"===e||!o||!t){const r=(e=>e.includes("#")||e.includes("--")||e.includes("rgb"))(e)?`[${e}]`:e;return{bgColor:`bg-${r}`,hoverBgColor:`hover:bg-${r}`,selectBgColor:`ui-selected:bg-${r}`,textColor:`text-${r}`,selectTextColor:`ui-selected:text-${r}`,hoverTextColor:`hover:text-${r}`,borderColor:`border-${r}`,selectBorderColor:`ui-selected:border-${r}`,hoverBorderColor:`hover:border-${r}`,ringColor:`ring-${r}`,strokeColor:`stroke-${r}`,fillColor:`fill-${r}`}}return{bgColor:`bg-${e}-${o}`,selectBgColor:`ui-selected:bg-${e}-${o}`,hoverBgColor:`hover:bg-${e}-${o}`,textColor:`text-${e}-${o}`,selectTextColor:`ui-selected:text-${e}-${o}`,hoverTextColor:`hover:text-${e}-${o}`,borderColor:`border-${e}-${o}`,selectBorderColor:`ui-selected:border-${e}-${o}`,hoverBorderColor:`hover:border-${e}-${o}`,ringColor:`ring-${e}-${o}`,strokeColor:`stroke-${e}-${o}`,fillColor:`fill-${e}-${o}`}},exports.isValueInArray=(e,r)=>{for(let o=0;o`tremor-${e}-${r}`},exports.mapInputsToDeltaType=(r,o)=>{if(o||r===e.DeltaTypes.Unchanged)return r;switch(r){case e.DeltaTypes.Increase:return e.DeltaTypes.Decrease;case e.DeltaTypes.ModerateIncrease:return e.DeltaTypes.ModerateDecrease;case e.DeltaTypes.Decrease:return e.DeltaTypes.Increase;case e.DeltaTypes.ModerateDecrease:return e.DeltaTypes.ModerateIncrease}return""},exports.mergeRefs=function(e){return r=>{e.forEach((e=>{"function"==typeof e?e(r):null!=e&&(e.current=r)}))}},exports.sumNumericArray=e=>e.reduce(((e,r)=>e+r),0); diff --git a/dist/lib/utils.d.ts b/dist/lib/utils.d.ts new file mode 100644 index 000000000..ccaf08d09 --- /dev/null +++ b/dist/lib/utils.d.ts @@ -0,0 +1,25 @@ +/// +import { Color, ValueFormatter } from "./inputTypes"; +export declare const mapInputsToDeltaType: (deltaType: string, isIncreasePositive: boolean) => string; +export declare const defaultValueFormatter: ValueFormatter; +export declare const currencyValueFormatter: ValueFormatter; +export declare const sumNumericArray: (arr: number[]) => number; +export declare const isValueInArray: (value: any, array: any[]) => boolean; +export declare function mergeRefs(refs: Array | React.LegacyRef>): React.RefCallback; +export declare function makeClassName(componentName: string): (className: string) => string; +interface ColorClassNames { + bgColor: string; + hoverBgColor: string; + selectBgColor: string; + textColor: string; + selectTextColor: string; + hoverTextColor: string; + borderColor: string; + selectBorderColor: string; + hoverBorderColor: string; + ringColor: string; + strokeColor: string; + fillColor: string; +} +export declare function getColorClassNames(color: Color | string, shade?: number): ColorClassNames; +export {}; diff --git a/dist/lib/utils.js b/dist/lib/utils.js new file mode 100644 index 000000000..24c4e58da --- /dev/null +++ b/dist/lib/utils.js @@ -0,0 +1 @@ +import{DeltaTypes as e}from"./constants.js";import{getIsBaseColor as r}from"./inputTypes.js";const o=(r,o)=>{if(o||r===e.Unchanged)return r;switch(r){case e.Increase:return e.Decrease;case e.ModerateIncrease:return e.ModerateDecrease;case e.Decrease:return e.Increase;case e.ModerateDecrease:return e.ModerateIncrease}return""},t=e=>e.toString(),l=e=>e.reduce(((e,r)=>e+r),0),n=(e,r)=>{for(let o=0;o{e.forEach((e=>{"function"==typeof e?e(r):null!=e&&(e.current=r)}))}}function s(e){return r=>`tremor-${e}-${r}`}function $(e,o){const t=r(e);if("white"===e||"black"===e||"transparent"===e||!o||!t){const r=(e=>e.includes("#")||e.includes("--")||e.includes("rgb"))(e)?`[${e}]`:e;return{bgColor:`bg-${r}`,hoverBgColor:`hover:bg-${r}`,selectBgColor:`ui-selected:bg-${r}`,textColor:`text-${r}`,selectTextColor:`ui-selected:text-${r}`,hoverTextColor:`hover:text-${r}`,borderColor:`border-${r}`,selectBorderColor:`ui-selected:border-${r}`,hoverBorderColor:`hover:border-${r}`,ringColor:`ring-${r}`,strokeColor:`stroke-${r}`,fillColor:`fill-${r}`}}return{bgColor:`bg-${e}-${o}`,selectBgColor:`ui-selected:bg-${e}-${o}`,hoverBgColor:`hover:bg-${e}-${o}`,textColor:`text-${e}-${o}`,selectTextColor:`ui-selected:text-${e}-${o}`,hoverTextColor:`hover:text-${e}-${o}`,borderColor:`border-${e}-${o}`,selectBorderColor:`ui-selected:border-${e}-${o}`,hoverBorderColor:`hover:border-${e}-${o}`,ringColor:`ring-${e}-${o}`,strokeColor:`stroke-${e}-${o}`,fillColor:`fill-${e}-${o}`}}export{t as defaultValueFormatter,$ as getColorClassNames,n as isValueInArray,s as makeClassName,o as mapInputsToDeltaType,c as mergeRefs,l as sumNumericArray}; From 7a949b33322506951f244606712f07d2b16c6638 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 15:35:26 +0800 Subject: [PATCH 11/48] modified ditignore --- .gitignore | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 261960448..fc740099e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules +dist .DS_Store storybook-static package-lock.json diff --git a/package.json b/package.json index a0c99ea1c..10a35e142 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@upsolve-labs/tremor2axis", - "version": "0.0.0-development", + "version": "0.0.1-development", "description": "The React library to build dashboards faster.", "scripts": { "prebuild": "rm -rf dist", From af25d81886db0e7f9b5aff1d0eb349ee7d90a33a Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 15:37:39 +0800 Subject: [PATCH 12/48] changed version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10a35e142..c17e643e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@upsolve-labs/tremor2axis", - "version": "0.0.1-development", + "version": "0.0.1", "description": "The React library to build dashboards faster.", "scripts": { "prebuild": "rm -rf dist", From a807a2cb9a30bb22bb51f8833e01d0b53f80562b Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 16:40:13 +0800 Subject: [PATCH 13/48] bumped version --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c17e643e2..c51bd59ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@upsolve-labs/tremor2axis", - "version": "0.0.1", + "version": "0.0.2", + "type": "module", "description": "The React library to build dashboards faster.", "scripts": { "prebuild": "rm -rf dist", From fb8c597574ff690761c6cac2ddb3cc72e2301f20 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Sat, 20 Apr 2024 16:49:05 +0800 Subject: [PATCH 14/48] swapped to common js --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c51bd59ef..00e06a5e1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@upsolve-labs/tremor2axis", - "version": "0.0.2", - "type": "module", + "version": "0.0.3", + "type": "commonjs", "description": "The React library to build dashboards faster.", "scripts": { "prebuild": "rm -rf dist", From 5a8826e45e508df10887d290182d6366f833a474 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Thu, 25 Apr 2024 01:45:46 -0400 Subject: [PATCH 15/48] Fixed release --- dist/assets/ArrowDownHeadIcon.cjs | 1 - dist/assets/ArrowDownHeadIcon.d.ts | 5 - dist/assets/ArrowDownHeadIcon.js | 1 - dist/assets/ArrowDownIcon.cjs | 1 - dist/assets/ArrowDownIcon.d.ts | 5 - dist/assets/ArrowDownIcon.js | 1 - dist/assets/ArrowDownRightIcon.cjs | 1 - dist/assets/ArrowDownRightIcon.d.ts | 5 - dist/assets/ArrowDownRightIcon.js | 1 - dist/assets/ArrowLeftHeadIcon.cjs | 1 - dist/assets/ArrowLeftHeadIcon.d.ts | 5 - dist/assets/ArrowLeftHeadIcon.js | 1 - dist/assets/ArrowRightHeadIcon.cjs | 1 - dist/assets/ArrowRightHeadIcon.d.ts | 5 - dist/assets/ArrowRightHeadIcon.js | 1 - dist/assets/ArrowRightIcon.cjs | 1 - dist/assets/ArrowRightIcon.d.ts | 5 - dist/assets/ArrowRightIcon.js | 1 - dist/assets/ArrowUpHeadIcon.cjs | 1 - dist/assets/ArrowUpHeadIcon.d.ts | 5 - dist/assets/ArrowUpHeadIcon.js | 1 - dist/assets/ArrowUpIcon.cjs | 1 - dist/assets/ArrowUpIcon.d.ts | 5 - dist/assets/ArrowUpIcon.js | 1 - dist/assets/ArrowUpRightIcon.cjs | 1 - dist/assets/ArrowUpRightIcon.d.ts | 5 - dist/assets/ArrowUpRightIcon.js | 1 - dist/assets/CalendarIcon.cjs | 1 - dist/assets/CalendarIcon.d.ts | 5 - dist/assets/CalendarIcon.js | 1 - dist/assets/ChevronLeftFill.cjs | 1 - dist/assets/ChevronLeftFill.d.ts | 5 - dist/assets/ChevronLeftFill.js | 1 - dist/assets/ChevronRightFill.cjs | 1 - dist/assets/ChevronRightFill.d.ts | 5 - dist/assets/ChevronRightFill.js | 1 - dist/assets/DoubleArrowLeftHeadIcon.cjs | 1 - dist/assets/DoubleArrowLeftHeadIcon.d.ts | 5 - dist/assets/DoubleArrowLeftHeadIcon.js | 1 - dist/assets/DoubleArrowRightHeadIcon.cjs | 1 - dist/assets/DoubleArrowRightHeadIcon.d.ts | 5 - dist/assets/DoubleArrowRightHeadIcon.js | 1 - dist/assets/ExclamationFilledIcon.cjs | 1 - dist/assets/ExclamationFilledIcon.d.ts | 5 - dist/assets/ExclamationFilledIcon.js | 1 - dist/assets/EyeIcon.cjs | 1 - dist/assets/EyeIcon.d.ts | 5 - dist/assets/EyeIcon.js | 1 - dist/assets/EyeOffIcon.cjs | 1 - dist/assets/EyeOffIcon.d.ts | 5 - dist/assets/EyeOffIcon.js | 1 - dist/assets/LoadingSpinner.cjs | 1 - dist/assets/LoadingSpinner.d.ts | 5 - dist/assets/LoadingSpinner.js | 1 - dist/assets/MinusIcon.cjs | 1 - dist/assets/MinusIcon.d.ts | 5 - dist/assets/MinusIcon.js | 1 - dist/assets/PlusIcon.cjs | 1 - dist/assets/PlusIcon.d.ts | 5 - dist/assets/PlusIcon.js | 1 - dist/assets/SearchIcon.cjs | 1 - dist/assets/SearchIcon.d.ts | 5 - dist/assets/SearchIcon.js | 1 - dist/assets/XCircleIcon.cjs | 1 - dist/assets/XCircleIcon.d.ts | 5 - dist/assets/XCircleIcon.js | 1 - dist/assets/XIcon.cjs | 1 - dist/assets/XIcon.d.ts | 5 - dist/assets/XIcon.js | 1 - dist/assets/index.d.ts | 22 - .../chart-elements/AreaChart/AreaChart.cjs | 2 - .../chart-elements/AreaChart/AreaChart.d.ts | 11 - .../chart-elements/AreaChart/AreaChart.js | 2 - .../chart-elements/AreaChart/index.d.ts | 2 - .../chart-elements/BarChart/BarChart.cjs | 2 - .../chart-elements/BarChart/BarChart.d.ts | 9 - .../chart-elements/BarChart/BarChart.js | 2 - .../chart-elements/BarChart/index.d.ts | 2 - .../chart-elements/DonutChart/DonutChart.cjs | 2 - .../chart-elements/DonutChart/DonutChart.d.ts | 24 - .../chart-elements/DonutChart/DonutChart.js | 2 - .../DonutChart/DonutChartTooltip.cjs | 1 - .../DonutChart/DonutChartTooltip.d.ts | 8 - .../DonutChart/DonutChartTooltip.js | 1 - .../chart-elements/DonutChart/index.d.ts | 2 - .../chart-elements/DonutChart/inputParser.cjs | 1 - .../DonutChart/inputParser.d.ts | 3 - .../chart-elements/DonutChart/inputParser.js | 1 - .../chart-elements/LineChart/LineChart.cjs | 2 - .../chart-elements/LineChart/LineChart.d.ts | 9 - .../chart-elements/LineChart/LineChart.js | 2 - .../chart-elements/LineChart/index.d.ts | 2 - .../ScatterChart/ScatterChart.cjs | 2 - .../ScatterChart/ScatterChart.d.ts | 48 -- .../ScatterChart/ScatterChart.js | 2 - .../ScatterChart/ScatterChartTooltip.cjs | 1 - .../ScatterChart/ScatterChartTooltip.d.ts | 22 - .../ScatterChart/ScatterChartTooltip.js | 1 - .../chart-elements/ScatterChart/index.d.ts | 2 - .../common/BaseAnimationTimingProps.d.ts | 5 - .../chart-elements/common/BaseChartProps.d.ts | 42 -- .../chart-elements/common/ChartLegend.cjs | 1 - .../chart-elements/common/ChartLegend.d.ts | 4 - .../chart-elements/common/ChartLegend.js | 1 - .../chart-elements/common/ChartTooltip.cjs | 1 - .../chart-elements/common/ChartTooltip.d.ts | 20 - .../chart-elements/common/ChartTooltip.js | 1 - .../common/CustomTooltipProps.d.ts | 6 - .../chart-elements/common/NoData.cjs | 1 - .../chart-elements/common/NoData.d.ts | 6 - .../chart-elements/common/NoData.js | 1 - .../chart-elements/common/index.d.ts | 2 - .../chart-elements/common/utils.cjs | 1 - .../chart-elements/common/utils.d.ts | 6 - .../components/chart-elements/common/utils.js | 1 - dist/components/chart-elements/index.d.ts | 7 - dist/components/icon-elements/Badge/Badge.cjs | 2 - .../components/icon-elements/Badge/Badge.d.ts | 10 - dist/components/icon-elements/Badge/Badge.js | 2 - .../components/icon-elements/Badge/index.d.ts | 2 - .../components/icon-elements/Badge/styles.cjs | 1 - .../icon-elements/Badge/styles.d.ts | 14 - dist/components/icon-elements/Badge/styles.js | 1 - .../icon-elements/BadgeDelta/BadgeDelta.cjs | 2 - .../icon-elements/BadgeDelta/BadgeDelta.d.ts | 10 - .../icon-elements/BadgeDelta/BadgeDelta.js | 2 - .../icon-elements/BadgeDelta/index.d.ts | 2 - .../icon-elements/BadgeDelta/styles.cjs | 1 - .../icon-elements/BadgeDelta/styles.d.ts | 29 - .../icon-elements/BadgeDelta/styles.js | 1 - dist/components/icon-elements/Icon/Icon.cjs | 2 - dist/components/icon-elements/Icon/Icon.d.ts | 14 - dist/components/icon-elements/Icon/Icon.js | 2 - dist/components/icon-elements/Icon/index.d.ts | 2 - dist/components/icon-elements/Icon/styles.cjs | 1 - .../components/icon-elements/Icon/styles.d.ts | 29 - dist/components/icon-elements/Icon/styles.js | 1 - dist/components/icon-elements/index.d.ts | 3 - dist/components/index.d.ts | 8 - dist/components/input-elements/BaseInput.cjs | 2 - dist/components/input-elements/BaseInput.d.ts | 15 - dist/components/input-elements/BaseInput.js | 2 - .../input-elements/Button/Button.cjs | 2 - .../input-elements/Button/Button.d.ts | 25 - .../input-elements/Button/Button.js | 2 - .../input-elements/Button/index.d.ts | 2 - .../input-elements/Button/styles.cjs | 1 - .../input-elements/Button/styles.d.ts | 56 -- .../input-elements/Button/styles.js | 1 - .../input-elements/Calendar/Calendar.cjs | 2 - .../input-elements/Calendar/Calendar.d.ts | 9 - .../input-elements/Calendar/Calendar.js | 2 - .../input-elements/Calendar/NavButton.cjs | 1 - .../input-elements/Calendar/NavButton.d.ts | 7 - .../input-elements/Calendar/NavButton.js | 1 - .../input-elements/Calendar/index.d.ts | 1 - .../input-elements/DatePicker/DatePicker.cjs | 2 - .../input-elements/DatePicker/DatePicker.d.ts | 24 - .../input-elements/DatePicker/DatePicker.js | 2 - .../DatePicker/datePickerUtils.cjs | 1 - .../DatePicker/datePickerUtils.d.ts | 1 - .../DatePicker/datePickerUtils.js | 1 - .../input-elements/DatePicker/index.d.ts | 2 - .../DateRangePicker/DateRangePicker.cjs | 2 - .../DateRangePicker/DateRangePicker.d.ts | 30 - .../DateRangePicker/DateRangePicker.js | 2 - .../DateRangePicker/DateRangePickerItem.cjs | 2 - .../DateRangePicker/DateRangePickerItem.d.ts | 8 - .../DateRangePicker/DateRangePickerItem.js | 2 - .../DateRangePicker/dateRangePickerUtils.cjs | 1 - .../DateRangePicker/dateRangePickerUtils.d.ts | 12 - .../DateRangePicker/dateRangePickerUtils.js | 1 - .../input-elements/DateRangePicker/index.d.ts | 4 - .../MultiSelect/MultiSelect.cjs | 2 - .../MultiSelect/MultiSelect.d.ts | 17 - .../input-elements/MultiSelect/MultiSelect.js | 2 - .../MultiSelect/MultiSelectItem.cjs | 2 - .../MultiSelect/MultiSelectItem.d.ts | 6 - .../MultiSelect/MultiSelectItem.js | 2 - .../input-elements/MultiSelect/index.d.ts | 4 - .../NumberInput/NumberInput.cjs | 2 - .../NumberInput/NumberInput.d.ts | 10 - .../input-elements/NumberInput/NumberInput.js | 2 - .../input-elements/NumberInput/index.d.ts | 2 - .../SearchSelect/SearchSelect.cjs | 2 - .../SearchSelect/SearchSelect.d.ts | 19 - .../SearchSelect/SearchSelect.js | 2 - .../SearchSelect/SearchSelectItem.cjs | 2 - .../SearchSelect/SearchSelectItem.d.ts | 7 - .../SearchSelect/SearchSelectItem.js | 2 - .../input-elements/SearchSelect/index.d.ts | 4 - .../input-elements/Select/Select.cjs | 2 - .../input-elements/Select/Select.d.ts | 17 - .../input-elements/Select/Select.js | 2 - .../input-elements/Select/SelectItem.cjs | 2 - .../input-elements/Select/SelectItem.d.ts | 7 - .../input-elements/Select/SelectItem.js | 2 - .../input-elements/Select/index.d.ts | 4 - .../input-elements/Switch/Switch.cjs | 2 - .../input-elements/Switch/Switch.d.ts | 17 - .../input-elements/Switch/Switch.js | 2 - .../input-elements/Switch/index.d.ts | 2 - dist/components/input-elements/Tabs/Tab.cjs | 2 - dist/components/input-elements/Tabs/Tab.d.ts | 6 - dist/components/input-elements/Tabs/Tab.js | 2 - .../input-elements/Tabs/TabGroup.cjs | 2 - .../input-elements/Tabs/TabGroup.d.ts | 9 - .../input-elements/Tabs/TabGroup.js | 2 - .../input-elements/Tabs/TabList.cjs | 2 - .../input-elements/Tabs/TabList.d.ts | 11 - .../components/input-elements/Tabs/TabList.js | 2 - .../input-elements/Tabs/TabPanel.cjs | 2 - .../input-elements/Tabs/TabPanel.d.ts | 3 - .../input-elements/Tabs/TabPanel.js | 2 - .../input-elements/Tabs/TabPanels.cjs | 2 - .../input-elements/Tabs/TabPanels.d.ts | 3 - .../input-elements/Tabs/TabPanels.js | 2 - .../components/input-elements/Tabs/index.d.ts | 8 - .../input-elements/TextInput/TextInput.cjs | 2 - .../input-elements/TextInput/TextInput.d.ts | 23 - .../input-elements/TextInput/TextInput.js | 2 - .../input-elements/TextInput/index.d.ts | 2 - .../input-elements/Textarea/Textarea.cjs | 2 - .../input-elements/Textarea/Textarea.d.ts | 11 - .../input-elements/Textarea/Textarea.js | 2 - .../input-elements/Textarea/index.d.ts | 2 - dist/components/input-elements/index.d.ts | 11 - .../components/input-elements/selectUtils.cjs | 1 - .../input-elements/selectUtils.d.ts | 10 - dist/components/input-elements/selectUtils.js | 1 - .../layout-elements/Accordion/Accordion.cjs | 2 - .../layout-elements/Accordion/Accordion.d.ts | 10 - .../layout-elements/Accordion/Accordion.js | 2 - .../Accordion/AccordionBody.cjs | 2 - .../Accordion/AccordionBody.d.ts | 3 - .../Accordion/AccordionBody.js | 2 - .../Accordion/AccordionHeader.cjs | 2 - .../Accordion/AccordionHeader.d.ts | 3 - .../Accordion/AccordionHeader.js | 2 - .../Accordion/AccordionList.cjs | 2 - .../Accordion/AccordionList.d.ts | 6 - .../Accordion/AccordionList.js | 2 - .../layout-elements/Accordion/index.d.ts | 6 - dist/components/layout-elements/Card/Card.cjs | 1 - .../components/layout-elements/Card/Card.d.ts | 8 - dist/components/layout-elements/Card/Card.js | 1 - .../layout-elements/Card/index.d.ts | 2 - .../layout-elements/Dialog/Dialog.cjs | 1 - .../layout-elements/Dialog/Dialog.d.ts | 16 - .../layout-elements/Dialog/Dialog.js | 1 - .../layout-elements/Dialog/DialogPanel.cjs | 1 - .../layout-elements/Dialog/DialogPanel.d.ts | 4 - .../layout-elements/Dialog/DialogPanel.js | 1 - .../layout-elements/Dialog/index.d.ts | 2 - .../layout-elements/Divider/Divider.cjs | 1 - .../layout-elements/Divider/Divider.d.ts | 3 - .../layout-elements/Divider/Divider.js | 1 - .../layout-elements/Divider/index.d.ts | 1 - dist/components/layout-elements/Flex/Flex.cjs | 1 - .../components/layout-elements/Flex/Flex.d.ts | 10 - dist/components/layout-elements/Flex/Flex.js | 1 - .../layout-elements/Flex/index.d.ts | 2 - dist/components/layout-elements/Grid/Col.cjs | 1 - dist/components/layout-elements/Grid/Col.d.ts | 9 - dist/components/layout-elements/Grid/Col.js | 1 - dist/components/layout-elements/Grid/Grid.cjs | 1 - .../components/layout-elements/Grid/Grid.d.ts | 10 - dist/components/layout-elements/Grid/Grid.js | 1 - .../layout-elements/Grid/index.d.ts | 4 - .../layout-elements/Grid/styles.cjs | 1 - .../layout-elements/Grid/styles.d.ts | 11 - .../components/layout-elements/Grid/styles.js | 1 - dist/components/layout-elements/index.d.ts | 6 - dist/components/list-elements/List/List.cjs | 1 - dist/components/list-elements/List/List.d.ts | 3 - dist/components/list-elements/List/List.js | 1 - .../list-elements/List/ListItem.cjs | 1 - .../list-elements/List/ListItem.d.ts | 3 - .../components/list-elements/List/ListItem.js | 1 - dist/components/list-elements/List/index.d.ts | 2 - dist/components/list-elements/Table/Table.cjs | 1 - .../components/list-elements/Table/Table.d.ts | 3 - dist/components/list-elements/Table/Table.js | 1 - .../list-elements/Table/TableBody.cjs | 1 - .../list-elements/Table/TableBody.d.ts | 3 - .../list-elements/Table/TableBody.js | 1 - .../list-elements/Table/TableCell.cjs | 1 - .../list-elements/Table/TableCell.d.ts | 3 - .../list-elements/Table/TableCell.js | 1 - .../list-elements/Table/TableFoot.cjs | 1 - .../list-elements/Table/TableFoot.d.ts | 3 - .../list-elements/Table/TableFoot.js | 1 - .../list-elements/Table/TableFooterCell.cjs | 1 - .../list-elements/Table/TableFooterCell.d.ts | 3 - .../list-elements/Table/TableFooterCell.js | 1 - .../list-elements/Table/TableHead.cjs | 1 - .../list-elements/Table/TableHead.d.ts | 3 - .../list-elements/Table/TableHead.js | 1 - .../list-elements/Table/TableHeaderCell.cjs | 1 - .../list-elements/Table/TableHeaderCell.d.ts | 3 - .../list-elements/Table/TableHeaderCell.js | 1 - .../list-elements/Table/TableRow.cjs | 1 - .../list-elements/Table/TableRow.d.ts | 3 - .../list-elements/Table/TableRow.js | 1 - .../components/list-elements/Table/index.d.ts | 8 - dist/components/list-elements/index.d.ts | 2 - .../SparkAreaChart/SparkAreaChart.cjs | 2 - .../SparkAreaChart/SparkAreaChart.d.ts | 11 - .../SparkAreaChart/SparkAreaChart.js | 2 - .../spark-elements/SparkAreaChart/index.d.ts | 2 - .../SparkBarChart/SparkBarChart.cjs | 2 - .../SparkBarChart/SparkBarChart.d.ts | 8 - .../SparkBarChart/SparkBarChart.js | 2 - .../spark-elements/SparkBarChart/index.d.ts | 2 - .../SparkLineChart/SparkLineChart.cjs | 2 - .../SparkLineChart/SparkLineChart.d.ts | 9 - .../SparkLineChart/SparkLineChart.js | 2 - .../spark-elements/SparkLineChart/index.d.ts | 2 - .../common/BaseSparkChartProps.d.ts | 22 - dist/components/spark-elements/index.d.ts | 3 - dist/components/text-elements/Bold/Bold.cjs | 1 - dist/components/text-elements/Bold/Bold.d.ts | 3 - dist/components/text-elements/Bold/Bold.js | 1 - dist/components/text-elements/Bold/index.d.ts | 1 - .../text-elements/Callout/Callout.cjs | 1 - .../text-elements/Callout/Callout.d.ts | 9 - .../text-elements/Callout/Callout.js | 1 - .../text-elements/Callout/index.d.ts | 2 - .../text-elements/Italic/Italic.cjs | 1 - .../text-elements/Italic/Italic.d.ts | 3 - .../components/text-elements/Italic/Italic.js | 1 - .../text-elements/Italic/index.d.ts | 1 - .../text-elements/Legend/Legend.cjs | 1 - .../text-elements/Legend/Legend.d.ts | 22 - .../components/text-elements/Legend/Legend.js | 1 - .../text-elements/Legend/index.d.ts | 2 - .../text-elements/Metric/Metric.cjs | 1 - .../text-elements/Metric/Metric.d.ts | 7 - .../components/text-elements/Metric/Metric.js | 1 - .../text-elements/Metric/index.d.ts | 2 - .../text-elements/Subtitle/Subtitle.cjs | 1 - .../text-elements/Subtitle/Subtitle.d.ts | 7 - .../text-elements/Subtitle/Subtitle.js | 1 - .../text-elements/Subtitle/index.d.ts | 2 - dist/components/text-elements/Text/Text.cjs | 1 - dist/components/text-elements/Text/Text.d.ts | 7 - dist/components/text-elements/Text/Text.js | 1 - dist/components/text-elements/Text/index.d.ts | 2 - dist/components/text-elements/Title/Title.cjs | 1 - .../components/text-elements/Title/Title.d.ts | 7 - dist/components/text-elements/Title/Title.js | 1 - .../components/text-elements/Title/index.d.ts | 2 - dist/components/text-elements/index.d.ts | 8 - .../util-elements/Tooltip/Tooltip.cjs | 1 - .../util-elements/Tooltip/Tooltip.d.ts | 27 - .../util-elements/Tooltip/Tooltip.js | 1 - .../util-elements/Tooltip/index.d.ts | 2 - dist/components/util-elements/index.d.ts | 1 - .../vis-elements/BarList/BarList.cjs | 1 - .../vis-elements/BarList/BarList.d.ts | 26 - .../vis-elements/BarList/BarList.js | 1 - .../vis-elements/BarList/index.d.ts | 2 - .../vis-elements/CategoryBar/CategoryBar.cjs | 2 - .../vis-elements/CategoryBar/CategoryBar.d.ts | 12 - .../vis-elements/CategoryBar/CategoryBar.js | 2 - .../vis-elements/CategoryBar/index.d.ts | 2 - .../vis-elements/DeltaBar/DeltaBar.cjs | 2 - .../vis-elements/DeltaBar/DeltaBar.d.ts | 9 - .../vis-elements/DeltaBar/DeltaBar.js | 2 - .../vis-elements/DeltaBar/index.d.ts | 2 - .../vis-elements/DeltaBar/styles.cjs | 1 - .../vis-elements/DeltaBar/styles.d.ts | 6 - .../vis-elements/DeltaBar/styles.js | 1 - .../vis-elements/MarkerBar/MarkerBar.cjs | 2 - .../vis-elements/MarkerBar/MarkerBar.d.ts | 13 - .../vis-elements/MarkerBar/MarkerBar.js | 2 - .../vis-elements/MarkerBar/index.d.ts | 2 - .../vis-elements/ProgressBar/ProgressBar.cjs | 2 - .../vis-elements/ProgressBar/ProgressBar.d.ts | 11 - .../vis-elements/ProgressBar/ProgressBar.js | 2 - .../vis-elements/ProgressBar/index.d.ts | 2 - .../ProgressCircle/ProgressCircle.cjs | 1 - .../ProgressCircle/ProgressCircle.d.ts | 15 - .../ProgressCircle/ProgressCircle.js | 1 - .../vis-elements/ProgressCircle/index.d.ts | 2 - .../vis-elements/Tracker/Tracker.cjs | 2 - .../vis-elements/Tracker/Tracker.d.ts | 13 - .../vis-elements/Tracker/Tracker.js | 2 - .../vis-elements/Tracker/index.d.ts | 2 - dist/components/vis-elements/index.d.ts | 7 - dist/contexts/BaseColorContext.cjs | 1 - dist/contexts/BaseColorContext.d.ts | 3 - dist/contexts/BaseColorContext.js | 1 - dist/contexts/IndexContext.cjs | 1 - dist/contexts/IndexContext.d.ts | 3 - dist/contexts/IndexContext.js | 1 - dist/contexts/RootStylesContext.cjs | 1 - dist/contexts/RootStylesContext.d.ts | 3 - dist/contexts/RootStylesContext.js | 1 - dist/contexts/SelectedValueContext.cjs | 1 - dist/contexts/SelectedValueContext.d.ts | 7 - dist/contexts/SelectedValueContext.js | 1 - dist/contexts/index.d.ts | 4 - dist/hooks/index.d.ts | 2 - dist/hooks/useInternalState.cjs | 1 - dist/hooks/useInternalState.d.ts | 3 - dist/hooks/useInternalState.js | 1 - dist/hooks/useOnWindowResize.cjs | 1 - dist/hooks/useOnWindowResize.d.ts | 4 - dist/hooks/useOnWindowResize.js | 1 - dist/index.cjs | 1 - dist/index.d.ts | 660 ------------------ dist/index.js | 1 - dist/lib/constants.cjs | 1 - dist/lib/constants.d.ts | 16 - dist/lib/constants.js | 1 - dist/lib/index.d.ts | 5 - dist/lib/inputTypes.cjs | 1 - dist/lib/inputTypes.d.ts | 25 - dist/lib/inputTypes.js | 1 - dist/lib/theme.cjs | 1 - dist/lib/theme.d.ts | 24 - dist/lib/theme.js | 1 - dist/lib/tremorTwMerge.cjs | 1 - dist/lib/tremorTwMerge.d.ts | 1 - dist/lib/tremorTwMerge.js | 1 - dist/lib/utils.cjs | 1 - dist/lib/utils.d.ts | 25 - dist/lib/utils.js | 1 - package.json | 4 +- 430 files changed, 2 insertions(+), 2484 deletions(-) delete mode 100644 dist/assets/ArrowDownHeadIcon.cjs delete mode 100644 dist/assets/ArrowDownHeadIcon.d.ts delete mode 100644 dist/assets/ArrowDownHeadIcon.js delete mode 100644 dist/assets/ArrowDownIcon.cjs delete mode 100644 dist/assets/ArrowDownIcon.d.ts delete mode 100644 dist/assets/ArrowDownIcon.js delete mode 100644 dist/assets/ArrowDownRightIcon.cjs delete mode 100644 dist/assets/ArrowDownRightIcon.d.ts delete mode 100644 dist/assets/ArrowDownRightIcon.js delete mode 100644 dist/assets/ArrowLeftHeadIcon.cjs delete mode 100644 dist/assets/ArrowLeftHeadIcon.d.ts delete mode 100644 dist/assets/ArrowLeftHeadIcon.js delete mode 100644 dist/assets/ArrowRightHeadIcon.cjs delete mode 100644 dist/assets/ArrowRightHeadIcon.d.ts delete mode 100644 dist/assets/ArrowRightHeadIcon.js delete mode 100644 dist/assets/ArrowRightIcon.cjs delete mode 100644 dist/assets/ArrowRightIcon.d.ts delete mode 100644 dist/assets/ArrowRightIcon.js delete mode 100644 dist/assets/ArrowUpHeadIcon.cjs delete mode 100644 dist/assets/ArrowUpHeadIcon.d.ts delete mode 100644 dist/assets/ArrowUpHeadIcon.js delete mode 100644 dist/assets/ArrowUpIcon.cjs delete mode 100644 dist/assets/ArrowUpIcon.d.ts delete mode 100644 dist/assets/ArrowUpIcon.js delete mode 100644 dist/assets/ArrowUpRightIcon.cjs delete mode 100644 dist/assets/ArrowUpRightIcon.d.ts delete mode 100644 dist/assets/ArrowUpRightIcon.js delete mode 100644 dist/assets/CalendarIcon.cjs delete mode 100644 dist/assets/CalendarIcon.d.ts delete mode 100644 dist/assets/CalendarIcon.js delete mode 100644 dist/assets/ChevronLeftFill.cjs delete mode 100644 dist/assets/ChevronLeftFill.d.ts delete mode 100644 dist/assets/ChevronLeftFill.js delete mode 100644 dist/assets/ChevronRightFill.cjs delete mode 100644 dist/assets/ChevronRightFill.d.ts delete mode 100644 dist/assets/ChevronRightFill.js delete mode 100644 dist/assets/DoubleArrowLeftHeadIcon.cjs delete mode 100644 dist/assets/DoubleArrowLeftHeadIcon.d.ts delete mode 100644 dist/assets/DoubleArrowLeftHeadIcon.js delete mode 100644 dist/assets/DoubleArrowRightHeadIcon.cjs delete mode 100644 dist/assets/DoubleArrowRightHeadIcon.d.ts delete mode 100644 dist/assets/DoubleArrowRightHeadIcon.js delete mode 100644 dist/assets/ExclamationFilledIcon.cjs delete mode 100644 dist/assets/ExclamationFilledIcon.d.ts delete mode 100644 dist/assets/ExclamationFilledIcon.js delete mode 100644 dist/assets/EyeIcon.cjs delete mode 100644 dist/assets/EyeIcon.d.ts delete mode 100644 dist/assets/EyeIcon.js delete mode 100644 dist/assets/EyeOffIcon.cjs delete mode 100644 dist/assets/EyeOffIcon.d.ts delete mode 100644 dist/assets/EyeOffIcon.js delete mode 100644 dist/assets/LoadingSpinner.cjs delete mode 100644 dist/assets/LoadingSpinner.d.ts delete mode 100644 dist/assets/LoadingSpinner.js delete mode 100644 dist/assets/MinusIcon.cjs delete mode 100644 dist/assets/MinusIcon.d.ts delete mode 100644 dist/assets/MinusIcon.js delete mode 100644 dist/assets/PlusIcon.cjs delete mode 100644 dist/assets/PlusIcon.d.ts delete mode 100644 dist/assets/PlusIcon.js delete mode 100644 dist/assets/SearchIcon.cjs delete mode 100644 dist/assets/SearchIcon.d.ts delete mode 100644 dist/assets/SearchIcon.js delete mode 100644 dist/assets/XCircleIcon.cjs delete mode 100644 dist/assets/XCircleIcon.d.ts delete mode 100644 dist/assets/XCircleIcon.js delete mode 100644 dist/assets/XIcon.cjs delete mode 100644 dist/assets/XIcon.d.ts delete mode 100644 dist/assets/XIcon.js delete mode 100644 dist/assets/index.d.ts delete mode 100644 dist/components/chart-elements/AreaChart/AreaChart.cjs delete mode 100644 dist/components/chart-elements/AreaChart/AreaChart.d.ts delete mode 100644 dist/components/chart-elements/AreaChart/AreaChart.js delete mode 100644 dist/components/chart-elements/AreaChart/index.d.ts delete mode 100644 dist/components/chart-elements/BarChart/BarChart.cjs delete mode 100644 dist/components/chart-elements/BarChart/BarChart.d.ts delete mode 100644 dist/components/chart-elements/BarChart/BarChart.js delete mode 100644 dist/components/chart-elements/BarChart/index.d.ts delete mode 100644 dist/components/chart-elements/DonutChart/DonutChart.cjs delete mode 100644 dist/components/chart-elements/DonutChart/DonutChart.d.ts delete mode 100644 dist/components/chart-elements/DonutChart/DonutChart.js delete mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs delete mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts delete mode 100644 dist/components/chart-elements/DonutChart/DonutChartTooltip.js delete mode 100644 dist/components/chart-elements/DonutChart/index.d.ts delete mode 100644 dist/components/chart-elements/DonutChart/inputParser.cjs delete mode 100644 dist/components/chart-elements/DonutChart/inputParser.d.ts delete mode 100644 dist/components/chart-elements/DonutChart/inputParser.js delete mode 100644 dist/components/chart-elements/LineChart/LineChart.cjs delete mode 100644 dist/components/chart-elements/LineChart/LineChart.d.ts delete mode 100644 dist/components/chart-elements/LineChart/LineChart.js delete mode 100644 dist/components/chart-elements/LineChart/index.d.ts delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.cjs delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.d.ts delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChart.js delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts delete mode 100644 dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js delete mode 100644 dist/components/chart-elements/ScatterChart/index.d.ts delete mode 100644 dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts delete mode 100644 dist/components/chart-elements/common/BaseChartProps.d.ts delete mode 100644 dist/components/chart-elements/common/ChartLegend.cjs delete mode 100644 dist/components/chart-elements/common/ChartLegend.d.ts delete mode 100644 dist/components/chart-elements/common/ChartLegend.js delete mode 100644 dist/components/chart-elements/common/ChartTooltip.cjs delete mode 100644 dist/components/chart-elements/common/ChartTooltip.d.ts delete mode 100644 dist/components/chart-elements/common/ChartTooltip.js delete mode 100644 dist/components/chart-elements/common/CustomTooltipProps.d.ts delete mode 100644 dist/components/chart-elements/common/NoData.cjs delete mode 100644 dist/components/chart-elements/common/NoData.d.ts delete mode 100644 dist/components/chart-elements/common/NoData.js delete mode 100644 dist/components/chart-elements/common/index.d.ts delete mode 100644 dist/components/chart-elements/common/utils.cjs delete mode 100644 dist/components/chart-elements/common/utils.d.ts delete mode 100644 dist/components/chart-elements/common/utils.js delete mode 100644 dist/components/chart-elements/index.d.ts delete mode 100644 dist/components/icon-elements/Badge/Badge.cjs delete mode 100644 dist/components/icon-elements/Badge/Badge.d.ts delete mode 100644 dist/components/icon-elements/Badge/Badge.js delete mode 100644 dist/components/icon-elements/Badge/index.d.ts delete mode 100644 dist/components/icon-elements/Badge/styles.cjs delete mode 100644 dist/components/icon-elements/Badge/styles.d.ts delete mode 100644 dist/components/icon-elements/Badge/styles.js delete mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs delete mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts delete mode 100644 dist/components/icon-elements/BadgeDelta/BadgeDelta.js delete mode 100644 dist/components/icon-elements/BadgeDelta/index.d.ts delete mode 100644 dist/components/icon-elements/BadgeDelta/styles.cjs delete mode 100644 dist/components/icon-elements/BadgeDelta/styles.d.ts delete mode 100644 dist/components/icon-elements/BadgeDelta/styles.js delete mode 100644 dist/components/icon-elements/Icon/Icon.cjs delete mode 100644 dist/components/icon-elements/Icon/Icon.d.ts delete mode 100644 dist/components/icon-elements/Icon/Icon.js delete mode 100644 dist/components/icon-elements/Icon/index.d.ts delete mode 100644 dist/components/icon-elements/Icon/styles.cjs delete mode 100644 dist/components/icon-elements/Icon/styles.d.ts delete mode 100644 dist/components/icon-elements/Icon/styles.js delete mode 100644 dist/components/icon-elements/index.d.ts delete mode 100644 dist/components/index.d.ts delete mode 100644 dist/components/input-elements/BaseInput.cjs delete mode 100644 dist/components/input-elements/BaseInput.d.ts delete mode 100644 dist/components/input-elements/BaseInput.js delete mode 100644 dist/components/input-elements/Button/Button.cjs delete mode 100644 dist/components/input-elements/Button/Button.d.ts delete mode 100644 dist/components/input-elements/Button/Button.js delete mode 100644 dist/components/input-elements/Button/index.d.ts delete mode 100644 dist/components/input-elements/Button/styles.cjs delete mode 100644 dist/components/input-elements/Button/styles.d.ts delete mode 100644 dist/components/input-elements/Button/styles.js delete mode 100644 dist/components/input-elements/Calendar/Calendar.cjs delete mode 100644 dist/components/input-elements/Calendar/Calendar.d.ts delete mode 100644 dist/components/input-elements/Calendar/Calendar.js delete mode 100644 dist/components/input-elements/Calendar/NavButton.cjs delete mode 100644 dist/components/input-elements/Calendar/NavButton.d.ts delete mode 100644 dist/components/input-elements/Calendar/NavButton.js delete mode 100644 dist/components/input-elements/Calendar/index.d.ts delete mode 100644 dist/components/input-elements/DatePicker/DatePicker.cjs delete mode 100644 dist/components/input-elements/DatePicker/DatePicker.d.ts delete mode 100644 dist/components/input-elements/DatePicker/DatePicker.js delete mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.cjs delete mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.d.ts delete mode 100644 dist/components/input-elements/DatePicker/datePickerUtils.js delete mode 100644 dist/components/input-elements/DatePicker/index.d.ts delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.cjs delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePicker.js delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts delete mode 100644 dist/components/input-elements/DateRangePicker/DateRangePickerItem.js delete mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs delete mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts delete mode 100644 dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js delete mode 100644 dist/components/input-elements/DateRangePicker/index.d.ts delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.cjs delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.d.ts delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelect.js delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.cjs delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts delete mode 100644 dist/components/input-elements/MultiSelect/MultiSelectItem.js delete mode 100644 dist/components/input-elements/MultiSelect/index.d.ts delete mode 100644 dist/components/input-elements/NumberInput/NumberInput.cjs delete mode 100644 dist/components/input-elements/NumberInput/NumberInput.d.ts delete mode 100644 dist/components/input-elements/NumberInput/NumberInput.js delete mode 100644 dist/components/input-elements/NumberInput/index.d.ts delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.cjs delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.d.ts delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelect.js delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.cjs delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts delete mode 100644 dist/components/input-elements/SearchSelect/SearchSelectItem.js delete mode 100644 dist/components/input-elements/SearchSelect/index.d.ts delete mode 100644 dist/components/input-elements/Select/Select.cjs delete mode 100644 dist/components/input-elements/Select/Select.d.ts delete mode 100644 dist/components/input-elements/Select/Select.js delete mode 100644 dist/components/input-elements/Select/SelectItem.cjs delete mode 100644 dist/components/input-elements/Select/SelectItem.d.ts delete mode 100644 dist/components/input-elements/Select/SelectItem.js delete mode 100644 dist/components/input-elements/Select/index.d.ts delete mode 100644 dist/components/input-elements/Switch/Switch.cjs delete mode 100644 dist/components/input-elements/Switch/Switch.d.ts delete mode 100644 dist/components/input-elements/Switch/Switch.js delete mode 100644 dist/components/input-elements/Switch/index.d.ts delete mode 100644 dist/components/input-elements/Tabs/Tab.cjs delete mode 100644 dist/components/input-elements/Tabs/Tab.d.ts delete mode 100644 dist/components/input-elements/Tabs/Tab.js delete mode 100644 dist/components/input-elements/Tabs/TabGroup.cjs delete mode 100644 dist/components/input-elements/Tabs/TabGroup.d.ts delete mode 100644 dist/components/input-elements/Tabs/TabGroup.js delete mode 100644 dist/components/input-elements/Tabs/TabList.cjs delete mode 100644 dist/components/input-elements/Tabs/TabList.d.ts delete mode 100644 dist/components/input-elements/Tabs/TabList.js delete mode 100644 dist/components/input-elements/Tabs/TabPanel.cjs delete mode 100644 dist/components/input-elements/Tabs/TabPanel.d.ts delete mode 100644 dist/components/input-elements/Tabs/TabPanel.js delete mode 100644 dist/components/input-elements/Tabs/TabPanels.cjs delete mode 100644 dist/components/input-elements/Tabs/TabPanels.d.ts delete mode 100644 dist/components/input-elements/Tabs/TabPanels.js delete mode 100644 dist/components/input-elements/Tabs/index.d.ts delete mode 100644 dist/components/input-elements/TextInput/TextInput.cjs delete mode 100644 dist/components/input-elements/TextInput/TextInput.d.ts delete mode 100644 dist/components/input-elements/TextInput/TextInput.js delete mode 100644 dist/components/input-elements/TextInput/index.d.ts delete mode 100644 dist/components/input-elements/Textarea/Textarea.cjs delete mode 100644 dist/components/input-elements/Textarea/Textarea.d.ts delete mode 100644 dist/components/input-elements/Textarea/Textarea.js delete mode 100644 dist/components/input-elements/Textarea/index.d.ts delete mode 100644 dist/components/input-elements/index.d.ts delete mode 100644 dist/components/input-elements/selectUtils.cjs delete mode 100644 dist/components/input-elements/selectUtils.d.ts delete mode 100644 dist/components/input-elements/selectUtils.js delete mode 100644 dist/components/layout-elements/Accordion/Accordion.cjs delete mode 100644 dist/components/layout-elements/Accordion/Accordion.d.ts delete mode 100644 dist/components/layout-elements/Accordion/Accordion.js delete mode 100644 dist/components/layout-elements/Accordion/AccordionBody.cjs delete mode 100644 dist/components/layout-elements/Accordion/AccordionBody.d.ts delete mode 100644 dist/components/layout-elements/Accordion/AccordionBody.js delete mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.cjs delete mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.d.ts delete mode 100644 dist/components/layout-elements/Accordion/AccordionHeader.js delete mode 100644 dist/components/layout-elements/Accordion/AccordionList.cjs delete mode 100644 dist/components/layout-elements/Accordion/AccordionList.d.ts delete mode 100644 dist/components/layout-elements/Accordion/AccordionList.js delete mode 100644 dist/components/layout-elements/Accordion/index.d.ts delete mode 100644 dist/components/layout-elements/Card/Card.cjs delete mode 100644 dist/components/layout-elements/Card/Card.d.ts delete mode 100644 dist/components/layout-elements/Card/Card.js delete mode 100644 dist/components/layout-elements/Card/index.d.ts delete mode 100644 dist/components/layout-elements/Dialog/Dialog.cjs delete mode 100644 dist/components/layout-elements/Dialog/Dialog.d.ts delete mode 100644 dist/components/layout-elements/Dialog/Dialog.js delete mode 100644 dist/components/layout-elements/Dialog/DialogPanel.cjs delete mode 100644 dist/components/layout-elements/Dialog/DialogPanel.d.ts delete mode 100644 dist/components/layout-elements/Dialog/DialogPanel.js delete mode 100644 dist/components/layout-elements/Dialog/index.d.ts delete mode 100644 dist/components/layout-elements/Divider/Divider.cjs delete mode 100644 dist/components/layout-elements/Divider/Divider.d.ts delete mode 100644 dist/components/layout-elements/Divider/Divider.js delete mode 100644 dist/components/layout-elements/Divider/index.d.ts delete mode 100644 dist/components/layout-elements/Flex/Flex.cjs delete mode 100644 dist/components/layout-elements/Flex/Flex.d.ts delete mode 100644 dist/components/layout-elements/Flex/Flex.js delete mode 100644 dist/components/layout-elements/Flex/index.d.ts delete mode 100644 dist/components/layout-elements/Grid/Col.cjs delete mode 100644 dist/components/layout-elements/Grid/Col.d.ts delete mode 100644 dist/components/layout-elements/Grid/Col.js delete mode 100644 dist/components/layout-elements/Grid/Grid.cjs delete mode 100644 dist/components/layout-elements/Grid/Grid.d.ts delete mode 100644 dist/components/layout-elements/Grid/Grid.js delete mode 100644 dist/components/layout-elements/Grid/index.d.ts delete mode 100644 dist/components/layout-elements/Grid/styles.cjs delete mode 100644 dist/components/layout-elements/Grid/styles.d.ts delete mode 100644 dist/components/layout-elements/Grid/styles.js delete mode 100644 dist/components/layout-elements/index.d.ts delete mode 100644 dist/components/list-elements/List/List.cjs delete mode 100644 dist/components/list-elements/List/List.d.ts delete mode 100644 dist/components/list-elements/List/List.js delete mode 100644 dist/components/list-elements/List/ListItem.cjs delete mode 100644 dist/components/list-elements/List/ListItem.d.ts delete mode 100644 dist/components/list-elements/List/ListItem.js delete mode 100644 dist/components/list-elements/List/index.d.ts delete mode 100644 dist/components/list-elements/Table/Table.cjs delete mode 100644 dist/components/list-elements/Table/Table.d.ts delete mode 100644 dist/components/list-elements/Table/Table.js delete mode 100644 dist/components/list-elements/Table/TableBody.cjs delete mode 100644 dist/components/list-elements/Table/TableBody.d.ts delete mode 100644 dist/components/list-elements/Table/TableBody.js delete mode 100644 dist/components/list-elements/Table/TableCell.cjs delete mode 100644 dist/components/list-elements/Table/TableCell.d.ts delete mode 100644 dist/components/list-elements/Table/TableCell.js delete mode 100644 dist/components/list-elements/Table/TableFoot.cjs delete mode 100644 dist/components/list-elements/Table/TableFoot.d.ts delete mode 100644 dist/components/list-elements/Table/TableFoot.js delete mode 100644 dist/components/list-elements/Table/TableFooterCell.cjs delete mode 100644 dist/components/list-elements/Table/TableFooterCell.d.ts delete mode 100644 dist/components/list-elements/Table/TableFooterCell.js delete mode 100644 dist/components/list-elements/Table/TableHead.cjs delete mode 100644 dist/components/list-elements/Table/TableHead.d.ts delete mode 100644 dist/components/list-elements/Table/TableHead.js delete mode 100644 dist/components/list-elements/Table/TableHeaderCell.cjs delete mode 100644 dist/components/list-elements/Table/TableHeaderCell.d.ts delete mode 100644 dist/components/list-elements/Table/TableHeaderCell.js delete mode 100644 dist/components/list-elements/Table/TableRow.cjs delete mode 100644 dist/components/list-elements/Table/TableRow.d.ts delete mode 100644 dist/components/list-elements/Table/TableRow.js delete mode 100644 dist/components/list-elements/Table/index.d.ts delete mode 100644 dist/components/list-elements/index.d.ts delete mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs delete mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts delete mode 100644 dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js delete mode 100644 dist/components/spark-elements/SparkAreaChart/index.d.ts delete mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs delete mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts delete mode 100644 dist/components/spark-elements/SparkBarChart/SparkBarChart.js delete mode 100644 dist/components/spark-elements/SparkBarChart/index.d.ts delete mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs delete mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts delete mode 100644 dist/components/spark-elements/SparkLineChart/SparkLineChart.js delete mode 100644 dist/components/spark-elements/SparkLineChart/index.d.ts delete mode 100644 dist/components/spark-elements/common/BaseSparkChartProps.d.ts delete mode 100644 dist/components/spark-elements/index.d.ts delete mode 100644 dist/components/text-elements/Bold/Bold.cjs delete mode 100644 dist/components/text-elements/Bold/Bold.d.ts delete mode 100644 dist/components/text-elements/Bold/Bold.js delete mode 100644 dist/components/text-elements/Bold/index.d.ts delete mode 100644 dist/components/text-elements/Callout/Callout.cjs delete mode 100644 dist/components/text-elements/Callout/Callout.d.ts delete mode 100644 dist/components/text-elements/Callout/Callout.js delete mode 100644 dist/components/text-elements/Callout/index.d.ts delete mode 100644 dist/components/text-elements/Italic/Italic.cjs delete mode 100644 dist/components/text-elements/Italic/Italic.d.ts delete mode 100644 dist/components/text-elements/Italic/Italic.js delete mode 100644 dist/components/text-elements/Italic/index.d.ts delete mode 100644 dist/components/text-elements/Legend/Legend.cjs delete mode 100644 dist/components/text-elements/Legend/Legend.d.ts delete mode 100644 dist/components/text-elements/Legend/Legend.js delete mode 100644 dist/components/text-elements/Legend/index.d.ts delete mode 100644 dist/components/text-elements/Metric/Metric.cjs delete mode 100644 dist/components/text-elements/Metric/Metric.d.ts delete mode 100644 dist/components/text-elements/Metric/Metric.js delete mode 100644 dist/components/text-elements/Metric/index.d.ts delete mode 100644 dist/components/text-elements/Subtitle/Subtitle.cjs delete mode 100644 dist/components/text-elements/Subtitle/Subtitle.d.ts delete mode 100644 dist/components/text-elements/Subtitle/Subtitle.js delete mode 100644 dist/components/text-elements/Subtitle/index.d.ts delete mode 100644 dist/components/text-elements/Text/Text.cjs delete mode 100644 dist/components/text-elements/Text/Text.d.ts delete mode 100644 dist/components/text-elements/Text/Text.js delete mode 100644 dist/components/text-elements/Text/index.d.ts delete mode 100644 dist/components/text-elements/Title/Title.cjs delete mode 100644 dist/components/text-elements/Title/Title.d.ts delete mode 100644 dist/components/text-elements/Title/Title.js delete mode 100644 dist/components/text-elements/Title/index.d.ts delete mode 100644 dist/components/text-elements/index.d.ts delete mode 100644 dist/components/util-elements/Tooltip/Tooltip.cjs delete mode 100644 dist/components/util-elements/Tooltip/Tooltip.d.ts delete mode 100644 dist/components/util-elements/Tooltip/Tooltip.js delete mode 100644 dist/components/util-elements/Tooltip/index.d.ts delete mode 100644 dist/components/util-elements/index.d.ts delete mode 100644 dist/components/vis-elements/BarList/BarList.cjs delete mode 100644 dist/components/vis-elements/BarList/BarList.d.ts delete mode 100644 dist/components/vis-elements/BarList/BarList.js delete mode 100644 dist/components/vis-elements/BarList/index.d.ts delete mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.cjs delete mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.d.ts delete mode 100644 dist/components/vis-elements/CategoryBar/CategoryBar.js delete mode 100644 dist/components/vis-elements/CategoryBar/index.d.ts delete mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.cjs delete mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.d.ts delete mode 100644 dist/components/vis-elements/DeltaBar/DeltaBar.js delete mode 100644 dist/components/vis-elements/DeltaBar/index.d.ts delete mode 100644 dist/components/vis-elements/DeltaBar/styles.cjs delete mode 100644 dist/components/vis-elements/DeltaBar/styles.d.ts delete mode 100644 dist/components/vis-elements/DeltaBar/styles.js delete mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.cjs delete mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.d.ts delete mode 100644 dist/components/vis-elements/MarkerBar/MarkerBar.js delete mode 100644 dist/components/vis-elements/MarkerBar/index.d.ts delete mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.cjs delete mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.d.ts delete mode 100644 dist/components/vis-elements/ProgressBar/ProgressBar.js delete mode 100644 dist/components/vis-elements/ProgressBar/index.d.ts delete mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs delete mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts delete mode 100644 dist/components/vis-elements/ProgressCircle/ProgressCircle.js delete mode 100644 dist/components/vis-elements/ProgressCircle/index.d.ts delete mode 100644 dist/components/vis-elements/Tracker/Tracker.cjs delete mode 100644 dist/components/vis-elements/Tracker/Tracker.d.ts delete mode 100644 dist/components/vis-elements/Tracker/Tracker.js delete mode 100644 dist/components/vis-elements/Tracker/index.d.ts delete mode 100644 dist/components/vis-elements/index.d.ts delete mode 100644 dist/contexts/BaseColorContext.cjs delete mode 100644 dist/contexts/BaseColorContext.d.ts delete mode 100644 dist/contexts/BaseColorContext.js delete mode 100644 dist/contexts/IndexContext.cjs delete mode 100644 dist/contexts/IndexContext.d.ts delete mode 100644 dist/contexts/IndexContext.js delete mode 100644 dist/contexts/RootStylesContext.cjs delete mode 100644 dist/contexts/RootStylesContext.d.ts delete mode 100644 dist/contexts/RootStylesContext.js delete mode 100644 dist/contexts/SelectedValueContext.cjs delete mode 100644 dist/contexts/SelectedValueContext.d.ts delete mode 100644 dist/contexts/SelectedValueContext.js delete mode 100644 dist/contexts/index.d.ts delete mode 100644 dist/hooks/index.d.ts delete mode 100644 dist/hooks/useInternalState.cjs delete mode 100644 dist/hooks/useInternalState.d.ts delete mode 100644 dist/hooks/useInternalState.js delete mode 100644 dist/hooks/useOnWindowResize.cjs delete mode 100644 dist/hooks/useOnWindowResize.d.ts delete mode 100644 dist/hooks/useOnWindowResize.js delete mode 100644 dist/index.cjs delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/lib/constants.cjs delete mode 100644 dist/lib/constants.d.ts delete mode 100644 dist/lib/constants.js delete mode 100644 dist/lib/index.d.ts delete mode 100644 dist/lib/inputTypes.cjs delete mode 100644 dist/lib/inputTypes.d.ts delete mode 100644 dist/lib/inputTypes.js delete mode 100644 dist/lib/theme.cjs delete mode 100644 dist/lib/theme.d.ts delete mode 100644 dist/lib/theme.js delete mode 100644 dist/lib/tremorTwMerge.cjs delete mode 100644 dist/lib/tremorTwMerge.d.ts delete mode 100644 dist/lib/tremorTwMerge.js delete mode 100644 dist/lib/utils.cjs delete mode 100644 dist/lib/utils.d.ts delete mode 100644 dist/lib/utils.js diff --git a/dist/assets/ArrowDownHeadIcon.cjs b/dist/assets/ArrowDownHeadIcon.cjs deleted file mode 100644 index c72e8f62f..000000000 --- a/dist/assets/ArrowDownHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}; diff --git a/dist/assets/ArrowDownHeadIcon.d.ts b/dist/assets/ArrowDownHeadIcon.d.ts deleted file mode 100644 index 43612cc39..000000000 --- a/dist/assets/ArrowDownHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowDownHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowDownHeadIcon; diff --git a/dist/assets/ArrowDownHeadIcon.js b/dist/assets/ArrowDownHeadIcon.js deleted file mode 100644 index 60458ee57..000000000 --- a/dist/assets/ArrowDownHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))};export{r as default}; diff --git a/dist/assets/ArrowDownIcon.cjs b/dist/assets/ArrowDownIcon.cjs deleted file mode 100644 index 8211f75a3..000000000 --- a/dist/assets/ArrowDownIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))}; diff --git a/dist/assets/ArrowDownIcon.d.ts b/dist/assets/ArrowDownIcon.d.ts deleted file mode 100644 index c363446e3..000000000 --- a/dist/assets/ArrowDownIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowDownIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowDownIcon; diff --git a/dist/assets/ArrowDownIcon.js b/dist/assets/ArrowDownIcon.js deleted file mode 100644 index b88a6f827..000000000 --- a/dist/assets/ArrowDownIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))};export{r as default}; diff --git a/dist/assets/ArrowDownRightIcon.cjs b/dist/assets/ArrowDownRightIcon.cjs deleted file mode 100644 index b094aa9bf..000000000 --- a/dist/assets/ArrowDownRightIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))}; diff --git a/dist/assets/ArrowDownRightIcon.d.ts b/dist/assets/ArrowDownRightIcon.d.ts deleted file mode 100644 index 23b82cec1..000000000 --- a/dist/assets/ArrowDownRightIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowDownRightIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowDownRightIcon; diff --git a/dist/assets/ArrowDownRightIcon.js b/dist/assets/ArrowDownRightIcon.js deleted file mode 100644 index c658a7410..000000000 --- a/dist/assets/ArrowDownRightIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))};export{r as default}; diff --git a/dist/assets/ArrowLeftHeadIcon.cjs b/dist/assets/ArrowLeftHeadIcon.cjs deleted file mode 100644 index 11da8c4fa..000000000 --- a/dist/assets/ArrowLeftHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))}; diff --git a/dist/assets/ArrowLeftHeadIcon.d.ts b/dist/assets/ArrowLeftHeadIcon.d.ts deleted file mode 100644 index 7f5dd0401..000000000 --- a/dist/assets/ArrowLeftHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowLeftHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowLeftHeadIcon; diff --git a/dist/assets/ArrowLeftHeadIcon.js b/dist/assets/ArrowLeftHeadIcon.js deleted file mode 100644 index 38af406a7..000000000 --- a/dist/assets/ArrowLeftHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))};export{r as default}; diff --git a/dist/assets/ArrowRightHeadIcon.cjs b/dist/assets/ArrowRightHeadIcon.cjs deleted file mode 100644 index 6751a61dd..000000000 --- a/dist/assets/ArrowRightHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))}; diff --git a/dist/assets/ArrowRightHeadIcon.d.ts b/dist/assets/ArrowRightHeadIcon.d.ts deleted file mode 100644 index 81b62f30c..000000000 --- a/dist/assets/ArrowRightHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowRightHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowRightHeadIcon; diff --git a/dist/assets/ArrowRightHeadIcon.js b/dist/assets/ArrowRightHeadIcon.js deleted file mode 100644 index 5cfcd3964..000000000 --- a/dist/assets/ArrowRightHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))};export{r as default}; diff --git a/dist/assets/ArrowRightIcon.cjs b/dist/assets/ArrowRightIcon.cjs deleted file mode 100644 index 781d941b8..000000000 --- a/dist/assets/ArrowRightIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}; diff --git a/dist/assets/ArrowRightIcon.d.ts b/dist/assets/ArrowRightIcon.d.ts deleted file mode 100644 index 3d49d01c2..000000000 --- a/dist/assets/ArrowRightIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowRightIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowRightIcon; diff --git a/dist/assets/ArrowRightIcon.js b/dist/assets/ArrowRightIcon.js deleted file mode 100644 index b94686307..000000000 --- a/dist/assets/ArrowRightIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpHeadIcon.cjs b/dist/assets/ArrowUpHeadIcon.cjs deleted file mode 100644 index 87d9bc663..000000000 --- a/dist/assets/ArrowUpHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))}; diff --git a/dist/assets/ArrowUpHeadIcon.d.ts b/dist/assets/ArrowUpHeadIcon.d.ts deleted file mode 100644 index 36f4a93f3..000000000 --- a/dist/assets/ArrowUpHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowUpHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowUpHeadIcon; diff --git a/dist/assets/ArrowUpHeadIcon.js b/dist/assets/ArrowUpHeadIcon.js deleted file mode 100644 index 311187f75..000000000 --- a/dist/assets/ArrowUpHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpIcon.cjs b/dist/assets/ArrowUpIcon.cjs deleted file mode 100644 index dddda2604..000000000 --- a/dist/assets/ArrowUpIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))}; diff --git a/dist/assets/ArrowUpIcon.d.ts b/dist/assets/ArrowUpIcon.d.ts deleted file mode 100644 index 29eafd8ba..000000000 --- a/dist/assets/ArrowUpIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowUpIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowUpIcon; diff --git a/dist/assets/ArrowUpIcon.js b/dist/assets/ArrowUpIcon.js deleted file mode 100644 index 0423fb2e5..000000000 --- a/dist/assets/ArrowUpIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))};export{r as default}; diff --git a/dist/assets/ArrowUpRightIcon.cjs b/dist/assets/ArrowUpRightIcon.cjs deleted file mode 100644 index 38bb56285..000000000 --- a/dist/assets/ArrowUpRightIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))}; diff --git a/dist/assets/ArrowUpRightIcon.d.ts b/dist/assets/ArrowUpRightIcon.d.ts deleted file mode 100644 index 0c9bc33ba..000000000 --- a/dist/assets/ArrowUpRightIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ArrowUpRightIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ArrowUpRightIcon; diff --git a/dist/assets/ArrowUpRightIcon.js b/dist/assets/ArrowUpRightIcon.js deleted file mode 100644 index ca81a63ec..000000000 --- a/dist/assets/ArrowUpRightIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))};export{r as default}; diff --git a/dist/assets/CalendarIcon.cjs b/dist/assets/CalendarIcon.cjs deleted file mode 100644 index aa8be6bc2..000000000 --- a/dist/assets/CalendarIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));module.exports=t=>{var r=e.__rest(t,[]);return a.default.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),a.default.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))}; diff --git a/dist/assets/CalendarIcon.d.ts b/dist/assets/CalendarIcon.d.ts deleted file mode 100644 index 0d56ab56f..000000000 --- a/dist/assets/CalendarIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const CalendarIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default CalendarIcon; diff --git a/dist/assets/CalendarIcon.js b/dist/assets/CalendarIcon.js deleted file mode 100644 index 9c03cd8b5..000000000 --- a/dist/assets/CalendarIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import a from"react";const t=t=>{var r=e(t,[]);return a.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),a.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};export{t as default}; diff --git a/dist/assets/ChevronLeftFill.cjs b/dist/assets/ChevronLeftFill.cjs deleted file mode 100644 index 7c59e53c7..000000000 --- a/dist/assets/ChevronLeftFill.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))}; diff --git a/dist/assets/ChevronLeftFill.d.ts b/dist/assets/ChevronLeftFill.d.ts deleted file mode 100644 index f49f06f16..000000000 --- a/dist/assets/ChevronLeftFill.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ChevronLeftFill: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ChevronLeftFill; diff --git a/dist/assets/ChevronLeftFill.js b/dist/assets/ChevronLeftFill.js deleted file mode 100644 index b3373066f..000000000 --- a/dist/assets/ChevronLeftFill.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),e.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))};export{r as default}; diff --git a/dist/assets/ChevronRightFill.cjs b/dist/assets/ChevronRightFill.cjs deleted file mode 100644 index d122731cc..000000000 --- a/dist/assets/ChevronRightFill.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))}; diff --git a/dist/assets/ChevronRightFill.d.ts b/dist/assets/ChevronRightFill.d.ts deleted file mode 100644 index 66517e709..000000000 --- a/dist/assets/ChevronRightFill.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ChevronRightFill: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ChevronRightFill; diff --git a/dist/assets/ChevronRightFill.js b/dist/assets/ChevronRightFill.js deleted file mode 100644 index fcb71f82f..000000000 --- a/dist/assets/ChevronRightFill.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),e.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))};export{r as default}; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.cjs b/dist/assets/DoubleArrowLeftHeadIcon.cjs deleted file mode 100644 index fbaeb0588..000000000 --- a/dist/assets/DoubleArrowLeftHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))}; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.d.ts b/dist/assets/DoubleArrowLeftHeadIcon.d.ts deleted file mode 100644 index 076c001b1..000000000 --- a/dist/assets/DoubleArrowLeftHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const DoubleArrowLeftHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default DoubleArrowLeftHeadIcon; diff --git a/dist/assets/DoubleArrowLeftHeadIcon.js b/dist/assets/DoubleArrowLeftHeadIcon.js deleted file mode 100644 index 88f422c53..000000000 --- a/dist/assets/DoubleArrowLeftHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))};export{r as default}; diff --git a/dist/assets/DoubleArrowRightHeadIcon.cjs b/dist/assets/DoubleArrowRightHeadIcon.cjs deleted file mode 100644 index 1b3372e81..000000000 --- a/dist/assets/DoubleArrowRightHeadIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))}; diff --git a/dist/assets/DoubleArrowRightHeadIcon.d.ts b/dist/assets/DoubleArrowRightHeadIcon.d.ts deleted file mode 100644 index 323418b14..000000000 --- a/dist/assets/DoubleArrowRightHeadIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const DoubleArrowRightHeadIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default DoubleArrowRightHeadIcon; diff --git a/dist/assets/DoubleArrowRightHeadIcon.js b/dist/assets/DoubleArrowRightHeadIcon.js deleted file mode 100644 index 7ce2f404d..000000000 --- a/dist/assets/DoubleArrowRightHeadIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};export{r as default}; diff --git a/dist/assets/ExclamationFilledIcon.cjs b/dist/assets/ExclamationFilledIcon.cjs deleted file mode 100644 index 265820234..000000000 --- a/dist/assets/ExclamationFilledIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))}; diff --git a/dist/assets/ExclamationFilledIcon.d.ts b/dist/assets/ExclamationFilledIcon.d.ts deleted file mode 100644 index 60229f1f9..000000000 --- a/dist/assets/ExclamationFilledIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const ExclamationFilledIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default ExclamationFilledIcon; diff --git a/dist/assets/ExclamationFilledIcon.js b/dist/assets/ExclamationFilledIcon.js deleted file mode 100644 index 0003a70a3..000000000 --- a/dist/assets/ExclamationFilledIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o),e.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))};export{r as default}; diff --git a/dist/assets/EyeIcon.cjs b/dist/assets/EyeIcon.cjs deleted file mode 100644 index 669ef5b8c..000000000 --- a/dist/assets/EyeIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var C=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),r.default.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))}; diff --git a/dist/assets/EyeIcon.d.ts b/dist/assets/EyeIcon.d.ts deleted file mode 100644 index 1f1551480..000000000 --- a/dist/assets/EyeIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const EyeIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default EyeIcon; diff --git a/dist/assets/EyeIcon.js b/dist/assets/EyeIcon.js deleted file mode 100644 index 85aa0584f..000000000 --- a/dist/assets/EyeIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var C=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),e.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))};export{r as default}; diff --git a/dist/assets/EyeOffIcon.cjs b/dist/assets/EyeOffIcon.cjs deleted file mode 100644 index 5bfa4473d..000000000 --- a/dist/assets/EyeOffIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var C=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),r.default.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))}; diff --git a/dist/assets/EyeOffIcon.d.ts b/dist/assets/EyeOffIcon.d.ts deleted file mode 100644 index 158706c66..000000000 --- a/dist/assets/EyeOffIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const EyeOffIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default EyeOffIcon; diff --git a/dist/assets/EyeOffIcon.js b/dist/assets/EyeOffIcon.js deleted file mode 100644 index ae89ea554..000000000 --- a/dist/assets/EyeOffIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import C from"react";const e=e=>{var r=t(e,[]);return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),C.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};export{e as default}; diff --git a/dist/assets/LoadingSpinner.cjs b/dist/assets/LoadingSpinner.cjs deleted file mode 100644 index 96d8fde14..000000000 --- a/dist/assets/LoadingSpinner.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.default.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),r.default.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))}; diff --git a/dist/assets/LoadingSpinner.d.ts b/dist/assets/LoadingSpinner.d.ts deleted file mode 100644 index bf2a7001f..000000000 --- a/dist/assets/LoadingSpinner.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const LoadingSpinner: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default LoadingSpinner; diff --git a/dist/assets/LoadingSpinner.js b/dist/assets/LoadingSpinner.js deleted file mode 100644 index ae0e7f1ba..000000000 --- a/dist/assets/LoadingSpinner.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";const r=r=>{var a=e(r,[]);return t.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),t.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),t.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};export{r as default}; diff --git a/dist/assets/MinusIcon.cjs b/dist/assets/MinusIcon.cjs deleted file mode 100644 index e19b73e35..000000000 --- a/dist/assets/MinusIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M20 12H4"}))}; diff --git a/dist/assets/MinusIcon.d.ts b/dist/assets/MinusIcon.d.ts deleted file mode 100644 index 4000a1700..000000000 --- a/dist/assets/MinusIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const MinusIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default MinusIcon; diff --git a/dist/assets/MinusIcon.js b/dist/assets/MinusIcon.js deleted file mode 100644 index 2bc156e08..000000000 --- a/dist/assets/MinusIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),e.createElement("path",{d:"M20 12H4"}))};export{r as default}; diff --git a/dist/assets/PlusIcon.cjs b/dist/assets/PlusIcon.cjs deleted file mode 100644 index c9f769311..000000000 --- a/dist/assets/PlusIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({},a,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),r.default.createElement("path",{d:"M12 4v16m8-8H4"}))}; diff --git a/dist/assets/PlusIcon.d.ts b/dist/assets/PlusIcon.d.ts deleted file mode 100644 index bee5c6677..000000000 --- a/dist/assets/PlusIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const PlusIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default PlusIcon; diff --git a/dist/assets/PlusIcon.js b/dist/assets/PlusIcon.js deleted file mode 100644 index dc1c8b33b..000000000 --- a/dist/assets/PlusIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var o=t(r,[]);return e.createElement("svg",Object.assign({},o,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),e.createElement("path",{d:"M12 4v16m8-8H4"}))};export{r as default}; diff --git a/dist/assets/SearchIcon.cjs b/dist/assets/SearchIcon.cjs deleted file mode 100644 index 5e97f58a4..000000000 --- a/dist/assets/SearchIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))}; diff --git a/dist/assets/SearchIcon.d.ts b/dist/assets/SearchIcon.d.ts deleted file mode 100644 index 40f5eb7bc..000000000 --- a/dist/assets/SearchIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const SearchIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default SearchIcon; diff --git a/dist/assets/SearchIcon.js b/dist/assets/SearchIcon.js deleted file mode 100644 index 347365cec..000000000 --- a/dist/assets/SearchIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var C=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},C),e.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};export{r as default}; diff --git a/dist/assets/XCircleIcon.cjs b/dist/assets/XCircleIcon.cjs deleted file mode 100644 index 241ae2b17..000000000 --- a/dist/assets/XCircleIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var a=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},a),r.default.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}; diff --git a/dist/assets/XCircleIcon.d.ts b/dist/assets/XCircleIcon.d.ts deleted file mode 100644 index 3ea3c2bc4..000000000 --- a/dist/assets/XCircleIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const XCircleIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default XCircleIcon; diff --git a/dist/assets/XCircleIcon.js b/dist/assets/XCircleIcon.js deleted file mode 100644 index 5fd1dd05d..000000000 --- a/dist/assets/XCircleIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import e from"react";const r=r=>{var L=t(r,[]);return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L),e.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))};export{r as default}; diff --git a/dist/assets/XIcon.cjs b/dist/assets/XIcon.cjs deleted file mode 100644 index 9ab5ca623..000000000 --- a/dist/assets/XIcon.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("react"));module.exports=t=>{var n=e.__rest(t,[]);return r.default.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},n),r.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))}; diff --git a/dist/assets/XIcon.d.ts b/dist/assets/XIcon.d.ts deleted file mode 100644 index ffb48538a..000000000 --- a/dist/assets/XIcon.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -declare const XIcon: ({ ...props }: { - [x: string]: any; -}) => React.JSX.Element; -export default XIcon; diff --git a/dist/assets/XIcon.js b/dist/assets/XIcon.js deleted file mode 100644 index 279a09ead..000000000 --- a/dist/assets/XIcon.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";const r=r=>{var o=e(r,[]);return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};export{r as default}; diff --git a/dist/assets/index.d.ts b/dist/assets/index.d.ts deleted file mode 100644 index 8480713d1..000000000 --- a/dist/assets/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { default as ArrowDownHeadIcon } from "./ArrowDownHeadIcon"; -export { default as ArrowDownIcon } from "./ArrowDownIcon"; -export { default as ArrowDownRightIcon } from "./ArrowDownRightIcon"; -export { default as ArrowLeftHeadIcon } from "./ArrowLeftHeadIcon"; -export { default as ArrowRightHeadIcon } from "./ArrowRightHeadIcon"; -export { default as ArrowRightIcon } from "./ArrowRightIcon"; -export { default as ArrowUpHeadIcon } from "./ArrowUpHeadIcon"; -export { default as ArrowUpIcon } from "./ArrowUpIcon"; -export { default as ArrowUpRightIcon } from "./ArrowUpRightIcon"; -export { default as CalendarIcon } from "./CalendarIcon"; -export { default as DoubleArrowLeftHeadIcon } from "./DoubleArrowLeftHeadIcon"; -export { default as DoubleArrowRightHeadIcon } from "./DoubleArrowRightHeadIcon"; -export { default as ExclamationFilledIcon } from "./ExclamationFilledIcon"; -export { default as EyeIcon } from "./EyeIcon"; -export { default as EyeOffIcon } from "./EyeOffIcon"; -export { default as LoadingSpinner } from "./LoadingSpinner"; -export { default as SearchIcon } from "./SearchIcon"; -export { default as XCircleIcon } from "./XCircleIcon"; -export { default as PlusIcon } from "./PlusIcon"; -export { default as MinusIcon } from "./MinusIcon"; -export { default as ChevronLeftFill } from "./ChevronLeftFill"; -export { default as ChevronRightFill } from "./ChevronRightFill"; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.cjs b/dist/components/chart-elements/AreaChart/AreaChart.cjs deleted file mode 100644 index dd49c7527..000000000 --- a/dist/components/chart-elements/AreaChart/AreaChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../common/ChartLegend.cjs"),o=require("../common/ChartTooltip.cjs"),l=require("../common/NoData.cjs"),n=require("../common/utils.cjs"),i=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),d=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(t);const y=m.default.forwardRef(((u,y)=>{const{data:k=[],categories:p=[],index:g,stack:f=!1,colors:v=s.themeColorRange,valueFormatter:h=c.defaultValueFormatter,startEndOnly:x=!1,showXAxis:C=!0,showYAxis:w=!0,yAxisWidth:T=56,intervalType:b="equidistantPreserveStart",showAnimation:E=!1,animationDuration:L=900,showTooltip:N=!0,showLegend:A=!0,showGridLines:K=!0,showGradient:j=!0,autoMinValue:O=!1,curveType:G="linear",minValue:D,maxValue:q,connectNulls:V=!1,allowDecimals:F=!0,noDataText:M,className:S,onValueChange:W,enableLegendSlider:P=!1,customTooltip:B,rotateLabelX:X,tickGap:Y=5}=u,R=e.__rest(u,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),_=B,z=!C&&!w||x&&!w?0:20,[H,I]=t.useState(60),[$,J]=t.useState(void 0),[Q,U]=t.useState(void 0),Z=n.constructCategoryColors(p,v),ee=n.getYAxisDomain(O,D,q),te=!!W;function ae(e){te&&(e===Q&&!$||n.hasOnlyOneValueForThisKey(k,e)&&$&&$.dataKey===e?(U(void 0),null==W||W(null)):(U(e),null==W||W({eventType:"category",categoryClicked:e})),J(void 0))}return m.default.createElement("div",Object.assign({ref:y,className:d.tremorTwMerge("w-full h-80",S)},R),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==k?void 0:k.length)?m.default.createElement(a.AreaChart,{data:k,onClick:te&&(Q||$)?()=>{J(void 0),U(void 0),null==W||W(null)}:void 0},K?m.default.createElement(a.CartesianGrid,{className:d.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,m.default.createElement(a.XAxis,{padding:{left:z,right:z},hide:!C,dataKey:g,tick:{transform:"translate(0, 6)"},ticks:x?[k[0][g],k[k.length-1][g]]:void 0,fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:x?"preserveStartEnd":b,tickLine:!1,axisLine:!1,minTickGap:Y,angle:null==X?void 0:X.angle,dy:null==X?void 0:X.verticalShift,height:null==X?void 0:X.xAxisHeight}),m.default.createElement(a.YAxis,{width:T,hide:!w,axisLine:!1,tickLine:!1,type:"number",domain:ee,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:h,allowDecimals:F}),m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:N?({active:e,payload:t,label:a})=>_?m.default.createElement(_,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=Z.get(e.dataKey))&&void 0!==t?t:i.BaseColors.Gray})})),active:e,label:a}):m.default.createElement(o.default,{active:e,payload:t,label:a,valueFormatter:h,categoryColors:Z}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),A?m.default.createElement(a.Legend,{verticalAlign:"top",height:H,content:({payload:e})=>r({payload:e},Z,I,Q,te?e=>ae(e):void 0,P)}):null,p.map((e=>{var t,a;return m.default.createElement("defs",{key:e},j?m.default.createElement("linearGradient",{className:c.getColorClassNames(null!==(t=Z.get(e))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).textColor,id:Z.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},m.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:$||Q&&Q!==e?.15:.4}),m.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):m.default.createElement("linearGradient",{className:c.getColorClassNames(null!==(a=Z.get(e))&&void 0!==a?a:i.BaseColors.Gray,s.colorPalette.text).textColor,id:Z.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},m.default.createElement("stop",{stopColor:"currentColor",stopOpacity:$||Q&&Q!==e?.1:.3})))})),p.map((e=>{var r;return m.default.createElement(a.Area,{className:c.getColorClassNames(null!==(r=Z.get(e))&&void 0!==r?r:i.BaseColors.Gray,s.colorPalette.text).strokeColor,strokeOpacity:$||Q&&Q!==e?.3:1,activeDot:e=>{var t;const{cx:r,cy:o,stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,dataKey:g}=e;return m.default.createElement(a.Dot,{className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",c.getColorClassNames(null!==(t=Z.get(g))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,onClick:(t,a)=>function(e,t){t.stopPropagation(),te&&(e.index===(null==$?void 0:$.index)&&e.dataKey===(null==$?void 0:$.dataKey)||n.hasOnlyOneValueForThisKey(k,e.dataKey)&&Q&&Q===e.dataKey?(U(void 0),J(void 0),null==W||W(null)):(U(e.dataKey),J({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:r=>{var o;const{stroke:l,strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,cx:g,cy:f,dataKey:v,index:h}=r;return n.hasOnlyOneValueForThisKey(k,e)&&!($||Q&&Q!==e)||(null==$?void 0:$.index)===h&&(null==$?void 0:$.dataKey)===e?m.default.createElement(a.Dot,{key:h,cx:g,cy:f,r:5,stroke:l,fill:"",strokeLinecap:u,strokeLinejoin:y,strokeWidth:p,className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",c.getColorClassNames(null!==(o=Z.get(v))&&void 0!==o?o:i.BaseColors.Gray,s.colorPalette.text).fillColor)}):m.default.createElement(t.Fragment,{key:h})},key:e,name:e,type:G,dataKey:e,stroke:"",fill:`url(#${Z.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:E,animationDuration:L,stackId:f?"a":void 0,connectNulls:V})})),W?p.map((e=>m.default.createElement(a.Line,{className:d.tremorTwMerge("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:G,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:V,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ae(a)}}))):null):m.default.createElement(l,{noDataText:M})))}));y.displayName="AreaChart",module.exports=y; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.d.ts b/dist/components/chart-elements/AreaChart/AreaChart.d.ts deleted file mode 100644 index 595f1e10c..000000000 --- a/dist/components/chart-elements/AreaChart/AreaChart.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -import BaseChartProps from "../common/BaseChartProps"; -import { CurveType } from "../../../lib/inputTypes"; -export interface AreaChartProps extends BaseChartProps { - stack?: boolean; - curveType?: CurveType; - connectNulls?: boolean; - showGradient?: boolean; -} -declare const AreaChart: React.ForwardRefExoticComponent>; -export default AreaChart; diff --git a/dist/components/chart-elements/AreaChart/AreaChart.js b/dist/components/chart-elements/AreaChart/AreaChart.js deleted file mode 100644 index f334a3e31..000000000 --- a/dist/components/chart-elements/AreaChart/AreaChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useState as o,Fragment as a}from"react";import{ResponsiveContainer as r,AreaChart as l,CartesianGrid as n,XAxis as i,YAxis as s,Tooltip as c,Legend as d,Area as m,Dot as u,Line as p}from"recharts";import k from"../common/ChartLegend.js";import y from"../common/ChartTooltip.js";import v from"../common/NoData.js";import{constructCategoryColors as h,hasOnlyOneValueForThisKey as g,getYAxisDomain as f}from"../common/utils.js";import{BaseColors as x}from"../../../lib/constants.js";import{themeColorRange as b,colorPalette as E}from"../../../lib/theme.js";import{tremorTwMerge as w}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as C,defaultValueFormatter as L}from"../../../lib/utils.js";const N=t.forwardRef(((N,T)=>{const{data:j=[],categories:A=[],index:K,stack:G=!1,colors:D=b,valueFormatter:O=L,startEndOnly:W=!1,showXAxis:V=!0,showYAxis:S=!0,yAxisWidth:F=56,intervalType:X="equidistantPreserveStart",showAnimation:M=!1,animationDuration:P=900,showTooltip:Y=!0,showLegend:q=!0,showGridLines:z=!0,showGradient:H=!0,autoMinValue:I=!1,curveType:R="linear",minValue:$,maxValue:B,connectNulls:J=!1,allowDecimals:Q=!0,noDataText:U,className:Z,onValueChange:_,enableLegendSlider:ee=!1,customTooltip:te,rotateLabelX:oe,tickGap:ae=5}=N,re=e(N,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),le=te,ne=!V&&!S||W&&!S?0:20,[ie,se]=o(60),[ce,de]=o(void 0),[me,ue]=o(void 0),pe=h(A,D),ke=f(I,$,B),ye=!!_;function ve(e){ye&&(e===me&&!ce||g(j,e)&&ce&&ce.dataKey===e?(ue(void 0),null==_||_(null)):(ue(e),null==_||_({eventType:"category",categoryClicked:e})),de(void 0))}return t.createElement("div",Object.assign({ref:T,className:w("w-full h-80",Z)},re),t.createElement(r,{className:"h-full w-full"},(null==j?void 0:j.length)?t.createElement(l,{data:j,onClick:ye&&(me||ce)?()=>{de(void 0),ue(void 0),null==_||_(null)}:void 0},z?t.createElement(n,{className:w("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,t.createElement(i,{padding:{left:ne,right:ne},hide:!V,dataKey:K,tick:{transform:"translate(0, 6)"},ticks:W?[j[0][K],j[j.length-1][K]]:void 0,fill:"",stroke:"",className:w("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:W?"preserveStartEnd":X,tickLine:!1,axisLine:!1,minTickGap:ae,angle:null==oe?void 0:oe.angle,dy:null==oe?void 0:oe.verticalShift,height:null==oe?void 0:oe.xAxisHeight}),t.createElement(s,{width:F,hide:!S,axisLine:!1,tickLine:!1,type:"number",domain:ke,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:w("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:Q}),t.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:Y?({active:e,payload:o,label:a})=>le?t.createElement(le,{payload:null==o?void 0:o.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=pe.get(e.dataKey))&&void 0!==t?t:x.Gray})})),active:e,label:a}):t.createElement(y,{active:e,payload:o,label:a,valueFormatter:O,categoryColors:pe}):t.createElement(t.Fragment,null),position:{y:0}}),q?t.createElement(d,{verticalAlign:"top",height:ie,content:({payload:e})=>k({payload:e},pe,se,me,ye?e=>ve(e):void 0,ee)}):null,A.map((e=>{var o,a;return t.createElement("defs",{key:e},H?t.createElement("linearGradient",{className:C(null!==(o=pe.get(e))&&void 0!==o?o:x.Gray,E.text).textColor,id:pe.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:ce||me&&me!==e?.15:.4}),t.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):t.createElement("linearGradient",{className:C(null!==(a=pe.get(e))&&void 0!==a?a:x.Gray,E.text).textColor,id:pe.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{stopColor:"currentColor",stopOpacity:ce||me&&me!==e?.1:.3})))})),A.map((e=>{var o;return t.createElement(m,{className:C(null!==(o=pe.get(e))&&void 0!==o?o:x.Gray,E.text).strokeColor,strokeOpacity:ce||me&&me!==e?.3:1,activeDot:e=>{var o;const{cx:a,cy:r,stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,dataKey:c}=e;return t.createElement(u,{className:w("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",C(null!==(o=pe.get(c))&&void 0!==o?o:x.Gray,E.text).fillColor),cx:a,cy:r,r:5,fill:"",stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,onClick:(t,o)=>function(e,t){t.stopPropagation(),ye&&(e.index===(null==ce?void 0:ce.index)&&e.dataKey===(null==ce?void 0:ce.dataKey)||g(j,e.dataKey)&&me&&me===e.dataKey?(ue(void 0),de(void 0),null==_||_(null)):(ue(e.dataKey),de({index:e.index,dataKey:e.dataKey}),null==_||_(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,o)})},dot:o=>{var r;const{stroke:l,strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,cx:c,cy:d,dataKey:m,index:p}=o;return g(j,e)&&!(ce||me&&me!==e)||(null==ce?void 0:ce.index)===p&&(null==ce?void 0:ce.dataKey)===e?t.createElement(u,{key:p,cx:c,cy:d,r:5,stroke:l,fill:"",strokeLinecap:n,strokeLinejoin:i,strokeWidth:s,className:w("stroke-tremor-background dark:stroke-dark-tremor-background",_?"cursor-pointer":"",C(null!==(r=pe.get(m))&&void 0!==r?r:x.Gray,E.text).fillColor)}):t.createElement(a,{key:p})},key:e,name:e,type:R,dataKey:e,stroke:"",fill:`url(#${pe.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:M,animationDuration:P,stackId:G?"a":void 0,connectNulls:J})})),_?A.map((e=>t.createElement(p,{className:w("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:R,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:J,onClick:(e,t)=>{t.stopPropagation();const{name:o}=e;ve(o)}}))):null):t.createElement(v,{noDataText:U})))}));N.displayName="AreaChart";export{N as default}; diff --git a/dist/components/chart-elements/AreaChart/index.d.ts b/dist/components/chart-elements/AreaChart/index.d.ts deleted file mode 100644 index 92d8c8347..000000000 --- a/dist/components/chart-elements/AreaChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as AreaChart } from "./AreaChart"; -export type { AreaChartProps } from "./AreaChart"; diff --git a/dist/components/chart-elements/BarChart/BarChart.cjs b/dist/components/chart-elements/BarChart/BarChart.cjs deleted file mode 100644 index f5b3af31b..000000000 --- a/dist/components/chart-elements/BarChart/BarChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs"),i=require("react"),o=require("recharts"),n=require("../common/ChartLegend.cjs"),s=require("../common/ChartTooltip.cjs"),c=require("../common/NoData.cjs"),d=require("../common/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(i);const v=m.default.forwardRef(((u,v)=>{const{data:g=[],categories:h=[],index:f,colors:p=a.themeColorRange,valueFormatter:y=r.defaultValueFormatter,layout:k="horizontal",stack:b=!1,relative:x=!1,startEndOnly:w=!1,animationDuration:T=900,showAnimation:E=!1,showXAxis:C=!0,showYAxis:A=!0,yAxisWidth:j=56,intervalType:L="equidistantPreserveStart",showTooltip:q=!0,showLegend:O=!0,showGridLines:N=!0,autoMinValue:D=!1,minValue:M,maxValue:S,allowDecimals:G=!0,noDataText:V,onValueChange:F,enableLegendSlider:K=!1,customTooltip:X,rotateLabelX:B,tickGap:P=5,className:Y}=u,z=e.__rest(u,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),R=X,H=C||A?20:0,[W,_]=i.useState(60),I=d.constructCategoryColors(h,p),[$,J]=m.default.useState(void 0),[Q,U]=i.useState(void 0),Z=!!F;function ee(e,t,a){var l,r,i,o;a.stopPropagation(),F&&(d.deepEqual($,Object.assign(Object.assign({},e.payload),{value:e.value}))?(U(void 0),J(void 0),null==F||F(null)):(U(null===(r=null===(l=e.tooltipPayload)||void 0===l?void 0:l[0])||void 0===r?void 0:r.dataKey),J(Object.assign(Object.assign({},e.payload),{value:e.value})),null==F||F(Object.assign({eventType:"bar",categoryClicked:null===(o=null===(i=e.tooltipPayload)||void 0===i?void 0:i[0])||void 0===o?void 0:o.dataKey},e.payload))))}const te=d.getYAxisDomain(D,M,S);return m.default.createElement("div",Object.assign({ref:v,className:l.tremorTwMerge("w-full h-80",Y)},z),m.default.createElement(o.ResponsiveContainer,{className:"h-full w-full"},(null==g?void 0:g.length)?m.default.createElement(o.BarChart,{data:g,stackOffset:b?"sign":x?"expand":"none",layout:"vertical"===k?"vertical":"horizontal",onClick:Z&&(Q||$)?()=>{J(void 0),U(void 0),null==F||F(null)}:void 0},N?m.default.createElement(o.CartesianGrid,{className:l.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==k,vertical:"vertical"===k}):null,"vertical"!==k?m.default.createElement(o.XAxis,{padding:{left:H,right:H},hide:!C,dataKey:f,interval:w?"preserveStartEnd":L,tick:{transform:"translate(0, 6)"},ticks:w?[g[0][f],g[g.length-1][f]]:void 0,fill:"",stroke:"",className:l.tremorTwMerge("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight,minTickGap:P}):m.default.createElement(o.XAxis,{hide:!C,type:"number",tick:{transform:"translate(-3, 0)"},domain:te,fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:y,minTickGap:P,allowDecimals:G,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight}),"vertical"!==k?m.default.createElement(o.YAxis,{width:j,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:te,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:x?e=>`${(100*e).toString()} %`:y,allowDecimals:G}):m.default.createElement(o.YAxis,{width:j,hide:!A,dataKey:f,axisLine:!1,tickLine:!1,ticks:w?[g[0][f],g[g.length-1][f]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:l.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),m.default.createElement(o.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:q?({active:e,payload:a,label:l})=>R?m.default.createElement(R,{payload:null==a?void 0:a.map((e=>{var a;return Object.assign(Object.assign({},e),{color:null!==(a=I.get(e.dataKey))&&void 0!==a?a:t.BaseColors.Gray})})),active:e,label:l}):m.default.createElement(s.default,{active:e,payload:a,label:l,valueFormatter:y,categoryColors:I}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),O?m.default.createElement(o.Legend,{verticalAlign:"top",height:W,content:({payload:e})=>n({payload:e},I,_,Q,Z?e=>{return t=e,void(Z&&(t!==Q||$?(U(t),null==F||F({eventType:"category",categoryClicked:t})):(U(void 0),null==F||F(null)),J(void 0)));var t}:void 0,K)}):null,h.map((e=>{var i;return m.default.createElement(o.Bar,{className:l.tremorTwMerge(r.getColorClassNames(null!==(i=I.get(e))&&void 0!==i?i:t.BaseColors.Gray,a.colorPalette.background).fillColor,F?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:b||x?"a":void 0,dataKey:e,fill:"",isAnimationActive:E,animationDuration:T,shape:e=>((e,t,a,l)=>{const{fillOpacity:r,name:i,payload:o,value:n}=e;let{x:s,width:c,y:u,height:v}=e;return"horizontal"===l&&v<0?(u+=v,v=Math.abs(v)):"vertical"===l&&c<0&&(s+=c,c=Math.abs(c)),m.default.createElement("rect",{x:s,y:u,width:c,height:v,opacity:t||a&&a!==i?d.deepEqual(t,Object.assign(Object.assign({},o),{value:n}))?r:.3:r})})(e,$,Q,k),onClick:ee})}))):m.default.createElement(c,{noDataText:V})))}));v.displayName="BarChart",module.exports=v; diff --git a/dist/components/chart-elements/BarChart/BarChart.d.ts b/dist/components/chart-elements/BarChart/BarChart.d.ts deleted file mode 100644 index 3284286c0..000000000 --- a/dist/components/chart-elements/BarChart/BarChart.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import BaseChartProps from "../common/BaseChartProps"; -export interface BarChartProps extends BaseChartProps { - layout?: "vertical" | "horizontal"; - stack?: boolean; - relative?: boolean; -} -declare const BarChart: React.ForwardRefExoticComponent>; -export default BarChart; diff --git a/dist/components/chart-elements/BarChart/BarChart.js b/dist/components/chart-elements/BarChart/BarChart.js deleted file mode 100644 index 35bb20f0e..000000000 --- a/dist/components/chart-elements/BarChart/BarChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{BaseColors as t}from"../../../lib/constants.js";import{themeColorRange as a,colorPalette as l}from"../../../lib/theme.js";import{tremorTwMerge as i}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o,defaultValueFormatter as r}from"../../../lib/utils.js";import n,{useState as s}from"react";import{ResponsiveContainer as c,BarChart as m,CartesianGrid as d,XAxis as v,YAxis as u,Tooltip as p,Legend as h,Bar as y}from"recharts";import g from"../common/ChartLegend.js";import f from"../common/ChartTooltip.js";import k from"../common/NoData.js";import{constructCategoryColors as b,deepEqual as x,getYAxisDomain as w}from"../common/utils.js";const E=n.forwardRef(((E,j)=>{const{data:L=[],categories:A=[],index:T,colors:O=a,valueFormatter:C=r,layout:N="horizontal",stack:D=!1,relative:S=!1,startEndOnly:G=!1,animationDuration:V=900,showAnimation:F=!1,showXAxis:K=!0,showYAxis:M=!0,yAxisWidth:z=56,intervalType:P="equidistantPreserveStart",showTooltip:X=!0,showLegend:B=!0,showGridLines:H=!0,autoMinValue:W=!1,minValue:Y,maxValue:q,allowDecimals:I=!0,noDataText:R,onValueChange:$,enableLegendSlider:J=!1,customTooltip:Q,rotateLabelX:U,tickGap:Z=5,className:_}=E,ee=e(E,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),te=Q,ae=K||M?20:0,[le,ie]=s(60),oe=b(A,O),[re,ne]=n.useState(void 0),[se,ce]=s(void 0),me=!!$;function de(e,t,a){var l,i,o,r;a.stopPropagation(),$&&(x(re,Object.assign(Object.assign({},e.payload),{value:e.value}))?(ce(void 0),ne(void 0),null==$||$(null)):(ce(null===(i=null===(l=e.tooltipPayload)||void 0===l?void 0:l[0])||void 0===i?void 0:i.dataKey),ne(Object.assign(Object.assign({},e.payload),{value:e.value})),null==$||$(Object.assign({eventType:"bar",categoryClicked:null===(r=null===(o=e.tooltipPayload)||void 0===o?void 0:o[0])||void 0===r?void 0:r.dataKey},e.payload))))}const ve=w(W,Y,q);return n.createElement("div",Object.assign({ref:j,className:i("w-full h-80",_)},ee),n.createElement(c,{className:"h-full w-full"},(null==L?void 0:L.length)?n.createElement(m,{data:L,stackOffset:D?"sign":S?"expand":"none",layout:"vertical"===N?"vertical":"horizontal",onClick:me&&(se||re)?()=>{ne(void 0),ce(void 0),null==$||$(null)}:void 0},H?n.createElement(d,{className:i("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==N,vertical:"vertical"===N}):null,"vertical"!==N?n.createElement(v,{padding:{left:ae,right:ae},hide:!K,dataKey:T,interval:G?"preserveStartEnd":P,tick:{transform:"translate(0, 6)"},ticks:G?[L[0][T],L[L.length-1][T]]:void 0,fill:"",stroke:"",className:i("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==U?void 0:U.angle,dy:null==U?void 0:U.verticalShift,height:null==U?void 0:U.xAxisHeight,minTickGap:Z}):n.createElement(v,{hide:!K,type:"number",tick:{transform:"translate(-3, 0)"},domain:ve,fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:C,minTickGap:Z,allowDecimals:I,angle:null==U?void 0:U.angle,dy:null==U?void 0:U.verticalShift,height:null==U?void 0:U.xAxisHeight}),"vertical"!==N?n.createElement(u,{width:z,hide:!M,axisLine:!1,tickLine:!1,type:"number",domain:ve,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:S?e=>`${(100*e).toString()} %`:C,allowDecimals:I}):n.createElement(u,{width:z,hide:!M,dataKey:T,axisLine:!1,tickLine:!1,ticks:G?[L[0][T],L[L.length-1][T]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:i("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),n.createElement(p,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:X?({active:e,payload:a,label:l})=>te?n.createElement(te,{payload:null==a?void 0:a.map((e=>{var a;return Object.assign(Object.assign({},e),{color:null!==(a=oe.get(e.dataKey))&&void 0!==a?a:t.Gray})})),active:e,label:l}):n.createElement(f,{active:e,payload:a,label:l,valueFormatter:C,categoryColors:oe}):n.createElement(n.Fragment,null),position:{y:0}}),B?n.createElement(h,{verticalAlign:"top",height:le,content:({payload:e})=>g({payload:e},oe,ie,se,me?e=>{return t=e,void(me&&(t!==se||re?(ce(t),null==$||$({eventType:"category",categoryClicked:t})):(ce(void 0),null==$||$(null)),ne(void 0)));var t}:void 0,J)}):null,A.map((e=>{var a;return n.createElement(y,{className:i(o(null!==(a=oe.get(e))&&void 0!==a?a:t.Gray,l.background).fillColor,$?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:D||S?"a":void 0,dataKey:e,fill:"",isAnimationActive:F,animationDuration:V,shape:e=>((e,t,a,l)=>{const{fillOpacity:i,name:o,payload:r,value:s}=e;let{x:c,width:m,y:d,height:v}=e;return"horizontal"===l&&v<0?(d+=v,v=Math.abs(v)):"vertical"===l&&m<0&&(c+=m,m=Math.abs(m)),n.createElement("rect",{x:c,y:d,width:m,height:v,opacity:t||a&&a!==o?x(t,Object.assign(Object.assign({},r),{value:s}))?i:.3:i})})(e,re,se,N),onClick:de})}))):n.createElement(k,{noDataText:R})))}));E.displayName="BarChart";export{E as default}; diff --git a/dist/components/chart-elements/BarChart/index.d.ts b/dist/components/chart-elements/BarChart/index.d.ts deleted file mode 100644 index 4802cb346..000000000 --- a/dist/components/chart-elements/BarChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as BarChart } from "./BarChart"; -export type { BarChartProps } from "./BarChart"; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.cjs b/dist/components/chart-elements/DonutChart/DonutChart.cjs deleted file mode 100644 index 58d610264..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),r=require("react"),n=require("recharts"),i=require("../common/NoData.cjs"),u=require("./DonutChartTooltip.cjs"),s=require("./inputParser.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(r);const m=e=>{const{cx:t,cy:a,innerRadius:l,outerRadius:o,startAngle:r,endAngle:i,className:u}=e;return d.default.createElement("g",null,d.default.createElement(n.Sector,{cx:t,cy:a,innerRadius:l,outerRadius:o,startAngle:r,endAngle:i,className:u,fill:"",opacity:.3,style:{outline:"none"}}))},f=d.default.forwardRef(((c,f)=>{const{data:v=[],category:p="value",index:g="name",colors:h=a.themeColorRange,variant:y="donut",valueFormatter:b=o.defaultValueFormatter,label:A,showLabel:T=!0,animationDuration:w=900,showAnimation:E=!1,showTooltip:j=!0,noDataText:x,onValueChange:k,customTooltip:q,className:C}=c,D=e.__rest(c,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),N=q,R="donut"==y,F=s.parseLabelInput(A,b,v,p),[S,L]=d.default.useState(void 0),M=!!k;return r.useEffect((()=>{const e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach((e=>{e.setAttribute("style","outline: none")}))}),[S]),d.default.createElement("div",Object.assign({ref:f,className:l.tremorTwMerge("w-full h-40",C)},D),d.default.createElement(n.ResponsiveContainer,{className:"h-full w-full"},(null==v?void 0:v.length)?d.default.createElement(n.PieChart,{onClick:M&&S?()=>{L(void 0),null==k||k(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},T&&R?d.default.createElement("text",{className:l.tremorTwMerge("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},F):null,d.default.createElement(n.Pie,{className:l.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",k?"cursor-pointer":"cursor-default"),data:s.parseData(v,h),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:R?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:p,nameKey:g,isAnimationActive:E,animationDuration:w,onClick:function(e,t,a){a.stopPropagation(),M&&(S===t?(L(void 0),null==k||k(null)):(L(t),null==k||k(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:S,inactiveShape:m,style:{outline:"none"}}),d.default.createElement(n.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:j?({active:e,payload:a})=>{var l;return N?d.default.createElement(N,{payload:null==a?void 0:a.map((e=>{var l,o,r;return Object.assign(Object.assign({},e),{color:null!==(r=null===(o=null===(l=null==a?void 0:a[0])||void 0===l?void 0:l.payload)||void 0===o?void 0:o.color)&&void 0!==r?r:t.BaseColors.Gray})})),active:e,label:null===(l=null==a?void 0:a[0])||void 0===l?void 0:l.name}):d.default.createElement(u.DonutChartTooltip,{active:e,payload:a,valueFormatter:b})}:d.default.createElement(d.default.Fragment,null)})):d.default.createElement(i,{noDataText:x})))}));f.displayName="DonutChart",module.exports=f; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.d.ts b/dist/components/chart-elements/DonutChart/DonutChart.d.ts deleted file mode 100644 index 84382ea3a..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChart.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import { Color, ValueFormatter } from "../../../lib/inputTypes"; -import type { EventProps } from "components/chart-elements/common"; -import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; -import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; -type DonutChartVariant = "donut" | "pie"; -export interface DonutChartProps extends BaseAnimationTimingProps { - data: any[]; - category?: string; - index?: string; - colors?: (Color | string)[]; - variant?: DonutChartVariant; - valueFormatter?: ValueFormatter; - label?: string; - showLabel?: boolean; - showAnimation?: boolean; - showTooltip?: boolean; - noDataText?: string; - className?: string; - onValueChange?: (value: EventProps) => void; - customTooltip?: React.ComponentType; -} -declare const DonutChart: React.ForwardRefExoticComponent>; -export default DonutChart; diff --git a/dist/components/chart-elements/DonutChart/DonutChart.js b/dist/components/chart-elements/DonutChart/DonutChart.js deleted file mode 100644 index cd1599344..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{BaseColors as t}from"../../../lib/constants.js";import{themeColorRange as a}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{defaultValueFormatter as n}from"../../../lib/utils.js";import l,{useEffect as r}from"react";import{ResponsiveContainer as i,PieChart as s,Pie as m,Tooltip as c,Sector as u}from"recharts";import d from"../common/NoData.js";import{DonutChartTooltip as p}from"./DonutChartTooltip.js";import{parseLabelInput as v,parseData as f}from"./inputParser.js";const g=e=>{const{cx:t,cy:a,innerRadius:o,outerRadius:n,startAngle:r,endAngle:i,className:s}=e;return l.createElement("g",null,l.createElement(u,{cx:t,cy:a,innerRadius:o,outerRadius:n,startAngle:r,endAngle:i,className:s,fill:"",opacity:.3,style:{outline:"none"}}))},y=l.forwardRef(((u,y)=>{const{data:h=[],category:b="value",index:A="name",colors:x=a,variant:E="donut",valueFormatter:j=n,label:k,showLabel:w=!0,animationDuration:N=900,showAnimation:T=!1,showTooltip:D=!0,noDataText:R,onValueChange:C,customTooltip:F,className:O}=u,S=e(u,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),L=F,K="donut"==E,P=v(k,j,h,b),[V,q]=l.useState(void 0),B=!!C;return r((()=>{const e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach((e=>{e.setAttribute("style","outline: none")}))}),[V]),l.createElement("div",Object.assign({ref:y,className:o("w-full h-40",O)},S),l.createElement(i,{className:"h-full w-full"},(null==h?void 0:h.length)?l.createElement(s,{onClick:B&&V?()=>{q(void 0),null==C||C(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},w&&K?l.createElement("text",{className:o("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(m,{className:o("stroke-tremor-background dark:stroke-dark-tremor-background",C?"cursor-pointer":"cursor-default"),data:f(h,x),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:K?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:b,nameKey:A,isAnimationActive:T,animationDuration:N,onClick:function(e,t,a){a.stopPropagation(),B&&(V===t?(q(void 0),null==C||C(null)):(q(t),null==C||C(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:V,inactiveShape:g,style:{outline:"none"}}),l.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:D?({active:e,payload:a})=>{var o;return L?l.createElement(L,{payload:null==a?void 0:a.map((e=>{var o,n,l;return Object.assign(Object.assign({},e),{color:null!==(l=null===(n=null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.payload)||void 0===n?void 0:n.color)&&void 0!==l?l:t.Gray})})),active:e,label:null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.name}):l.createElement(p,{active:e,payload:a,valueFormatter:j})}:l.createElement(l.Fragment,null)})):l.createElement(d,{noDataText:R})))}));y.displayName="DonutChart";export{y as default}; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs b/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs deleted file mode 100644 index dcc608c7c..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChartTooltip.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../common/ChartTooltip.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e);exports.DonutChartTooltip=({active:e,payload:l,valueFormatter:a})=>{if(e&&(null==l?void 0:l[0])){const e=null==l?void 0:l[0];return o.default.createElement(r.ChartTooltipFrame,null,o.default.createElement("div",{className:t.tremorTwMerge("px-4 py-2")},o.default.createElement(r.ChartTooltipRow,{value:a(e.value),name:e.name,color:e.payload.color})))}return null}; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts b/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts deleted file mode 100644 index 6dae72cd8..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChartTooltip.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react"; -import { ValueFormatter } from "lib"; -export interface DonutChartTooltipProps { - active: boolean | undefined; - payload: any; - valueFormatter: ValueFormatter; -} -export declare const DonutChartTooltip: ({ active, payload, valueFormatter }: DonutChartTooltipProps) => React.JSX.Element | null; diff --git a/dist/components/chart-elements/DonutChart/DonutChartTooltip.js b/dist/components/chart-elements/DonutChart/DonutChartTooltip.js deleted file mode 100644 index e2b4a9e72..000000000 --- a/dist/components/chart-elements/DonutChart/DonutChartTooltip.js +++ /dev/null @@ -1 +0,0 @@ -import e from"react";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{ChartTooltipFrame as r,ChartTooltipRow as l}from"../common/ChartTooltip.js";const t=({active:t,payload:a,valueFormatter:m})=>{if(t&&(null==a?void 0:a[0])){const t=null==a?void 0:a[0];return e.createElement(r,null,e.createElement("div",{className:o("px-4 py-2")},e.createElement(l,{value:m(t.value),name:t.name,color:t.payload.color})))}return null};export{t as DonutChartTooltip}; diff --git a/dist/components/chart-elements/DonutChart/index.d.ts b/dist/components/chart-elements/DonutChart/index.d.ts deleted file mode 100644 index 16c105077..000000000 --- a/dist/components/chart-elements/DonutChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as DonutChart } from "./DonutChart"; -export type { DonutChartProps } from "./DonutChart"; diff --git a/dist/components/chart-elements/DonutChart/inputParser.cjs b/dist/components/chart-elements/DonutChart/inputParser.cjs deleted file mode 100644 index 1b7a0b31e..000000000 --- a/dist/components/chart-elements/DonutChart/inputParser.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),r=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var s=require("../../../lib/utils.cjs");exports.parseData=(a,l)=>a.map(((a,t)=>{const o=te||r(((e,r)=>s.sumNumericArray(e.map((e=>e[r]))))(a,l)); diff --git a/dist/components/chart-elements/DonutChart/inputParser.d.ts b/dist/components/chart-elements/DonutChart/inputParser.d.ts deleted file mode 100644 index a306cb986..000000000 --- a/dist/components/chart-elements/DonutChart/inputParser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Color, ValueFormatter } from "../../../lib/inputTypes"; -export declare const parseData: (data: any[], colors: (Color | string)[]) => any[]; -export declare const parseLabelInput: (labelInput: string | undefined, valueFormatter: ValueFormatter, data: any[], category: string) => string; diff --git a/dist/components/chart-elements/DonutChart/inputParser.js b/dist/components/chart-elements/DonutChart/inputParser.js deleted file mode 100644 index d462473c8..000000000 --- a/dist/components/chart-elements/DonutChart/inputParser.js +++ /dev/null @@ -1 +0,0 @@ -import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as o}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as t,sumNumericArray as l}from"../../../lib/utils.js";const s=(l,s)=>l.map(((l,i)=>{const m=ir||o(((r,o)=>l(r.map((r=>r[o]))))(t,s));export{s as parseData,i as parseLabelInput}; diff --git a/dist/components/chart-elements/LineChart/LineChart.cjs b/dist/components/chart-elements/LineChart/LineChart.cjs deleted file mode 100644 index d8a45093d..000000000 --- a/dist/components/chart-elements/LineChart/LineChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../common/ChartLegend.cjs"),o=require("../common/ChartTooltip.cjs"),l=require("../common/NoData.cjs"),n=require("../common/utils.cjs"),i=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),d=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(t);const k=m.default.forwardRef(((u,k)=>{const{data:y=[],categories:g=[],index:p,colors:v=s.themeColorRange,valueFormatter:h=c.defaultValueFormatter,startEndOnly:f=!1,showXAxis:x=!0,showYAxis:C=!0,yAxisWidth:T=56,intervalType:w="equidistantPreserveStart",animationDuration:L=900,showAnimation:b=!1,showTooltip:E=!0,showLegend:N=!0,showGridLines:K=!0,autoMinValue:j=!1,curveType:A="linear",minValue:D,maxValue:O,connectNulls:q=!1,allowDecimals:V=!0,noDataText:M,className:F,onValueChange:G,enableLegendSlider:S=!1,customTooltip:W,rotateLabelX:P,tickGap:X=5}=u,B=e.__rest(u,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),Y=W,R=x||C?20:0,[_,z]=t.useState(60),[H,I]=t.useState(void 0),[J,Q]=t.useState(void 0),U=n.constructCategoryColors(g,v),Z=n.getYAxisDomain(j,D,O),$=!!G;function ee(e){$&&(e===J&&!H||n.hasOnlyOneValueForThisKey(y,e)&&H&&H.dataKey===e?(Q(void 0),null==G||G(null)):(Q(e),null==G||G({eventType:"category",categoryClicked:e})),I(void 0))}return m.default.createElement("div",Object.assign({ref:k,className:d.tremorTwMerge("w-full h-80",F)},B),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==y?void 0:y.length)?m.default.createElement(a.LineChart,{data:y,onClick:$&&(J||H)?()=>{I(void 0),Q(void 0),null==G||G(null)}:void 0},K?m.default.createElement(a.CartesianGrid,{className:d.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,m.default.createElement(a.XAxis,{padding:{left:R,right:R},hide:!x,dataKey:p,interval:f?"preserveStartEnd":w,tick:{transform:"translate(0, 6)"},ticks:f?[y[0][p],y[y.length-1][p]]:void 0,fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:X,angle:null==P?void 0:P.angle,dy:null==P?void 0:P.verticalShift,height:null==P?void 0:P.xAxisHeight}),m.default.createElement(a.YAxis,{width:T,hide:!C,axisLine:!1,tickLine:!1,type:"number",domain:Z,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:d.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:h,allowDecimals:V}),m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:E?({active:e,payload:t,label:a})=>Y?m.default.createElement(Y,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=U.get(e.dataKey))&&void 0!==t?t:i.BaseColors.Gray})})),active:e,label:a}):m.default.createElement(o.default,{active:e,payload:t,label:a,valueFormatter:h,categoryColors:U}):m.default.createElement(m.default.Fragment,null),position:{y:0}}),N?m.default.createElement(a.Legend,{verticalAlign:"top",height:_,content:({payload:e})=>r({payload:e},U,z,J,$?e=>ee(e):void 0,S)}):null,g.map((e=>{var r;return m.default.createElement(a.Line,{className:d.tremorTwMerge(c.getColorClassNames(null!==(r=U.get(e))&&void 0!==r?r:i.BaseColors.Gray,s.colorPalette.text).strokeColor),strokeOpacity:H||J&&J!==e?.3:1,activeDot:e=>{var t;const{cx:r,cy:o,stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,dataKey:p}=e;return m.default.createElement(a.Dot,{className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",G?"cursor-pointer":"",c.getColorClassNames(null!==(t=U.get(p))&&void 0!==t?t:i.BaseColors.Gray,s.colorPalette.text).fillColor),cx:r,cy:o,r:5,fill:"",stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,onClick:(t,a)=>function(e,t){t.stopPropagation(),$&&(e.index===(null==H?void 0:H.index)&&e.dataKey===(null==H?void 0:H.dataKey)||n.hasOnlyOneValueForThisKey(y,e.dataKey)&&J&&J===e.dataKey?(Q(void 0),I(void 0),null==G||G(null)):(Q(e.dataKey),I({index:e.index,dataKey:e.dataKey}),null==G||G(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:r=>{var o;const{stroke:l,strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,cx:p,cy:v,dataKey:h,index:f}=r;return n.hasOnlyOneValueForThisKey(y,e)&&!(H||J&&J!==e)||(null==H?void 0:H.index)===f&&(null==H?void 0:H.dataKey)===e?m.default.createElement(a.Dot,{key:f,cx:p,cy:v,r:5,stroke:l,fill:"",strokeLinecap:u,strokeLinejoin:k,strokeWidth:g,className:d.tremorTwMerge("stroke-tremor-background dark:stroke-dark-tremor-background",G?"cursor-pointer":"",c.getColorClassNames(null!==(o=U.get(h))&&void 0!==o?o:i.BaseColors.Gray,s.colorPalette.text).fillColor)}):m.default.createElement(t.Fragment,{key:f})},key:e,name:e,type:A,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:b,animationDuration:L,connectNulls:q})})),G?g.map((e=>m.default.createElement(a.Line,{className:d.tremorTwMerge("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:A,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:q,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ee(a)}}))):null):m.default.createElement(l,{noDataText:M})))}));k.displayName="LineChart",module.exports=k; diff --git a/dist/components/chart-elements/LineChart/LineChart.d.ts b/dist/components/chart-elements/LineChart/LineChart.d.ts deleted file mode 100644 index 901ac038a..000000000 --- a/dist/components/chart-elements/LineChart/LineChart.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import BaseChartProps from "../common/BaseChartProps"; -import { CurveType } from "../../../lib/inputTypes"; -export interface LineChartProps extends BaseChartProps { - curveType?: CurveType; - connectNulls?: boolean; -} -declare const LineChart: React.ForwardRefExoticComponent>; -export default LineChart; diff --git a/dist/components/chart-elements/LineChart/LineChart.js b/dist/components/chart-elements/LineChart/LineChart.js deleted file mode 100644 index 0b577c763..000000000 --- a/dist/components/chart-elements/LineChart/LineChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useState as a,Fragment as o}from"react";import{ResponsiveContainer as r,LineChart as n,CartesianGrid as l,XAxis as i,YAxis as s,Tooltip as c,Legend as d,Line as m,Dot as u}from"recharts";import k from"../common/ChartLegend.js";import p from"../common/ChartTooltip.js";import y from"../common/NoData.js";import{constructCategoryColors as v,hasOnlyOneValueForThisKey as h,getYAxisDomain as g}from"../common/utils.js";import{BaseColors as f}from"../../../lib/constants.js";import{themeColorRange as x,colorPalette as b}from"../../../lib/theme.js";import{tremorTwMerge as L}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as w,defaultValueFormatter as E}from"../../../lib/utils.js";const T=t.forwardRef(((T,j)=>{const{data:N=[],categories:K=[],index:C,colors:A=x,valueFormatter:D=E,startEndOnly:G=!1,showXAxis:W=!0,showYAxis:O=!0,yAxisWidth:V=56,intervalType:S="equidistantPreserveStart",animationDuration:F=900,showAnimation:X=!1,showTooltip:M=!0,showLegend:P=!0,showGridLines:Y=!0,autoMinValue:q=!1,curveType:z="linear",minValue:H,maxValue:R,connectNulls:B=!1,allowDecimals:I=!0,noDataText:J,className:Q,onValueChange:U,enableLegendSlider:Z=!1,customTooltip:$,rotateLabelX:_,tickGap:ee=5}=T,te=e(T,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),ae=$,oe=W||O?20:0,[re,ne]=a(60),[le,ie]=a(void 0),[se,ce]=a(void 0),de=v(K,A),me=g(q,H,R),ue=!!U;function ke(e){ue&&(e===se&&!le||h(N,e)&&le&&le.dataKey===e?(ce(void 0),null==U||U(null)):(ce(e),null==U||U({eventType:"category",categoryClicked:e})),ie(void 0))}return t.createElement("div",Object.assign({ref:j,className:L("w-full h-80",Q)},te),t.createElement(r,{className:"h-full w-full"},(null==N?void 0:N.length)?t.createElement(n,{data:N,onClick:ue&&(se||le)?()=>{ie(void 0),ce(void 0),null==U||U(null)}:void 0},Y?t.createElement(l,{className:L("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,t.createElement(i,{padding:{left:oe,right:oe},hide:!W,dataKey:C,interval:G?"preserveStartEnd":S,tick:{transform:"translate(0, 6)"},ticks:G?[N[0][C],N[N.length-1][C]]:void 0,fill:"",stroke:"",className:L("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:ee,angle:null==_?void 0:_.angle,dy:null==_?void 0:_.verticalShift,height:null==_?void 0:_.xAxisHeight}),t.createElement(s,{width:V,hide:!O,axisLine:!1,tickLine:!1,type:"number",domain:me,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:L("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:D,allowDecimals:I}),t.createElement(c,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?({active:e,payload:a,label:o})=>ae?t.createElement(ae,{payload:null==a?void 0:a.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=de.get(e.dataKey))&&void 0!==t?t:f.Gray})})),active:e,label:o}):t.createElement(p,{active:e,payload:a,label:o,valueFormatter:D,categoryColors:de}):t.createElement(t.Fragment,null),position:{y:0}}),P?t.createElement(d,{verticalAlign:"top",height:re,content:({payload:e})=>k({payload:e},de,ne,se,ue?e=>ke(e):void 0,Z)}):null,K.map((e=>{var a;return t.createElement(m,{className:L(w(null!==(a=de.get(e))&&void 0!==a?a:f.Gray,b.text).strokeColor),strokeOpacity:le||se&&se!==e?.3:1,activeDot:e=>{var a;const{cx:o,cy:r,stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,dataKey:c}=e;return t.createElement(u,{className:L("stroke-tremor-background dark:stroke-dark-tremor-background",U?"cursor-pointer":"",w(null!==(a=de.get(c))&&void 0!==a?a:f.Gray,b.text).fillColor),cx:o,cy:r,r:5,fill:"",stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,onClick:(t,a)=>function(e,t){t.stopPropagation(),ue&&(e.index===(null==le?void 0:le.index)&&e.dataKey===(null==le?void 0:le.dataKey)||h(N,e.dataKey)&&se&&se===e.dataKey?(ce(void 0),ie(void 0),null==U||U(null)):(ce(e.dataKey),ie({index:e.index,dataKey:e.dataKey}),null==U||U(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}(e,a)})},dot:a=>{var r;const{stroke:n,strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,cx:c,cy:d,dataKey:m,index:k}=a;return h(N,e)&&!(le||se&&se!==e)||(null==le?void 0:le.index)===k&&(null==le?void 0:le.dataKey)===e?t.createElement(u,{key:k,cx:c,cy:d,r:5,stroke:n,fill:"",strokeLinecap:l,strokeLinejoin:i,strokeWidth:s,className:L("stroke-tremor-background dark:stroke-dark-tremor-background",U?"cursor-pointer":"",w(null!==(r=de.get(m))&&void 0!==r?r:f.Gray,b.text).fillColor)}):t.createElement(o,{key:k})},key:e,name:e,type:z,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:X,animationDuration:F,connectNulls:B})})),U?K.map((e=>t.createElement(m,{className:L("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:z,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();const{name:a}=e;ke(a)}}))):null):t.createElement(y,{noDataText:J})))}));T.displayName="LineChart";export{T as default}; diff --git a/dist/components/chart-elements/LineChart/index.d.ts b/dist/components/chart-elements/LineChart/index.d.ts deleted file mode 100644 index 89a8587b8..000000000 --- a/dist/components/chart-elements/LineChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as LineChart } from "./LineChart"; -export type { LineChartProps } from "./LineChart"; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.cjs b/dist/components/chart-elements/ScatterChart/ScatterChart.cjs deleted file mode 100644 index b26088134..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),l=require("../common/ChartLegend.cjs"),r=require("./ScatterChartTooltip.cjs"),o=require("../common/NoData.cjs"),i=require("../common/utils.cjs"),n=require("../../../lib/constants.cjs"),s=require("../../../lib/theme.cjs"),u=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=d(t);const v=m.default.forwardRef(((d,v)=>{const{data:g=[],x:y,y:f,size:p,category:h,colors:x=s.themeColorRange,showOpacity:w=!1,sizeRange:k=[1,1e3],valueFormatter:b={x:c.defaultValueFormatter,y:c.defaultValueFormatter,size:c.defaultValueFormatter},startEndOnly:C=!1,showXAxis:E=!0,showYAxis:T=!0,yAxisWidth:A=56,intervalType:V="equidistantPreserveStart",animationDuration:D=900,showAnimation:q=!1,showTooltip:L=!0,showLegend:j=!0,showGridLines:S=!0,autoMinXValue:N=!1,minXValue:O,maxXValue:X,autoMinYValue:Y=!1,minYValue:M,maxYValue:F,allowDecimals:G=!0,noDataText:z,onValueChange:R,customTooltip:P,rotateLabelX:B,className:K,enableLegendSlider:W=!1,tickGap:_=5}=d,H=e.__rest(d,["data","x","y","size","category","colors","showOpacity","sizeRange","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinXValue","minXValue","maxXValue","autoMinYValue","minYValue","maxYValue","allowDecimals","noDataText","onValueChange","customTooltip","rotateLabelX","className","enableLegendSlider","tickGap"]),Z=P,[$,I]=t.useState(60),[J,Q]=m.default.useState(void 0),[U,ee]=t.useState(void 0),te=!!R;function ae(e,t,a){a.stopPropagation(),te&&(i.deepEqual(J,e.node)?(ee(void 0),Q(void 0),null==R||R(null)):(Q(e.node),ee(e.payload[h]),null==R||R(Object.assign({eventType:"bubble",categoryClicked:e.payload[h]},e.payload))))}const le=i.constructCategories(g,h),re=i.constructCategoryColors(le,x),oe=i.getYAxisDomain(N,O,X),ie=i.getYAxisDomain(Y,M,F);return m.default.createElement("div",Object.assign({ref:v,className:u.tremorTwMerge("w-full h-80",K)},H),m.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==g?void 0:g.length)?m.default.createElement(a.ScatterChart,{onClick:te&&(U||J)?()=>{Q(void 0),ee(void 0),null==R||R(null)}:void 0,margin:{left:20,right:20}},S?m.default.createElement(a.CartesianGrid,{className:u.tremorTwMerge("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!0}):null,y?m.default.createElement(a.XAxis,{hide:!E,dataKey:y,interval:C?"preserveStartEnd":V,tick:{transform:"translate(0, 6)"},ticks:C?[g[0][y],g[g.length-1][y]]:void 0,type:"number",name:y,fill:"",stroke:"",className:u.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,tickFormatter:b.x,axisLine:!1,minTickGap:_,domain:oe,allowDataOverflow:!0,angle:null==B?void 0:B.angle,dy:null==B?void 0:B.verticalShift,height:null==B?void 0:B.xAxisHeight}):null,f?m.default.createElement(a.YAxis,{width:A,hide:!T,axisLine:!1,tickLine:!1,dataKey:f,type:"number",name:f,domain:ie,tick:{transform:"translate(-3, 0)"},tickFormatter:b.y,fill:"",stroke:"",className:u.tremorTwMerge("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),allowDecimals:G,allowDataOverflow:!0}):null,m.default.createElement(a.Tooltip,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:L?({active:e,payload:t,label:a})=>{var l,o;const i=h?null===(o=null===(l=null==t?void 0:t[0])||void 0===l?void 0:l.payload)||void 0===o?void 0:o[h]:a;return Z?m.default.createElement(Z,{payload:null==t?void 0:t.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=re.get(i))&&void 0!==t?t:n.BaseColors.Gray})})),active:e,label:i}):m.default.createElement(r.default,{active:e,payload:t,label:i,valueFormatter:b,axis:{x:y,y:f,size:p},category:h,categoryColors:re})}:m.default.createElement(m.default.Fragment,null)}),p?m.default.createElement(a.ZAxis,{dataKey:p,type:"number",range:k,name:p}):null,le.map((e=>{var t,l;return m.default.createElement(a.Scatter,{className:u.tremorTwMerge(c.getColorClassNames(null!==(t=re.get(e))&&void 0!==t?t:n.BaseColors.Gray,s.colorPalette.text).fillColor,w?c.getColorClassNames(null!==(l=re.get(e))&&void 0!==l?l:n.BaseColors.Gray,s.colorPalette.text).strokeColor:"",R?"cursor-pointer":""),fill:`url(#${re.get(e)})`,fillOpacity:w?.7:1,key:e,name:e,data:h?g.filter((t=>t[h]===e)):g,isAnimationActive:q,animationDuration:D,shape:e=>((e,t,l)=>{const{cx:r,cy:o,width:n,node:s,fillOpacity:u,name:c}=e;return m.default.createElement(a.Dot,{cx:r,cy:o,r:n/2,opacity:t||l&&l!==c?i.deepEqual(t,s)?u:.3:u})})(e,J,U),onClick:ae})})),j?m.default.createElement(a.Legend,{verticalAlign:"top",height:$,content:({payload:e})=>l({payload:e},re,I,U,te?e=>{return t=e,void(te&&(t!==U||J?(ee(t),null==R||R({eventType:"category",categoryClicked:t})):(ee(void 0),null==R||R(null)),Q(void 0)));var t}:void 0,W)}):null):m.default.createElement(o,{noDataText:z})))}));v.displayName="ScatterChart",module.exports=v; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts b/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts deleted file mode 100644 index a0490a0c1..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChart.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import React from "react"; -import type { EventProps } from "components/chart-elements/common"; -import BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; -import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; -import { Color, ValueFormatter, IntervalType } from "../../../lib/inputTypes"; -export type ScatterChartValueFormatter = { - x?: ValueFormatter; - y?: ValueFormatter; - size?: ValueFormatter; -}; -export interface ScatterChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { - data: any[]; - x: string; - y: string; - category: string; - size?: string; - valueFormatter?: ScatterChartValueFormatter; - sizeRange?: number[]; - colors?: (Color | string)[]; - showOpacity?: boolean; - startEndOnly?: boolean; - showXAxis?: boolean; - showYAxis?: boolean; - yAxisWidth?: number; - intervalType?: IntervalType; - showTooltip?: boolean; - showLegend?: boolean; - showGridLines?: boolean; - autoMinXValue?: boolean; - minXValue?: number; - maxXValue?: number; - autoMinYValue?: boolean; - minYValue?: number; - maxYValue?: number; - allowDecimals?: boolean; - noDataText?: string; - enableLegendSlider?: boolean; - onValueChange?: (value: EventProps) => void; - customTooltip?: React.ComponentType; - rotateLabelX?: { - angle: number; - verticalShift: number; - xAxisHeight: number; - }; - tickGap?: number; -} -declare const ScatterChart: React.ForwardRefExoticComponent>; -export default ScatterChart; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChart.js b/dist/components/chart-elements/ScatterChart/ScatterChart.js deleted file mode 100644 index ececb4f6b..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useState as a}from"react";import{ResponsiveContainer as l,ScatterChart as o,CartesianGrid as r,XAxis as i,YAxis as n,Tooltip as s,ZAxis as m,Scatter as c,Legend as d,Dot as u}from"recharts";import p from"../common/ChartLegend.js";import v from"./ScatterChartTooltip.js";import y from"../common/NoData.js";import{constructCategories as h,constructCategoryColors as g,deepEqual as f,getYAxisDomain as x}from"../common/utils.js";import{BaseColors as k}from"../../../lib/constants.js";import{themeColorRange as w,colorPalette as b}from"../../../lib/theme.js";import{tremorTwMerge as E}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as A,defaultValueFormatter as T}from"../../../lib/utils.js";const V=t.forwardRef(((V,C)=>{const{data:L=[],x:j,y:D,size:O,category:N,colors:S=w,showOpacity:X=!1,sizeRange:G=[1,1e3],valueFormatter:Y={x:T,y:T,size:T},startEndOnly:z=!1,showXAxis:F=!0,showYAxis:M=!0,yAxisWidth:K=56,intervalType:R="equidistantPreserveStart",animationDuration:W=900,showAnimation:P=!1,showTooltip:q=!0,showLegend:H=!0,showGridLines:$=!0,autoMinXValue:B=!1,minXValue:I,maxXValue:J,autoMinYValue:Q=!1,minYValue:U,maxYValue:Z,allowDecimals:_=!0,noDataText:ee,onValueChange:te,customTooltip:ae,rotateLabelX:le,className:oe,enableLegendSlider:re=!1,tickGap:ie=5}=V,ne=e(V,["data","x","y","size","category","colors","showOpacity","sizeRange","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinXValue","minXValue","maxXValue","autoMinYValue","minYValue","maxYValue","allowDecimals","noDataText","onValueChange","customTooltip","rotateLabelX","className","enableLegendSlider","tickGap"]),se=ae,[me,ce]=a(60),[de,ue]=t.useState(void 0),[pe,ve]=a(void 0),ye=!!te;function he(e,t,a){a.stopPropagation(),ye&&(f(de,e.node)?(ve(void 0),ue(void 0),null==te||te(null)):(ue(e.node),ve(e.payload[N]),null==te||te(Object.assign({eventType:"bubble",categoryClicked:e.payload[N]},e.payload))))}const ge=h(L,N),fe=g(ge,S),xe=x(B,I,J),ke=x(Q,U,Z);return t.createElement("div",Object.assign({ref:C,className:E("w-full h-80",oe)},ne),t.createElement(l,{className:"h-full w-full"},(null==L?void 0:L.length)?t.createElement(o,{onClick:ye&&(pe||de)?()=>{ue(void 0),ve(void 0),null==te||te(null)}:void 0,margin:{left:20,right:20}},$?t.createElement(r,{className:E("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!0}):null,j?t.createElement(i,{hide:!F,dataKey:j,interval:z?"preserveStartEnd":R,tick:{transform:"translate(0, 6)"},ticks:z?[L[0][j],L[L.length-1][j]]:void 0,type:"number",name:j,fill:"",stroke:"",className:E("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,tickFormatter:Y.x,axisLine:!1,minTickGap:ie,domain:xe,allowDataOverflow:!0,angle:null==le?void 0:le.angle,dy:null==le?void 0:le.verticalShift,height:null==le?void 0:le.xAxisHeight}):null,D?t.createElement(n,{width:K,hide:!M,axisLine:!1,tickLine:!1,dataKey:D,type:"number",name:D,domain:ke,tick:{transform:"translate(-3, 0)"},tickFormatter:Y.y,fill:"",stroke:"",className:E("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),allowDecimals:_,allowDataOverflow:!0}):null,t.createElement(s,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:q?({active:e,payload:a,label:l})=>{var o,r;const i=N?null===(r=null===(o=null==a?void 0:a[0])||void 0===o?void 0:o.payload)||void 0===r?void 0:r[N]:l;return se?t.createElement(se,{payload:null==a?void 0:a.map((e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=fe.get(i))&&void 0!==t?t:k.Gray})})),active:e,label:i}):t.createElement(v,{active:e,payload:a,label:i,valueFormatter:Y,axis:{x:j,y:D,size:O},category:N,categoryColors:fe})}:t.createElement(t.Fragment,null)}),O?t.createElement(m,{dataKey:O,type:"number",range:G,name:O}):null,ge.map((e=>{var a,l;return t.createElement(c,{className:E(A(null!==(a=fe.get(e))&&void 0!==a?a:k.Gray,b.text).fillColor,X?A(null!==(l=fe.get(e))&&void 0!==l?l:k.Gray,b.text).strokeColor:"",te?"cursor-pointer":""),fill:`url(#${fe.get(e)})`,fillOpacity:X?.7:1,key:e,name:e,data:N?L.filter((t=>t[N]===e)):L,isAnimationActive:P,animationDuration:W,shape:e=>((e,a,l)=>{const{cx:o,cy:r,width:i,node:n,fillOpacity:s,name:m}=e;return t.createElement(u,{cx:o,cy:r,r:i/2,opacity:a||l&&l!==m?f(a,n)?s:.3:s})})(e,de,pe),onClick:he})})),H?t.createElement(d,{verticalAlign:"top",height:me,content:({payload:e})=>p({payload:e},fe,ce,pe,ye?e=>{return t=e,void(ye&&(t!==pe||de?(ve(t),null==te||te({eventType:"category",categoryClicked:t})):(ve(void 0),null==te||te(null)),ue(void 0)));var t}:void 0,re)}):null):t.createElement(y,{noDataText:ee})))}));V.displayName="ScatterChart";export{V as default}; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs deleted file mode 100644 index 86816d6a2..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(e);const m=({children:e})=>l.default.createElement("div",{className:a.tremorTwMerge("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),s=({value:e,name:r})=>l.default.createElement("div",{className:"flex items-center justify-between space-x-8"},l.default.createElement("div",{className:"flex items-center space-x-2"},l.default.createElement("p",{className:a.tremorTwMerge("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},r)),l.default.createElement("p",{className:a.tremorTwMerge("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e));exports.ChartTooltipFrame=m,exports.ChartTooltipRow=s,exports.default=({label:e,active:d,payload:n,valueFormatter:c,axis:u,category:i,categoryColors:p})=>{var b,f;return d&&n?l.default.createElement(m,null,l.default.createElement("div",{className:a.tremorTwMerge("flex items-center space-x-2 border-b px-4 py-2","border-tremor-border","dark:border-dark-tremor-border")},l.default.createElement("span",{className:a.tremorTwMerge("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o.getColorClassNames(i&&null!==(f=p.get(null===(b=null==n?void 0:n[0])||void 0===b?void 0:b.payload[i]))&&void 0!==f?f:r.BaseColors.Blue,t.colorPalette.background).bgColor)}),l.default.createElement("p",{className:a.tremorTwMerge("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e)),l.default.createElement("div",{className:a.tremorTwMerge("px-4 py-2 space-y-1")},n.map((({value:e,name:r},t)=>{var a,d;const m=null!==(a=Object.keys(u).find((e=>u[e]===r)))&&void 0!==a?a:"",n=null!==(d=c[m])&&void 0!==d?d:o.defaultValueFormatter;return l.default.createElement(s,{key:`id-${t}`,value:c&&n?n(e):`${e}`,name:r})})))):null}; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts deleted file mode 100644 index 0144f6bdf..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import { ScatterChartValueFormatter } from "components/chart-elements/ScatterChart/ScatterChart"; -import { Color } from "lib"; -export declare const ChartTooltipFrame: ({ children }: { - children: React.ReactNode; -}) => React.JSX.Element; -export interface ChartTooltipRowProps { - value: string; - name: string; -} -export declare const ChartTooltipRow: ({ value, name }: ChartTooltipRowProps) => React.JSX.Element; -export interface ScatterChartTooltipProps { - label: string; - categoryColors: Map; - active: boolean | undefined; - payload: any; - valueFormatter: ScatterChartValueFormatter; - axis: any; - category?: string; -} -declare const ScatterChartTooltip: ({ label, active, payload, valueFormatter, axis, category, categoryColors, }: ScatterChartTooltipProps) => React.JSX.Element | null; -export default ScatterChartTooltip; diff --git a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js b/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js deleted file mode 100644 index de3df03d5..000000000 --- a/dist/components/chart-elements/ScatterChart/ScatterChartTooltip.js +++ /dev/null @@ -1 +0,0 @@ -import e from"react";import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o,defaultValueFormatter as d}from"../../../lib/utils.js";const m=({children:r})=>e.createElement("div",{className:a("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},r),n=({value:r,name:t})=>e.createElement("div",{className:"flex items-center justify-between space-x-8"},e.createElement("div",{className:"flex items-center space-x-2"},e.createElement("p",{className:a("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},t)),e.createElement("p",{className:a("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r)),l=({label:l,active:s,payload:c,valueFormatter:i,axis:p,category:u,categoryColors:b})=>{var k,x;return s&&c?e.createElement(m,null,e.createElement("div",{className:a("flex items-center space-x-2 border-b px-4 py-2","border-tremor-border","dark:border-dark-tremor-border")},e.createElement("span",{className:a("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o(u&&null!==(x=b.get(null===(k=null==c?void 0:c[0])||void 0===k?void 0:k.payload[u]))&&void 0!==x?x:r.Blue,t.background).bgColor)}),e.createElement("p",{className:a("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},l)),e.createElement("div",{className:a("px-4 py-2 space-y-1")},c.map((({value:r,name:t},a)=>{var o,m;const l=null!==(o=Object.keys(p).find((e=>p[e]===t)))&&void 0!==o?o:"",s=null!==(m=i[l])&&void 0!==m?m:d;return e.createElement(n,{key:`id-${a}`,value:i&&s?s(r):`${r}`,name:t})})))):null};export{m as ChartTooltipFrame,n as ChartTooltipRow,l as default}; diff --git a/dist/components/chart-elements/ScatterChart/index.d.ts b/dist/components/chart-elements/ScatterChart/index.d.ts deleted file mode 100644 index 538f51039..000000000 --- a/dist/components/chart-elements/ScatterChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ScatterChart } from "./ScatterChart"; -export type { ScatterChartProps } from "./ScatterChart"; diff --git a/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts b/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts deleted file mode 100644 index 75833c6bf..000000000 --- a/dist/components/chart-elements/common/BaseAnimationTimingProps.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface BaseAnimationTimingProps { - animationDuration?: number; - showAnimation?: boolean; -} -export default BaseAnimationTimingProps; diff --git a/dist/components/chart-elements/common/BaseChartProps.d.ts b/dist/components/chart-elements/common/BaseChartProps.d.ts deleted file mode 100644 index 33c21dee7..000000000 --- a/dist/components/chart-elements/common/BaseChartProps.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// -import { Color, ValueFormatter, IntervalType } from "../../../lib"; -import type BaseAnimationTimingProps from "./BaseAnimationTimingProps"; -import { CustomTooltipProps } from "./CustomTooltipProps"; -type FixedProps = { - eventType: "dot" | "category" | "bar" | "slice" | "bubble"; - categoryClicked: string; -}; -type BaseEventProps = FixedProps & { - [key: string]: number | string; -}; -export type EventProps = BaseEventProps | null | undefined; -interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { - data: any[]; - categories: string[]; - index: string; - colors?: (Color | string)[]; - valueFormatter?: ValueFormatter; - startEndOnly?: boolean; - showXAxis?: boolean; - showYAxis?: boolean; - yAxisWidth?: number; - intervalType?: IntervalType; - showTooltip?: boolean; - showLegend?: boolean; - showGridLines?: boolean; - autoMinValue?: boolean; - minValue?: number; - maxValue?: number; - allowDecimals?: boolean; - noDataText?: string; - onValueChange?: (value: EventProps) => void; - enableLegendSlider?: boolean; - customTooltip?: React.ComponentType; - rotateLabelX?: { - angle: number; - verticalShift?: number; - xAxisHeight?: number; - }; - tickGap?: number; -} -export default BaseChartProps; diff --git a/dist/components/chart-elements/common/ChartLegend.cjs b/dist/components/chart-elements/common/ChartLegend.cjs deleted file mode 100644 index 9774463dc..000000000 --- a/dist/components/chart-elements/common/ChartLegend.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("react"),t=require("../../../hooks/useOnWindowResize.cjs"),r=require("../../text-elements/Legend/Legend.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(e);module.exports=({payload:n},a,u,i,c,o)=>{const s=e.useRef(null);t((()=>{var e;var t;u((t=null===(e=s.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)}));const d=n.filter((e=>"none"!==e.type));return l.default.createElement("div",{ref:s,className:"flex items-center justify-end"},l.default.createElement(r,{categories:d.map((e=>e.value)),colors:d.map((e=>a.get(e.value))),onClickLegendItem:c,activeLegend:i,enableLegendSlider:o}))}; diff --git a/dist/components/chart-elements/common/ChartLegend.d.ts b/dist/components/chart-elements/common/ChartLegend.d.ts deleted file mode 100644 index 9984cb5ea..000000000 --- a/dist/components/chart-elements/common/ChartLegend.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -declare const ChartLegend: ({ payload }: any, categoryColors: Map, setLegendHeight: React.Dispatch>, activeLegend: string | undefined, onClick?: ((category: string, color: Color | string) => void) | undefined, enableLegendSlider?: boolean) => React.JSX.Element; -export default ChartLegend; diff --git a/dist/components/chart-elements/common/ChartLegend.js b/dist/components/chart-elements/common/ChartLegend.js deleted file mode 100644 index b5a088505..000000000 --- a/dist/components/chart-elements/common/ChartLegend.js +++ /dev/null @@ -1 +0,0 @@ -import e,{useRef as t}from"react";import n from"../../../hooks/useOnWindowResize.js";import r from"../../text-elements/Legend/Legend.js";const o=({payload:o},l,a,i,s,m)=>{const c=t(null);n((()=>{var e;var t;a((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)}));const d=o.filter((e=>"none"!==e.type));return e.createElement("div",{ref:c,className:"flex items-center justify-end"},e.createElement(r,{categories:d.map((e=>e.value)),colors:d.map((e=>l.get(e.value))),onClickLegendItem:s,activeLegend:i,enableLegendSlider:m}))};export{o as default}; diff --git a/dist/components/chart-elements/common/ChartTooltip.cjs b/dist/components/chart-elements/common/ChartTooltip.cjs deleted file mode 100644 index 4df5f0c98..000000000 --- a/dist/components/chart-elements/common/ChartTooltip.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(e);const m=({children:e})=>l.default.createElement("div",{className:a.tremorTwMerge("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e),n=({value:e,name:r,color:d})=>l.default.createElement("div",{className:"flex items-center justify-between space-x-8"},l.default.createElement("div",{className:"flex items-center space-x-2"},l.default.createElement("span",{className:a.tremorTwMerge("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o.getColorClassNames(d,t.colorPalette.background).bgColor)}),l.default.createElement("p",{className:a.tremorTwMerge("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},r)),l.default.createElement("p",{className:a.tremorTwMerge("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e));exports.ChartTooltipFrame=m,exports.ChartTooltipRow=n,exports.default=({active:e,payload:t,label:o,categoryColors:d,valueFormatter:s})=>{if(e&&t){const e=t.filter((e=>"none"!==e.type));return l.default.createElement(m,null,l.default.createElement("div",{className:a.tremorTwMerge("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},l.default.createElement("p",{className:a.tremorTwMerge("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},o)),l.default.createElement("div",{className:a.tremorTwMerge("px-4 py-2 space-y-1")},e.map((({value:e,name:t},a)=>{var o;return l.default.createElement(n,{key:`id-${a}`,value:s(e),name:t,color:null!==(o=d.get(t))&&void 0!==o?o:r.BaseColors.Blue})}))))}return null}; diff --git a/dist/components/chart-elements/common/ChartTooltip.d.ts b/dist/components/chart-elements/common/ChartTooltip.d.ts deleted file mode 100644 index 4a714502a..000000000 --- a/dist/components/chart-elements/common/ChartTooltip.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import { Color, ValueFormatter } from "lib"; -export declare const ChartTooltipFrame: ({ children }: { - children: React.ReactNode; -}) => React.JSX.Element; -export interface ChartTooltipRowProps { - value: string; - name: string; - color: Color | string; -} -export declare const ChartTooltipRow: ({ value, name, color }: ChartTooltipRowProps) => React.JSX.Element; -export interface ChartTooltipProps { - active: boolean | undefined; - payload: any; - label: string; - categoryColors: Map; - valueFormatter: ValueFormatter; -} -declare const ChartTooltip: ({ active, payload, label, categoryColors, valueFormatter, }: ChartTooltipProps) => React.JSX.Element | null; -export default ChartTooltip; diff --git a/dist/components/chart-elements/common/ChartTooltip.js b/dist/components/chart-elements/common/ChartTooltip.js deleted file mode 100644 index 80c9ba489..000000000 --- a/dist/components/chart-elements/common/ChartTooltip.js +++ /dev/null @@ -1 +0,0 @@ -import e from"react";import{BaseColors as r}from"../../../lib/constants.js";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";const m=({children:r})=>e.createElement("div",{className:a("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},r),d=({value:r,name:m,color:d})=>e.createElement("div",{className:"flex items-center justify-between space-x-8"},e.createElement("div",{className:"flex items-center space-x-2"},e.createElement("span",{className:a("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",o(d,t.background).bgColor)}),e.createElement("p",{className:a("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},m)),e.createElement("p",{className:a("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r)),n=({active:t,payload:o,label:n,categoryColors:l,valueFormatter:s})=>{if(t&&o){const t=o.filter((e=>"none"!==e.type));return e.createElement(m,null,e.createElement("div",{className:a("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},e.createElement("p",{className:a("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},n)),e.createElement("div",{className:a("px-4 py-2 space-y-1")},t.map((({value:t,name:a},o)=>{var m;return e.createElement(d,{key:`id-${o}`,value:s(t),name:a,color:null!==(m=l.get(a))&&void 0!==m?m:r.Blue})}))))}return null};export{m as ChartTooltipFrame,d as ChartTooltipRow,n as default}; diff --git a/dist/components/chart-elements/common/CustomTooltipProps.d.ts b/dist/components/chart-elements/common/CustomTooltipProps.d.ts deleted file mode 100644 index 221d6f921..000000000 --- a/dist/components/chart-elements/common/CustomTooltipProps.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { NameType, Payload } from "recharts/types/component/DefaultTooltipContent"; -export type CustomTooltipProps = { - payload: Payload[] | undefined; - active: boolean | undefined; - label: NameType | undefined; -}; diff --git a/dist/components/chart-elements/common/NoData.cjs b/dist/components/chart-elements/common/NoData.cjs deleted file mode 100644 index 3b4e54b1b..000000000 --- a/dist/components/chart-elements/common/NoData.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("../../../lib/tremorTwMerge.cjs"),r=require("react"),t=require("../../layout-elements/Flex/Flex.cjs"),o=require("../../text-elements/Text/Text.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(r);module.exports=({noDataText:r="No data"})=>d.default.createElement(t,{alignItems:"center",justifyContent:"center",className:e.tremorTwMerge("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},d.default.createElement(o,{className:e.tremorTwMerge("text-tremor-content","dark:text-dark-tremor-content")},r)); diff --git a/dist/components/chart-elements/common/NoData.d.ts b/dist/components/chart-elements/common/NoData.d.ts deleted file mode 100644 index 5159890f6..000000000 --- a/dist/components/chart-elements/common/NoData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react"; -interface NoDataProps { - noDataText?: string; -} -declare const NoData: ({ noDataText }: NoDataProps) => React.JSX.Element; -export default NoData; diff --git a/dist/components/chart-elements/common/NoData.js b/dist/components/chart-elements/common/NoData.js deleted file mode 100644 index a0e8a1884..000000000 --- a/dist/components/chart-elements/common/NoData.js +++ /dev/null @@ -1 +0,0 @@ -import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import r from"react";import t from"../../layout-elements/Flex/Flex.js";import o from"../../text-elements/Text/Text.js";const a=({noDataText:a="No data"})=>r.createElement(t,{alignItems:"center",justifyContent:"center",className:e("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},r.createElement(o,{className:e("text-tremor-content","dark:text-dark-tremor-content")},a));export{a as default}; diff --git a/dist/components/chart-elements/common/index.d.ts b/dist/components/chart-elements/common/index.d.ts deleted file mode 100644 index 7a73db7fe..000000000 --- a/dist/components/chart-elements/common/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { EventProps } from "./BaseChartProps"; -export type { CustomTooltipProps } from "./CustomTooltipProps"; diff --git a/dist/components/chart-elements/common/utils.cjs b/dist/components/chart-elements/common/utils.cjs deleted file mode 100644 index e363ca0a7..000000000 --- a/dist/components/chart-elements/common/utils.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.constructCategories=(e,t)=>{if(!t)return[];const r=new Set;return e.forEach((e=>{r.add(e[t])})),Array.from(r)},exports.constructCategoryColors=(e,t)=>{const r=new Map;return e.forEach(((e,o)=>{r.set(e,t[o])})),r},exports.deepEqual=function e(t,r){if(t===r)return!0;if("object"!=typeof t||"object"!=typeof r||null===t||null===r)return!1;const o=Object.keys(t),n=Object.keys(r);if(o.length!==n.length)return!1;for(const s of o)if(!n.includes(s)||!e(t[s],r[s]))return!1;return!0},exports.getYAxisDomain=(e,t,r)=>[e?"auto":null!=t?t:0,null!=r?r:"auto"],exports.hasOnlyOneValueForThisKey=function(e,t){const r=[];for(const o of e)if(Object.prototype.hasOwnProperty.call(o,t)&&(r.push(o[t]),r.length>1))return!1;return!0}; diff --git a/dist/components/chart-elements/common/utils.d.ts b/dist/components/chart-elements/common/utils.d.ts deleted file mode 100644 index d128c66bd..000000000 --- a/dist/components/chart-elements/common/utils.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Color } from "../../../lib/inputTypes"; -export declare const constructCategoryColors: (categories: string[], colors: (Color | string)[]) => Map; -export declare const getYAxisDomain: (autoMinValue: boolean, minValue: number | undefined, maxValue: number | undefined) => (string | number)[]; -export declare const constructCategories: (data: any[], color?: string) => string[]; -export declare function deepEqual(obj1: any, obj2: any): boolean; -export declare function hasOnlyOneValueForThisKey(array: any[], keyToCheck: string): boolean; diff --git a/dist/components/chart-elements/common/utils.js b/dist/components/chart-elements/common/utils.js deleted file mode 100644 index 66b8a5f9a..000000000 --- a/dist/components/chart-elements/common/utils.js +++ /dev/null @@ -1 +0,0 @@ -const t=(t,n)=>{const r=new Map;return t.forEach(((t,e)=>{r.set(t,n[e])})),r},n=(t,n,r)=>[t?"auto":null!=n?n:0,null!=r?r:"auto"],r=(t,n)=>{if(!n)return[];const r=new Set;return t.forEach((t=>{r.add(t[n])})),Array.from(r)};function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;const r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(const u of r)if(!o.includes(u)||!e(t[u],n[u]))return!1;return!0}function o(t,n){const r=[];for(const e of t)if(Object.prototype.hasOwnProperty.call(e,n)&&(r.push(e[n]),r.length>1))return!1;return!0}export{r as constructCategories,t as constructCategoryColors,e as deepEqual,n as getYAxisDomain,o as hasOnlyOneValueForThisKey}; diff --git a/dist/components/chart-elements/index.d.ts b/dist/components/chart-elements/index.d.ts deleted file mode 100644 index f8327e561..000000000 --- a/dist/components/chart-elements/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./AreaChart"; -export * from "./BarChart"; -export { EventProps } from "./common/BaseChartProps"; -export { CustomTooltipProps } from "./common/CustomTooltipProps"; -export * from "./DonutChart"; -export * from "./LineChart"; -export * from "./ScatterChart"; diff --git a/dist/components/icon-elements/Badge/Badge.cjs b/dist/components/icon-elements/Badge/Badge.cjs deleted file mode 100644 index f5319ea6b..000000000 --- a/dist/components/icon-elements/Badge/Badge.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("../../../lib/constants.cjs"),a=require("../../../lib/theme.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("./styles.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(r);const d=i.makeClassName("Badge"),m=c.default.forwardRef(((r,n)=>{const{color:m,icon:g,size:u=o.Sizes.SM,tooltip:p,className:b,children:f}=r,k=e.__rest(r,["color","icon","size","tooltip","className","children"]),w=g||null,{tooltipProps:h,getReferenceProps:j}=t.useTooltip();return c.default.createElement("span",Object.assign({ref:i.mergeRefs([n,h.refs.setReference]),className:s.tremorTwMerge(d("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",m?s.tremorTwMerge(i.getColorClassNames(m,a.colorPalette.background).bgColor,i.getColorClassNames(m,a.colorPalette.iconText).textColor,i.getColorClassNames(m,a.colorPalette.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):s.tremorTwMerge("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),l.badgeProportions[u].paddingX,l.badgeProportions[u].paddingY,l.badgeProportions[u].fontSize,b)},j,k),c.default.createElement(t.default,Object.assign({text:p},h)),w?c.default.createElement(w,{className:s.tremorTwMerge(d("icon"),"shrink-0 -ml-1 mr-1.5",l.iconSizes[u].height,l.iconSizes[u].width)}):null,c.default.createElement("span",{className:s.tremorTwMerge(d("text"),"whitespace-nowrap")},f))}));m.displayName="Badge",module.exports=m; diff --git a/dist/components/icon-elements/Badge/Badge.d.ts b/dist/components/icon-elements/Badge/Badge.d.ts deleted file mode 100644 index 56099f2b3..000000000 --- a/dist/components/icon-elements/Badge/Badge.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import { Color, Size } from "lib"; -export interface BadgeProps extends React.HTMLAttributes { - color?: Color; - size?: Size; - icon?: React.ElementType; - tooltip?: string; -} -declare const Badge: React.ForwardRefExoticComponent>; -export default Badge; diff --git a/dist/components/icon-elements/Badge/Badge.js b/dist/components/icon-elements/Badge/Badge.js deleted file mode 100644 index c80c18386..000000000 --- a/dist/components/icon-elements/Badge/Badge.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as r}from"tslib";import e from"react";import t,{useTooltip as o}from"../../util-elements/Tooltip/Tooltip.js";import{Sizes as i}from"../../../lib/constants.js";import{colorPalette as a}from"../../../lib/theme.js";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,getColorClassNames as l,makeClassName as m}from"../../../lib/utils.js";import{badgeProportions as c,iconSizes as d}from"./styles.js";const p=m("Badge"),g=e.forwardRef(((m,g)=>{const{color:f,icon:b,size:u=i.SM,tooltip:k,className:h,children:j}=m,x=r(m,["color","icon","size","tooltip","className","children"]),y=b||null,{tooltipProps:w,getReferenceProps:N}=o();return e.createElement("span",Object.assign({ref:s([g,w.refs.setReference]),className:n(p("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",f?n(l(f,a.background).bgColor,l(f,a.iconText).textColor,l(f,a.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):n("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),c[u].paddingX,c[u].paddingY,c[u].fontSize,h)},N,x),e.createElement(t,Object.assign({text:k},w)),y?e.createElement(y,{className:n(p("icon"),"shrink-0 -ml-1 mr-1.5",d[u].height,d[u].width)}):null,e.createElement("span",{className:n(p("text"),"whitespace-nowrap")},j))}));g.displayName="Badge";export{g as default}; diff --git a/dist/components/icon-elements/Badge/index.d.ts b/dist/components/icon-elements/Badge/index.d.ts deleted file mode 100644 index 7a1b96baf..000000000 --- a/dist/components/icon-elements/Badge/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Badge } from "./Badge"; -export type { BadgeProps } from "./Badge"; diff --git a/dist/components/icon-elements/Badge/styles.cjs b/dist/components/icon-elements/Badge/styles.cjs deleted file mode 100644 index 4fc7cee32..000000000 --- a/dist/components/icon-elements/Badge/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.badgeProportions={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/icon-elements/Badge/styles.d.ts b/dist/components/icon-elements/Badge/styles.d.ts deleted file mode 100644 index 5e5feb96a..000000000 --- a/dist/components/icon-elements/Badge/styles.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type BadgeProportionTypes = { - paddingX: string; - paddingY: string; - fontSize: string; -}; -export declare const badgeProportions: { - [char: string]: BadgeProportionTypes; -}; -export declare const iconSizes: { - [size: string]: { - height: string; - width: string; - }; -}; diff --git a/dist/components/icon-elements/Badge/styles.js b/dist/components/icon-elements/Badge/styles.js deleted file mode 100644 index 2e701d5a9..000000000 --- a/dist/components/icon-elements/Badge/styles.js +++ /dev/null @@ -1 +0,0 @@ -const d={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},t={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}};export{d as badgeProportions,t as iconSizes}; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs b/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs deleted file mode 100644 index 74f590576..000000000 --- a/dist/components/icon-elements/BadgeDelta/BadgeDelta.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),s=require("../../../lib/constants.cjs"),i=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),a=require("./styles.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(t);const c=o.makeClassName("BadgeDelta"),d=n.default.forwardRef(((t,l)=>{const{deltaType:d=s.DeltaTypes.Increase,isIncreasePositive:p=!0,size:u=s.Sizes.SM,tooltip:m,children:g,className:f}=t,T=e.__rest(t,["deltaType","isIncreasePositive","size","tooltip","children","className"]),y=a.deltaIcons[d],b=o.mapInputsToDeltaType(d,p),w=g?a.badgeProportionsWithText:a.badgeProportionsIconOnly,{tooltipProps:h,getReferenceProps:j}=r.useTooltip();return n.default.createElement("span",Object.assign({ref:o.mergeRefs([l,h.refs.setReference]),className:i.tremorTwMerge(c("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",a.colors[b].bgColor,a.colors[b].textColor,a.colors[b].ringColor,w[u].paddingX,w[u].paddingY,w[u].fontSize,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60",f)},j,T),n.default.createElement(r.default,Object.assign({text:m},h)),n.default.createElement(y,{className:i.tremorTwMerge(c("icon"),"shrink-0",g?i.tremorTwMerge("-ml-1 mr-1.5"):a.iconSizes[u].height,a.iconSizes[u].width)}),g?n.default.createElement("span",{className:i.tremorTwMerge(c("text"),"whitespace-nowrap")},g):null)}));d.displayName="BadgeDelta",module.exports=d; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts b/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts deleted file mode 100644 index 9db78b535..000000000 --- a/dist/components/icon-elements/BadgeDelta/BadgeDelta.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import { DeltaType, Size } from "lib"; -export interface BadgeDeltaProps extends React.HTMLAttributes { - deltaType?: DeltaType; - isIncreasePositive?: boolean; - size?: Size; - tooltip?: string; -} -declare const BadgeDelta: React.ForwardRefExoticComponent>; -export default BadgeDelta; diff --git a/dist/components/icon-elements/BadgeDelta/BadgeDelta.js b/dist/components/icon-elements/BadgeDelta/BadgeDelta.js deleted file mode 100644 index 39f2ccaa6..000000000 --- a/dist/components/icon-elements/BadgeDelta/BadgeDelta.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import r,{useTooltip as i}from"../../util-elements/Tooltip/Tooltip.js";import{DeltaTypes as s,Sizes as o}from"../../../lib/constants.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as n,mapInputsToDeltaType as m}from"../../../lib/utils.js";import{colors as c,iconSizes as p,deltaIcons as d,badgeProportionsWithText as f,badgeProportionsIconOnly as g}from"./styles.js";const b=n("BadgeDelta"),u=t.forwardRef(((n,u)=>{const{deltaType:y=s.Increase,isIncreasePositive:h=!0,size:j=o.SM,tooltip:w,children:x,className:N}=n,T=e(n,["deltaType","isIncreasePositive","size","tooltip","children","className"]),k=d[y],E=m(y,h),P=x?f:g,{tooltipProps:z,getReferenceProps:C}=i();return t.createElement("span",Object.assign({ref:l([u,z.refs.setReference]),className:a(b("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",c[E].bgColor,c[E].textColor,c[E].ringColor,P[j].paddingX,P[j].paddingY,P[j].fontSize,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60",N)},C,T),t.createElement(r,Object.assign({text:w},z)),t.createElement(k,{className:a(b("icon"),"shrink-0",x?a("-ml-1 mr-1.5"):p[j].height,p[j].width)}),x?t.createElement("span",{className:a(b("text"),"whitespace-nowrap")},x):null)}));u.displayName="BadgeDelta";export{u as default}; diff --git a/dist/components/icon-elements/BadgeDelta/index.d.ts b/dist/components/icon-elements/BadgeDelta/index.d.ts deleted file mode 100644 index 5b0cc86ad..000000000 --- a/dist/components/icon-elements/BadgeDelta/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as BadgeDelta } from "./BadgeDelta"; -export type { BadgeDeltaProps } from "./BadgeDelta"; diff --git a/dist/components/icon-elements/BadgeDelta/styles.cjs b/dist/components/icon-elements/BadgeDelta/styles.cjs deleted file mode 100644 index 303048c34..000000000 --- a/dist/components/icon-elements/BadgeDelta/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs");require("tslib"),require("react");var t=require("../../../assets/ArrowDownIcon.cjs"),s=require("../../../assets/ArrowDownRightIcon.cjs"),l=require("../../../assets/ArrowRightIcon.cjs"),a=require("../../../assets/ArrowUpIcon.cjs"),i=require("../../../assets/ArrowUpRightIcon.cjs");const n={[e.DeltaTypes.Increase]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.ModerateIncrease]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.Decrease]:{bgColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.ModerateDecrease]:{bgColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Red,o.colorPalette.iconRing).ringColor},[e.DeltaTypes.Unchanged]:{bgColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.background).bgColor,textColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.iconText).textColor,ringColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.iconRing).ringColor}},g={[e.DeltaTypes.Increase]:a,[e.DeltaTypes.ModerateIncrease]:i,[e.DeltaTypes.Decrease]:t,[e.DeltaTypes.ModerateDecrease]:s,[e.DeltaTypes.Unchanged]:l};exports.badgeProportionsIconOnly={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},exports.badgeProportionsWithText={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},exports.colors=n,exports.deltaIcons=g,exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/icon-elements/BadgeDelta/styles.d.ts b/dist/components/icon-elements/BadgeDelta/styles.d.ts deleted file mode 100644 index 96d4213ec..000000000 --- a/dist/components/icon-elements/BadgeDelta/styles.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// -export type BadgeProportionTypes = { - paddingX: string; - paddingY: string; - fontSize: string; -}; -export declare const badgeProportionsIconOnly: { - [char: string]: BadgeProportionTypes; -}; -export declare const badgeProportionsWithText: { - [char: string]: BadgeProportionTypes; -}; -export declare const iconSizes: { - [size: string]: { - height: string; - width: string; - }; -}; -export type ColorTypes = { - bgColor: string; - textColor: string; - ringColor: string; -}; -export declare const colors: { - [key: string]: ColorTypes; -}; -export declare const deltaIcons: { - [key: string]: React.ElementType; -}; diff --git a/dist/components/icon-elements/BadgeDelta/styles.js b/dist/components/icon-elements/BadgeDelta/styles.js deleted file mode 100644 index 7adacd674..000000000 --- a/dist/components/icon-elements/BadgeDelta/styles.js +++ /dev/null @@ -1 +0,0 @@ -import{DeltaTypes as o,BaseColors as r}from"../../../lib/constants.js";import{colorPalette as e}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as t}from"../../../lib/utils.js";import"tslib";import"react";import i from"../../../assets/ArrowDownIcon.js";import n from"../../../assets/ArrowDownRightIcon.js";import d from"../../../assets/ArrowRightIcon.js";import g from"../../../assets/ArrowUpIcon.js";import a from"../../../assets/ArrowUpRightIcon.js";const p={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},l={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},s={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},x={[o.Increase]:{bgColor:t(r.Emerald,e.background).bgColor,textColor:t(r.Emerald,e.iconText).textColor,ringColor:t(r.Emerald,e.iconRing).ringColor},[o.ModerateIncrease]:{bgColor:t(r.Emerald,e.background).bgColor,textColor:t(r.Emerald,e.iconText).textColor,ringColor:t(r.Emerald,e.iconRing).ringColor},[o.Decrease]:{bgColor:t(r.Red,e.background).bgColor,textColor:t(r.Red,e.iconText).textColor,ringColor:t(r.Red,e.iconRing).ringColor},[o.ModerateDecrease]:{bgColor:t(r.Red,e.background).bgColor,textColor:t(r.Red,e.iconText).textColor,ringColor:t(r.Red,e.iconRing).ringColor},[o.Unchanged]:{bgColor:t(r.Orange,e.background).bgColor,textColor:t(r.Orange,e.iconText).textColor,ringColor:t(r.Orange,e.iconRing).ringColor}},m={[o.Increase]:g,[o.ModerateIncrease]:a,[o.Decrease]:i,[o.ModerateDecrease]:n,[o.Unchanged]:d};export{p as badgeProportionsIconOnly,l as badgeProportionsWithText,x as colors,m as deltaIcons,s as iconSizes}; diff --git a/dist/components/icon-elements/Icon/Icon.cjs b/dist/components/icon-elements/Icon/Icon.cjs deleted file mode 100644 index 9352918cd..000000000 --- a/dist/components/icon-elements/Icon/Icon.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("../../../lib/constants.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),a=require("./styles.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=l(r);const c=i.makeClassName("Icon"),p={Simple:"simple",Light:"light",Shadow:"shadow",Solid:"solid",Outlined:"outlined"},d=n.default.forwardRef(((r,l)=>{const{icon:d,variant:u=p.Simple,tooltip:f,size:m=o.Sizes.SM,color:g,className:h}=r,b=e.__rest(r,["icon","variant","tooltip","size","color","className"]),j=d,w=a.getIconColors(u,g),{tooltipProps:S,getReferenceProps:q}=t.useTooltip();return n.default.createElement("span",Object.assign({ref:i.mergeRefs([l,S.refs.setReference]),className:s.tremorTwMerge(c("root"),"inline-flex shrink-0 items-center justify-center",w.bgColor,w.textColor,w.borderColor,w.ringColor,a.shape[u].rounded,a.shape[u].border,a.shape[u].shadow,a.shape[u].ring,a.wrapperProportions[m].paddingX,a.wrapperProportions[m].paddingY,h)},q,b),n.default.createElement(t.default,Object.assign({text:f},S)),n.default.createElement(j,{className:s.tremorTwMerge(c("icon"),"shrink-0",a.iconSizes[m].height,a.iconSizes[m].width)}))}));d.displayName="Icon",exports.IconVariants=p,exports.default=d; diff --git a/dist/components/icon-elements/Icon/Icon.d.ts b/dist/components/icon-elements/Icon/Icon.d.ts deleted file mode 100644 index 0041a26a3..000000000 --- a/dist/components/icon-elements/Icon/Icon.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react"; -import { Color, IconVariant, Size } from "../../../lib"; -export declare const IconVariants: { - [key: string]: IconVariant; -}; -export interface IconProps extends React.HTMLAttributes { - icon: React.ElementType; - variant?: IconVariant; - tooltip?: string; - size?: Size; - color?: Color; -} -declare const Icon: React.ForwardRefExoticComponent>; -export default Icon; diff --git a/dist/components/icon-elements/Icon/Icon.js b/dist/components/icon-elements/Icon/Icon.js deleted file mode 100644 index 65e6f67a6..000000000 --- a/dist/components/icon-elements/Icon/Icon.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import o from"react";import t,{useTooltip as r}from"../../util-elements/Tooltip/Tooltip.js";import{Sizes as i}from"../../../lib/constants.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as n}from"../../../lib/utils.js";import{getIconColors as a,shape as m,wrapperProportions as c,iconSizes as p}from"./styles.js";const d=n("Icon"),f={Simple:"simple",Light:"light",Shadow:"shadow",Solid:"solid",Outlined:"outlined"},g=o.forwardRef(((n,g)=>{const{icon:h,variant:b=f.Simple,tooltip:j,size:u=i.SM,color:w,className:N}=n,S=e(n,["icon","variant","tooltip","size","color","className"]),x=h,C=a(b,w),{tooltipProps:y,getReferenceProps:E}=r();return o.createElement("span",Object.assign({ref:l([g,y.refs.setReference]),className:s(d("root"),"inline-flex shrink-0 items-center justify-center",C.bgColor,C.textColor,C.borderColor,C.ringColor,m[b].rounded,m[b].border,m[b].shadow,m[b].ring,c[u].paddingX,c[u].paddingY,N)},E,S),o.createElement(t,Object.assign({text:j},y)),o.createElement(x,{className:s(d("icon"),"shrink-0",p[u].height,p[u].width)}))}));g.displayName="Icon";export{f as IconVariants,g as default}; diff --git a/dist/components/icon-elements/Icon/index.d.ts b/dist/components/icon-elements/Icon/index.d.ts deleted file mode 100644 index 74325024c..000000000 --- a/dist/components/icon-elements/Icon/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Icon } from "./Icon"; -export type { IconProps } from "./Icon"; diff --git a/dist/components/icon-elements/Icon/styles.cjs b/dist/components/icon-elements/Icon/styles.cjs deleted file mode 100644 index 40525ce78..000000000 --- a/dist/components/icon-elements/Icon/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../lib/theme.cjs"),o=require("../../../lib/tremorTwMerge.cjs"),e=require("../../../lib/utils.cjs");exports.getIconColors=(t,d)=>{switch(t){case"simple":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:d?e.getColorClassNames(d,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:d?e.getColorClassNames(d,r.colorPalette.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:d?o.tremorTwMerge(e.getColorClassNames(d,r.colorPalette.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},exports.iconSizes={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},exports.shape={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},exports.wrapperProportions={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}}; diff --git a/dist/components/icon-elements/Icon/styles.d.ts b/dist/components/icon-elements/Icon/styles.d.ts deleted file mode 100644 index 0635088d2..000000000 --- a/dist/components/icon-elements/Icon/styles.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Color, IconVariant } from "lib"; -export type WrapperProportionTypes = { - paddingX: string; - paddingY: string; -}; -export declare const wrapperProportions: { - [size: string]: WrapperProportionTypes; -}; -export declare const iconSizes: { - [size: string]: { - height: string; - width: string; - }; -}; -export type ShapeTypes = { - rounded: string; - border: string; - ring: string; - shadow: string; -}; -export declare const shape: { - [style: string]: ShapeTypes; -}; -export declare const getIconColors: (variant: IconVariant, color?: Color) => { - textColor: string; - bgColor: string; - borderColor: string; - ringColor: string; -}; diff --git a/dist/components/icon-elements/Icon/styles.js b/dist/components/icon-elements/Icon/styles.js deleted file mode 100644 index 5264f21f5..000000000 --- a/dist/components/icon-elements/Icon/styles.js +++ /dev/null @@ -1 +0,0 @@ -import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as d}from"../../../lib/utils.js";const e={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},t={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},a={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},n=(e,t)=>{switch(e){case"simple":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?d(t,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?o(d(t,r.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?d(t,r.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?o(d(t,r.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}};export{n as getIconColors,t as iconSizes,a as shape,e as wrapperProportions}; diff --git a/dist/components/icon-elements/index.d.ts b/dist/components/icon-elements/index.d.ts deleted file mode 100644 index b6e0e54f0..000000000 --- a/dist/components/icon-elements/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./Badge"; -export * from "./BadgeDelta"; -export * from "./Icon"; diff --git a/dist/components/index.d.ts b/dist/components/index.d.ts deleted file mode 100644 index c0342ea97..000000000 --- a/dist/components/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./chart-elements"; -export * from "./icon-elements"; -export * from "./input-elements"; -export * from "./layout-elements"; -export * from "./list-elements"; -export * from "./spark-elements"; -export * from "./text-elements"; -export * from "./vis-elements"; diff --git a/dist/components/input-elements/BaseInput.cjs b/dist/components/input-elements/BaseInput.cjs deleted file mode 100644 index 5df13697e..000000000 --- a/dist/components/input-elements/BaseInput.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("../../assets/ExclamationFilledIcon.cjs"),a=require("../../assets/EyeIcon.cjs"),n=require("../../assets/EyeOffIcon.cjs"),o=require("./selectUtils.cjs"),l=require("../../lib/tremorTwMerge.cjs"),s=require("../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(t);const c=d.default.forwardRef(((u,c)=>{const{value:m,defaultValue:i,type:p,placeholder:f="Type...",icon:b,error:g=!1,errorMessage:h,disabled:k=!1,stepper:x,makeInputClassName:w,className:v,onChange:E,onValueChange:M,autoFocus:N}=u,T=e.__rest(u,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[y,C]=t.useState(N||!1),[j,q]=t.useState(!1),I=t.useCallback((()=>q(!j)),[j,q]),V=b,F=t.useRef(null),L=o.hasValue(m||i);return d.default.useEffect((()=>{const e=()=>C(!0),t=()=>C(!1),r=F.current;return r&&(r.addEventListener("focus",e),r.addEventListener("blur",t),N&&r.focus()),()=>{r&&(r.removeEventListener("focus",e),r.removeEventListener("blur",t))}}),[N]),d.default.createElement(d.default.Fragment,null,d.default.createElement("div",{className:l.tremorTwMerge(w("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",o.getSelectButtonColors(L,k,g),y&&l.tremorTwMerge("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),v)},V?d.default.createElement(V,{className:l.tremorTwMerge(w("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,d.default.createElement("input",Object.assign({ref:s.mergeRefs([F,c]),defaultValue:i,value:m,type:j?"text":p,className:l.tremorTwMerge(w("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",V?"pl-2":"pl-3",g?"pr-3":"pr-4",k?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:f,disabled:k,"data-testid":"base-input",onChange:e=>{null==E||E(e),null==M||M(e.target.value)}},T)),"password"!==p||k?null:d.default.createElement("button",{className:l.tremorTwMerge(w("toggleButton"),"mr-2"),type:"button",onClick:()=>I(),"aria-label":j?"Hide password":"Show Password"},j?d.default.createElement(n,{className:l.tremorTwMerge("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):d.default.createElement(a,{className:l.tremorTwMerge("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?d.default.createElement(r,{className:l.tremorTwMerge(w("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=x?x:null),g&&h?d.default.createElement("p",{className:l.tremorTwMerge(w("errorMessage"),"text-sm text-red-500 mt-1")},h):null)}));c.displayName="BaseInput",module.exports=c; diff --git a/dist/components/input-elements/BaseInput.d.ts b/dist/components/input-elements/BaseInput.d.ts deleted file mode 100644 index 457dad426..000000000 --- a/dist/components/input-elements/BaseInput.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import React, { ReactNode } from "react"; -export interface BaseInputProps extends React.InputHTMLAttributes { - type?: "text" | "password" | "email" | "url" | "number"; - defaultValue?: string | number; - value?: string | number; - icon?: React.ElementType | React.JSXElementConstructor; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - stepper?: ReactNode; - onValueChange?: (value: any) => void; - makeInputClassName: (className: string) => string; -} -declare const BaseInput: React.ForwardRefExoticComponent>; -export default BaseInput; diff --git a/dist/components/input-elements/BaseInput.js b/dist/components/input-elements/BaseInput.js deleted file mode 100644 index 56a2a483f..000000000 --- a/dist/components/input-elements/BaseInput.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useState as r,useCallback as n,useRef as a}from"react";import o from"../../assets/ExclamationFilledIcon.js";import l from"../../assets/EyeIcon.js";import s from"../../assets/EyeOffIcon.js";import{getSelectButtonColors as m,hasValue as d}from"./selectUtils.js";import{tremorTwMerge as u}from"../../lib/tremorTwMerge.js";import{mergeRefs as c}from"../../lib/utils.js";const i=t.forwardRef(((i,p)=>{const{value:b,defaultValue:f,type:h,placeholder:k="Type...",icon:x,error:g=!1,errorMessage:w,disabled:E=!1,stepper:v,makeInputClassName:N,className:y,onChange:C,onValueChange:j,autoFocus:I}=i,V=e(i,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[F,L]=r(I||!1),[M,B]=r(!1),O=n((()=>B(!M)),[M,B]),T=x,H=a(null),P=d(b||f);return t.useEffect((()=>{const e=()=>L(!0),t=()=>L(!1),r=H.current;return r&&(r.addEventListener("focus",e),r.addEventListener("blur",t),I&&r.focus()),()=>{r&&(r.removeEventListener("focus",e),r.removeEventListener("blur",t))}}),[I]),t.createElement(t.Fragment,null,t.createElement("div",{className:u(N("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",m(P,E,g),F&&u("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),y)},T?t.createElement(T,{className:u(N("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,t.createElement("input",Object.assign({ref:c([H,p]),defaultValue:f,value:b,type:M?"text":h,className:u(N("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",T?"pl-2":"pl-3",g?"pr-3":"pr-4",E?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:k,disabled:E,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==j||j(e.target.value)}},V)),"password"!==h||E?null:t.createElement("button",{className:u(N("toggleButton"),"mr-2"),type:"button",onClick:()=>O(),"aria-label":M?"Hide password":"Show Password"},M?t.createElement(s,{className:u("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):t.createElement(l,{className:u("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?t.createElement(o,{className:u(N("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=v?v:null),g&&w?t.createElement("p",{className:u(N("errorMessage"),"text-sm text-red-500 mt-1")},w):null)}));i.displayName="BaseInput";export{i as default}; diff --git a/dist/components/input-elements/Button/Button.cjs b/dist/components/input-elements/Button/Button.cjs deleted file mode 100644 index 574f8176b..000000000 --- a/dist/components/input-elements/Button/Button.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),o=require("react"),r=require("react-transition-state"),i=require("../../../lib/constants.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),a=require("../../../assets/LoadingSpinner.cjs"),l=require("./styles.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(o);const d=s.makeClassName("Button"),m=({loading:e,iconSize:t,iconPosition:o,Icon:r,needMargin:s,transitionStatus:l})=>{const u=s?o===i.HorizontalPositions.Left?n.tremorTwMerge("-ml-1","mr-1.5"):n.tremorTwMerge("-mr-1","ml-1.5"):"",m=n.tremorTwMerge("w-0 h-0"),g={default:m,entering:m,entered:t,exiting:t,exited:m};return e?c.default.createElement(a,{className:n.tremorTwMerge(d("icon"),"animate-spin shrink-0",u,g.default,g[l]),style:{transition:"width 150ms"}}):c.default.createElement(r,{className:n.tremorTwMerge(d("icon"),"shrink-0",t,u)})},g=c.default.forwardRef(((a,u)=>{const{icon:g,iconPosition:f=i.HorizontalPositions.Left,size:p=i.Sizes.SM,color:h,variant:w="primary",disabled:T,loading:M=!1,loadingText:b,children:x,tooltip:z,className:P}=a,S=e.__rest(a,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),C=g,j=M||T,B=void 0!==C||M,v=M&&b,q=!(!x&&!v),y=n.tremorTwMerge(l.iconSizes[p].height,l.iconSizes[p].width),E="light"!==w?n.tremorTwMerge("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",N=l.getButtonColors(w,h),k=l.getButtonProportions(w)[p],{tooltipProps:R,getReferenceProps:H}=t.useTooltip(300),[I,O]=r.useTransition({timeout:50});return o.useEffect((()=>{O(M)}),[M]),c.default.createElement("button",Object.assign({ref:s.mergeRefs([u,R.refs.setReference]),className:n.tremorTwMerge(d("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",E,k.paddingX,k.paddingY,k.fontSize,N.textColor,N.bgColor,N.borderColor,N.hoverBorderColor,j?"opacity-50 cursor-not-allowed":n.tremorTwMerge(l.getButtonColors(w,h).hoverTextColor,l.getButtonColors(w,h).hoverBgColor,l.getButtonColors(w,h).hoverBorderColor),P),disabled:j},H,S),c.default.createElement(t.default,Object.assign({text:z},R)),B&&f!==i.HorizontalPositions.Right?c.default.createElement(m,{loading:M,iconSize:y,iconPosition:f,Icon:C,transitionStatus:I.status,needMargin:q}):null,v||x?c.default.createElement("span",{className:n.tremorTwMerge(d("text"),"text-tremor-default whitespace-nowrap")},v?b:x):null,B&&f===i.HorizontalPositions.Right?c.default.createElement(m,{loading:M,iconSize:y,iconPosition:f,Icon:C,transitionStatus:I.status,needMargin:q}):null)}));g.displayName="Button",exports.ButtonIconOrSpinner=m,exports.default=g; diff --git a/dist/components/input-elements/Button/Button.d.ts b/dist/components/input-elements/Button/Button.d.ts deleted file mode 100644 index 0e7f352cf..000000000 --- a/dist/components/input-elements/Button/Button.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import { type TransitionStatus } from "react-transition-state"; -import { ButtonVariant, Color, HorizontalPosition, Size } from "../../../lib"; -export interface ButtonIconOrSpinnerProps { - loading: boolean; - iconSize: string; - iconPosition: string; - Icon: React.ElementType | undefined; - needMargin: boolean; - transitionStatus: TransitionStatus; -} -export declare const ButtonIconOrSpinner: ({ loading, iconSize, iconPosition, Icon, needMargin, transitionStatus, }: ButtonIconOrSpinnerProps) => React.JSX.Element; -export interface ButtonProps extends React.ButtonHTMLAttributes { - icon?: React.ElementType; - iconPosition?: HorizontalPosition; - size?: Size; - color?: Color; - variant?: ButtonVariant; - disabled?: boolean; - loading?: boolean; - loadingText?: string; - tooltip?: string; -} -declare const Button: React.ForwardRefExoticComponent>; -export default Button; diff --git a/dist/components/input-elements/Button/Button.js b/dist/components/input-elements/Button/Button.js deleted file mode 100644 index 4f6a3ad5c..000000000 --- a/dist/components/input-elements/Button/Button.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as t}from"tslib";import e,{useTooltip as o}from"../../util-elements/Tooltip/Tooltip.js";import i,{useEffect as r}from"react";import{useTransition as n}from"react-transition-state";import{HorizontalPositions as a,Sizes as s}from"../../../lib/constants.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{mergeRefs as m,makeClassName as c}from"../../../lib/utils.js";import d from"../../../assets/LoadingSpinner.js";import{iconSizes as p,getButtonColors as u,getButtonProportions as f}from"./styles.js";const g=c("Button"),h=({loading:t,iconSize:e,iconPosition:o,Icon:r,needMargin:n,transitionStatus:s})=>{const m=n?o===a.Left?l("-ml-1","mr-1.5"):l("-mr-1","ml-1.5"):"",c=l("w-0 h-0"),p={default:c,entering:c,entered:e,exiting:e,exited:c};return t?i.createElement(d,{className:l(g("icon"),"animate-spin shrink-0",m,p.default,p[s]),style:{transition:"width 150ms"}}):i.createElement(r,{className:l(g("icon"),"shrink-0",e,m)})},b=i.forwardRef(((c,d)=>{const{icon:b,iconPosition:x=a.Left,size:w=s.SM,color:j,variant:S="primary",disabled:v,loading:C=!1,loadingText:E,children:N,tooltip:P,className:y}=c,z=t(c,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),T=b,k=C||v,B=void 0!==T||C,M=C&&E,R=!(!N&&!M),I=l(p[w].height,p[w].width),L="light"!==S?l("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",O=u(S,j),X=f(S)[w],{tooltipProps:Y,getReferenceProps:q}=o(300),[A,D]=n({timeout:50});return r((()=>{D(C)}),[C]),i.createElement("button",Object.assign({ref:m([d,Y.refs.setReference]),className:l(g("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",L,X.paddingX,X.paddingY,X.fontSize,O.textColor,O.bgColor,O.borderColor,O.hoverBorderColor,k?"opacity-50 cursor-not-allowed":l(u(S,j).hoverTextColor,u(S,j).hoverBgColor,u(S,j).hoverBorderColor),y),disabled:k},q,z),i.createElement(e,Object.assign({text:P},Y)),B&&x!==a.Right?i.createElement(h,{loading:C,iconSize:I,iconPosition:x,Icon:T,transitionStatus:A.status,needMargin:R}):null,M||N?i.createElement("span",{className:l(g("text"),"text-tremor-default whitespace-nowrap")},M?E:N):null,B&&x===a.Right?i.createElement(h,{loading:C,iconSize:I,iconPosition:x,Icon:T,transitionStatus:A.status,needMargin:R}):null)}));b.displayName="Button";export{h as ButtonIconOrSpinner,b as default}; diff --git a/dist/components/input-elements/Button/index.d.ts b/dist/components/input-elements/Button/index.d.ts deleted file mode 100644 index fdec70a12..000000000 --- a/dist/components/input-elements/Button/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Button } from "./Button"; -export type { ButtonProps } from "./Button"; diff --git a/dist/components/input-elements/Button/styles.cjs b/dist/components/input-elements/Button/styles.cjs deleted file mode 100644 index b0b8e3ce8..000000000 --- a/dist/components/input-elements/Button/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../lib/theme.cjs"),e=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");exports.getButtonColors=(t,a)=>{switch(t){case"primary":return{textColor:a?o.getColorClassNames("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:a?o.getColorClassNames("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:a?o.getColorClassNames(a,r.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:a?o.getColorClassNames(a,r.colorPalette.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:a?o.getColorClassNames(a,r.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:a?o.getColorClassNames(a,r.colorPalette.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o.getColorClassNames("transparent").bgColor,hoverBgColor:a?e.tremorTwMerge(o.getColorClassNames(a,r.colorPalette.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:a?o.getColorClassNames(a,r.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:a?o.getColorClassNames(a,r.colorPalette.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:a?o.getColorClassNames(a,r.colorPalette.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o.getColorClassNames("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},exports.getButtonProportions=r=>"light"!==r?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},exports.iconSizes={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}}; diff --git a/dist/components/input-elements/Button/styles.d.ts b/dist/components/input-elements/Button/styles.d.ts deleted file mode 100644 index 7bd06c09c..000000000 --- a/dist/components/input-elements/Button/styles.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { ButtonVariant, Color } from "lib"; -export declare const iconSizes: { - [size: string]: { - height: string; - width: string; - }; -}; -export declare const getButtonProportions: (variant: ButtonVariant) => { - xs: { - paddingX: string; - paddingY: string; - fontSize: string; - }; - sm: { - paddingX: string; - paddingY: string; - fontSize: string; - }; - md: { - paddingX: string; - paddingY: string; - fontSize: string; - }; - lg: { - paddingX: string; - paddingY: string; - fontSize: string; - }; - xl: { - paddingX: string; - paddingY: string; - fontSize: string; - }; -}; -export declare const getButtonColors: (variant: ButtonVariant, color?: Color) => { - textColor: string; - hoverTextColor: string; - bgColor: string; - hoverBgColor: string; - borderColor: string; - hoverBorderColor: string; -} | { - textColor: string; - hoverTextColor: string; - bgColor: string; - hoverBgColor: string; - borderColor: string; - hoverBorderColor?: undefined; -} | { - textColor: string; - hoverTextColor: string; - bgColor: string; - borderColor: string; - hoverBorderColor: string; - hoverBgColor?: undefined; -}; diff --git a/dist/components/input-elements/Button/styles.js b/dist/components/input-elements/Button/styles.js deleted file mode 100644 index dd8714777..000000000 --- a/dist/components/input-elements/Button/styles.js +++ /dev/null @@ -1 +0,0 @@ -import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";const t={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},d=r=>"light"!==r?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},a=(t,d)=>{switch(t){case"primary":return{textColor:d?o("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:d?o("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:d?o(d,r.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:d?o(d,r.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:d?o(d,r.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:d?o(d,r.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:d?o(d,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:d?o(d,r.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o("transparent").bgColor,hoverBgColor:d?e(o(d,r.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:d?o(d,r.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:d?o(d,r.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:d?o(d,r.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:o("transparent").bgColor,borderColor:"",hoverBorderColor:""}}};export{a as getButtonColors,d as getButtonProportions,t as iconSizes}; diff --git a/dist/components/input-elements/Calendar/Calendar.cjs b/dist/components/input-elements/Calendar/Calendar.cjs deleted file mode 100644 index 3be82c512..000000000 --- a/dist/components/input-elements/Calendar/Calendar.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("react-day-picker"),a=require("../../../assets/ArrowLeftHeadIcon.cjs"),o=require("../../../assets/ArrowRightHeadIcon.cjs"),n=require("../../../assets/DoubleArrowLeftHeadIcon.cjs"),s=require("../../../assets/DoubleArrowRightHeadIcon.cjs"),d=require("date-fns"),l=require("../../text-elements/Text/Text.cjs"),c=require("./NavButton.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(t);function m(t){var{mode:u,defaultMonth:m,selected:b,onSelect:f,locale:k,disabled:x,enableYearNavigation:h,classNames:v,weekStartsOn:p=0}=t,g=e.__rest(t,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return i.default.createElement(r.DayPicker,Object.assign({showOutsideDays:!0,mode:u,defaultMonth:m,selected:b,onSelect:f,locale:k,disabled:x,weekStartsOn:p,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},v),components:{IconLeft:t=>{var r=e.__rest(t,[]);return i.default.createElement(a,Object.assign({className:"h-4 w-4"},r))},IconRight:t=>{var r=e.__rest(t,[]);return i.default.createElement(o,Object.assign({className:"h-4 w-4"},r))},Caption:t=>{var u=e.__rest(t,[]);const{goToMonth:m,nextMonth:b,previousMonth:f,currentMonth:x}=r.useNavigation();return i.default.createElement("div",{className:"flex justify-between items-center"},i.default.createElement("div",{className:"flex items-center space-x-1"},h&&i.default.createElement(c.NavButton,{onClick:()=>x&&m(d.addYears(x,-1)),icon:n}),i.default.createElement(c.NavButton,{onClick:()=>f&&m(f),icon:a})),i.default.createElement(l,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},d.format(u.displayMonth,"LLLL yyy",{locale:k})),i.default.createElement("div",{className:"flex items-center space-x-1"},i.default.createElement(c.NavButton,{onClick:()=>b&&m(b),icon:o}),h&&i.default.createElement(c.NavButton,{onClick:()=>x&&m(d.addYears(x,1)),icon:s})))}}},g))}m.displayName="DateRangePicker",module.exports=m; diff --git a/dist/components/input-elements/Calendar/Calendar.d.ts b/dist/components/input-elements/Calendar/Calendar.d.ts deleted file mode 100644 index d5a12e263..000000000 --- a/dist/components/input-elements/Calendar/Calendar.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import { DayPickerRangeProps, DayPickerSingleProps } from "react-day-picker"; -declare function Calendar({ mode, defaultMonth, selected, onSelect, locale, disabled, enableYearNavigation, classNames, weekStartsOn, ...other }: T & { - enableYearNavigation: boolean; -}): React.JSX.Element; -declare namespace Calendar { - var displayName: string; -} -export default Calendar; diff --git a/dist/components/input-elements/Calendar/Calendar.js b/dist/components/input-elements/Calendar/Calendar.js deleted file mode 100644 index cf9d47786..000000000 --- a/dist/components/input-elements/Calendar/Calendar.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import{DayPicker as r,useNavigation as a}from"react-day-picker";import o from"../../../assets/ArrowLeftHeadIcon.js";import n from"../../../assets/ArrowRightHeadIcon.js";import s from"../../../assets/DoubleArrowLeftHeadIcon.js";import c from"../../../assets/DoubleArrowRightHeadIcon.js";import{addYears as d,format as l}from"date-fns";import m from"../../text-elements/Text/Text.js";import{NavButton as i}from"./NavButton.js";function u(u){var{mode:b,defaultMonth:f,selected:k,onSelect:x,locale:p,disabled:h,enableYearNavigation:g,classNames:v,weekStartsOn:w=0}=u,y=e(u,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return t.createElement(r,Object.assign({showOutsideDays:!0,mode:b,defaultMonth:f,selected:k,onSelect:x,locale:p,disabled:h,weekStartsOn:w,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},v),components:{IconLeft:r=>{var a=e(r,[]);return t.createElement(o,Object.assign({className:"h-4 w-4"},a))},IconRight:r=>{var a=e(r,[]);return t.createElement(n,Object.assign({className:"h-4 w-4"},a))},Caption:r=>{var u=e(r,[]);const{goToMonth:b,nextMonth:f,previousMonth:k,currentMonth:x}=a();return t.createElement("div",{className:"flex justify-between items-center"},t.createElement("div",{className:"flex items-center space-x-1"},g&&t.createElement(i,{onClick:()=>x&&b(d(x,-1)),icon:s}),t.createElement(i,{onClick:()=>k&&b(k),icon:o})),t.createElement(m,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},l(u.displayMonth,"LLLL yyy",{locale:p})),t.createElement("div",{className:"flex items-center space-x-1"},t.createElement(i,{onClick:()=>f&&b(f),icon:n}),g&&t.createElement(i,{onClick:()=>x&&b(d(x,1)),icon:c})))}}},y))}u.displayName="DateRangePicker";export{u as default}; diff --git a/dist/components/input-elements/Calendar/NavButton.cjs b/dist/components/input-elements/Calendar/NavButton.cjs deleted file mode 100644 index 3c3d16c3e..000000000 --- a/dist/components/input-elements/Calendar/NavButton.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib");require("../../icon-elements/Badge/Badge.cjs"),require("../../icon-elements/BadgeDelta/BadgeDelta.cjs");var r=require("../../icon-elements/Icon/Icon.cjs"),t=require("../../../lib/tremorTwMerge.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(require("react"));exports.NavButton=o=>{var{onClick:a,icon:d}=o,c=e.__rest(o,["onClick","icon"]);const u=d;return n.default.createElement("button",Object.assign({type:"button",className:t.tremorTwMerge("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},c),n.default.createElement(r.default,{onClick:a,icon:u,variant:"simple",color:"slate",size:"sm"}))}; diff --git a/dist/components/input-elements/Calendar/NavButton.d.ts b/dist/components/input-elements/Calendar/NavButton.d.ts deleted file mode 100644 index d9ac2cd5d..000000000 --- a/dist/components/input-elements/Calendar/NavButton.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -interface NavButtonProps extends React.HTMLAttributes { - onClick: () => void; - icon: React.ElementType; -} -export declare const NavButton: ({ onClick, icon, ...other }: NavButtonProps) => React.JSX.Element; -export {}; diff --git a/dist/components/input-elements/Calendar/NavButton.js b/dist/components/input-elements/Calendar/NavButton.js deleted file mode 100644 index 4aa29f023..000000000 --- a/dist/components/input-elements/Calendar/NavButton.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as r}from"tslib";import"../../icon-elements/Badge/Badge.js";import"../../icon-elements/BadgeDelta/BadgeDelta.js";import e from"../../icon-elements/Icon/Icon.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import o from"react";const n=n=>{var{onClick:m,icon:a}=n,d=r(n,["onClick","icon"]);const c=a;return o.createElement("button",Object.assign({type:"button",className:t("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},d),o.createElement(e,{onClick:m,icon:c,variant:"simple",color:"slate",size:"sm"}))};export{n as NavButton}; diff --git a/dist/components/input-elements/Calendar/index.d.ts b/dist/components/input-elements/Calendar/index.d.ts deleted file mode 100644 index eca04c49a..000000000 --- a/dist/components/input-elements/Calendar/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Calendar } from "./Calendar"; diff --git a/dist/components/input-elements/DatePicker/DatePicker.cjs b/dist/components/input-elements/DatePicker/DatePicker.cjs deleted file mode 100644 index 750e7b1aa..000000000 --- a/dist/components/input-elements/DatePicker/DatePicker.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("date-fns"),o=require("date-fns/locale"),n=require("@headlessui/react"),l=require("../../../assets/CalendarIcon.cjs"),d=require("../../../assets/XCircleIcon.cjs"),s=require("../Calendar/Calendar.cjs"),i=require("./datePickerUtils.cjs"),u=require("../../../hooks/useInternalState.cjs"),m=require("../DateRangePicker/dateRangePickerUtils.cjs"),c=require("../selectUtils.cjs");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=f(r);const k=a.startOfToday(),p=b.default.forwardRef(((f,p)=>{var g;const{value:w,defaultValue:v,onValueChange:h,minDate:y,maxDate:x,placeholder:N="Select date",disabled:q=!1,locale:D=o.enUS,enableClear:C=!0,displayFormat:T,className:j,enableYearNavigation:M=!1,weekStartsOn:E=0,disabledDates:P}=f,S=e.__rest(f,["value","defaultValue","onValueChange","minDate","maxDate","placeholder","disabled","locale","enableClear","displayFormat","className","enableYearNavigation","weekStartsOn","disabledDates"]),[O,V]=u(v,w),F=r.useMemo((()=>{const e=[];return y&&e.push({before:y}),x&&e.push({after:x}),[...e,...null!=P?P:[]]}),[y,x,P]),I=O?m.formatSelectedDates(O,void 0,D,T):N,U=a.startOfMonth(null!==(g=null!=O?O:x)&&void 0!==g?g:k),R=C&&!q;return b.default.createElement(n.Popover,Object.assign({ref:p,as:"div",className:t.tremorTwMerge("relative w-full min-w-[10rem] text-tremor-default","focus:ring-2 focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted",j)},S),b.default.createElement(n.Popover.Button,{disabled:q,className:t.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-tremor-default flex flex-nowrap border pl-3 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",R?"pr-8":"pr-4",c.getSelectButtonColors(c.hasValue(O),q))},b.default.createElement(l,{className:t.tremorTwMerge(i.makeDatePickerClassName("calendarIcon"),"flex-none shrink-0 h-5 w-5 mr-2 -ml-0.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),b.default.createElement("p",{className:"truncate"},I)),R&&O?b.default.createElement("button",{type:"button",className:t.tremorTwMerge("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==h||h(void 0),V(void 0)}},b.default.createElement(d,{className:t.tremorTwMerge("flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,b.default.createElement(n.Transition,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(n.Popover.Panel,{className:t.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},(({close:e})=>b.default.createElement(s,{showOutsideDays:!0,mode:"single",defaultMonth:U,selected:O,weekStartsOn:E,onSelect:r=>{null==h||h(r),V(r),e()},locale:D,disabled:F,enableYearNavigation:M})))))}));p.displayName="DatePicker",module.exports=p; diff --git a/dist/components/input-elements/DatePicker/DatePicker.d.ts b/dist/components/input-elements/DatePicker/DatePicker.d.ts deleted file mode 100644 index f962a4834..000000000 --- a/dist/components/input-elements/DatePicker/DatePicker.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import React from "react"; -import { enUS } from "date-fns/locale"; -import { Color } from "../../../lib/inputTypes"; -export type Locale = typeof enUS; -export type DatePickerValue = Date | undefined; -export interface DatePickerProps extends Omit, "value" | "defaultValue"> { - value?: Date; - defaultValue?: Date; - onValueChange?: (value: DatePickerValue) => void; - minDate?: Date; - maxDate?: Date; - placeholder?: string; - disabled?: boolean; - color?: Color; - locale?: Locale; - enableClear?: boolean; - displayFormat?: string; - enableYearNavigation?: boolean; - weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; - disabledDates?: Date[]; - children?: React.ReactElement[] | React.ReactElement; -} -declare const DatePicker: React.ForwardRefExoticComponent>; -export default DatePicker; diff --git a/dist/components/input-elements/DatePicker/DatePicker.js b/dist/components/input-elements/DatePicker/DatePicker.js deleted file mode 100644 index 6f5790ede..000000000 --- a/dist/components/input-elements/DatePicker/DatePicker.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r,{useMemo as t}from"react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{startOfToday as o,startOfMonth as n}from"date-fns";import{enUS as l}from"date-fns/locale";import{Popover as d,Transition as s}from"@headlessui/react";import m from"../../../assets/CalendarIcon.js";import i from"../../../assets/XCircleIcon.js";import c from"../Calendar/Calendar.js";import{makeDatePickerClassName as u}from"./datePickerUtils.js";import b from"../../../hooks/useInternalState.js";import{formatSelectedDates as f}from"../DateRangePicker/dateRangePickerUtils.js";import{getSelectButtonColors as p,hasValue as k}from"../selectUtils.js";const h=o(),w=r.forwardRef(((o,w)=>{var g;const{value:v,defaultValue:y,onValueChange:x,minDate:N,maxDate:D,placeholder:j="Select date",disabled:C=!1,locale:E=l,enableClear:S=!0,displayFormat:O,className:P,enableYearNavigation:F=!1,weekStartsOn:I=0,disabledDates:V}=o,R=e(o,["value","defaultValue","onValueChange","minDate","maxDate","placeholder","disabled","locale","enableClear","displayFormat","className","enableYearNavigation","weekStartsOn","disabledDates"]),[T,U]=b(y,v),Y=t((()=>{const e=[];return N&&e.push({before:N}),D&&e.push({after:D}),[...e,...null!=V?V:[]]}),[N,D,V]),M=T?f(T,void 0,E,O):j,z=n(null!==(g=null!=T?T:D)&&void 0!==g?g:h),B=S&&!C;return r.createElement(d,Object.assign({ref:w,as:"div",className:a("relative w-full min-w-[10rem] text-tremor-default","focus:ring-2 focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted",P)},R),r.createElement(d.Button,{disabled:C,className:a("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-tremor-default flex flex-nowrap border pl-3 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",B?"pr-8":"pr-4",p(k(T),C))},r.createElement(m,{className:a(u("calendarIcon"),"flex-none shrink-0 h-5 w-5 mr-2 -ml-0.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),r.createElement("p",{className:"truncate"},M)),B&&T?r.createElement("button",{type:"button",className:a("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==x||x(void 0),U(void 0)}},r.createElement(i,{className:a("flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,r.createElement(s,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(d.Panel,{className:a("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},(({close:e})=>r.createElement(c,{showOutsideDays:!0,mode:"single",defaultMonth:z,selected:T,weekStartsOn:I,onSelect:r=>{null==x||x(r),U(r),e()},locale:E,disabled:Y,enableYearNavigation:F})))))}));w.displayName="DatePicker";export{w as default}; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.cjs b/dist/components/input-elements/DatePicker/datePickerUtils.cjs deleted file mode 100644 index 950e74985..000000000 --- a/dist/components/input-elements/DatePicker/datePickerUtils.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../lib/tremorTwMerge.cjs");const e=require("../../../lib/utils.cjs").makeClassName("DatePicker");exports.makeDatePickerClassName=e; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.d.ts b/dist/components/input-elements/DatePicker/datePickerUtils.d.ts deleted file mode 100644 index af49b0c20..000000000 --- a/dist/components/input-elements/DatePicker/datePickerUtils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const makeDatePickerClassName: (className: string) => string; diff --git a/dist/components/input-elements/DatePicker/datePickerUtils.js b/dist/components/input-elements/DatePicker/datePickerUtils.js deleted file mode 100644 index 25992eb4e..000000000 --- a/dist/components/input-elements/DatePicker/datePickerUtils.js +++ /dev/null @@ -1 +0,0 @@ -import"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";const t=r("DatePicker");export{t as makeDatePickerClassName}; diff --git a/dist/components/input-elements/DatePicker/index.d.ts b/dist/components/input-elements/DatePicker/index.d.ts deleted file mode 100644 index 87d6c1b35..000000000 --- a/dist/components/input-elements/DatePicker/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as DatePicker } from "./DatePicker"; -export type { DatePickerProps, DatePickerValue } from "./DatePicker"; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs b/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs deleted file mode 100644 index 284ef64c5..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePicker.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("react"),a=require("../../../assets/CalendarIcon.cjs"),o=require("../../../assets/XCircleIcon.cjs"),l=require("date-fns"),n=require("../../../lib/tremorTwMerge.cjs"),d=require("../selectUtils.cjs"),s=require("./dateRangePickerUtils.cjs"),u=require("../Calendar/Calendar.cjs");require("../Select/Select.cjs");var m=require("../Select/SelectItem.cjs"),i=require("date-fns/locale"),c=require("../../../hooks/useInternalState.cjs");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=f(t);const k=l.startOfToday(),p=b.default.forwardRef(((f,p)=>{var g,v;const{value:w,defaultValue:h,onValueChange:x,enableSelect:y=!0,minDate:N,maxDate:E,placeholder:T="Select range",selectPlaceholder:M="Select range",disabled:S=!1,locale:C=i.enUS,enableClear:q=!0,displayFormat:D,children:j,className:O,enableYearNavigation:P=!1,weekStartsOn:V=0,disabledDates:F}=f,_=e.__rest(f,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[B,I]=c(h,w),[R,z]=t.useState(!1),[L,U]=t.useState(!1),Y=t.useMemo((()=>{const e=[];return N&&e.push({before:N}),E&&e.push({after:E}),[...e,...null!=F?F:[]]}),[N,E,F]),X=t.useMemo((()=>{const e=new Map;return j?b.default.Children.forEach(j,(r=>{var t;e.set(r.props.value,{text:null!==(t=d.getNodeText(r))&&void 0!==t?t:r.props.value,from:r.props.from,to:r.props.to})})):s.defaultOptions.forEach((r=>{e.set(r.value,{text:r.text,from:r.from,to:k})})),e}),[j]),A=t.useMemo((()=>{if(j)return d.constructValueToNameMapping(j);const e=new Map;return s.defaultOptions.forEach((r=>e.set(r.value,r.text))),e}),[j]),G=(null==B?void 0:B.selectValue)||"",H=s.parseStartDate(null==B?void 0:B.from,N,G,X),J=s.parseEndDate(null==B?void 0:B.to,E,G,X),K=H||J?s.formatSelectedDates(H,J,C,D):T,Q=l.startOfMonth(null!==(v=null!==(g=null!=J?J:H)&&void 0!==g?g:E)&&void 0!==v?v:k),W=q&&!S;return b.default.createElement("div",Object.assign({ref:p,className:n.tremorTwMerge("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",O)},_),b.default.createElement(r.Popover,{as:"div",className:n.tremorTwMerge("w-full",y?"rounded-l-tremor-default":"rounded-tremor-default",R&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},b.default.createElement("div",{className:"relative w-full"},b.default.createElement(r.Popover.Button,{onFocus:()=>z(!0),onBlur:()=>z(!1),disabled:S,className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",y?"rounded-l-tremor-default":"rounded-tremor-default",W?"pr-8":"pr-4",d.getSelectButtonColors(d.hasValue(H||J),S))},b.default.createElement(a,{className:n.tremorTwMerge(s.makeDateRangePickerClassName("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),b.default.createElement("p",{className:"truncate"},K)),W&&H?b.default.createElement("button",{type:"button",className:n.tremorTwMerge("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==x||x({}),I({})}},b.default.createElement(o,{className:n.tremorTwMerge(s.makeDateRangePickerClassName("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),b.default.createElement(r.Transition,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(r.Popover.Panel,{focus:!0,className:n.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b.default.createElement(u,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:Q,selected:{from:H,to:J},onSelect:e=>{null==x||x({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),I({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:C,disabled:Y,enableYearNavigation:P,classNames:{day_range_middle:n.tremorTwMerge("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:V},f))))),y&&b.default.createElement(r.Listbox,{as:"div",className:n.tremorTwMerge("w-48 -ml-px rounded-r-tremor-default",L&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:G,onChange:e=>{const{from:r,to:t}=X.get(e),a=null!=t?t:k;null==x||x({from:r,to:a,selectValue:e}),I({from:r,to:a,selectValue:e})},disabled:S},(({value:e})=>{var t;return b.default.createElement(b.default.Fragment,null,b.default.createElement(r.Listbox.Button,{onFocus:()=>U(!0),onBlur:()=>U(!1),className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",d.getSelectButtonColors(d.hasValue(e),S))},e&&null!==(t=A.get(e))&&void 0!==t?t:M),b.default.createElement(r.Transition,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},b.default.createElement(r.Listbox.Options,{className:n.tremorTwMerge("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=j?j:s.defaultOptions.map((e=>b.default.createElement(m,{key:e.value,value:e.value},e.text))))))})))}));p.displayName="DateRangePicker",module.exports=p; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts b/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts deleted file mode 100644 index 0b6f2819f..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePicker.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import React from "react"; -import { enUS } from "date-fns/locale"; -import { Color } from "../../../lib/inputTypes"; -export type Locale = typeof enUS; -export type DateRangePickerValue = { - from?: Date; - to?: Date; - selectValue?: string; -}; -export interface DateRangePickerProps extends Omit, "value" | "defaultValue"> { - value?: DateRangePickerValue; - defaultValue?: DateRangePickerValue; - onValueChange?: (value: DateRangePickerValue) => void; - enableSelect?: boolean; - minDate?: Date; - maxDate?: Date; - placeholder?: string; - selectPlaceholder?: string; - disabled?: boolean; - color?: Color; - locale?: Locale; - enableClear?: boolean; - displayFormat?: string; - enableYearNavigation?: boolean; - weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; - disabledDates?: Date[]; - children?: React.ReactElement[] | React.ReactElement; -} -declare const DateRangePicker: React.ForwardRefExoticComponent>; -export default DateRangePicker; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePicker.js b/dist/components/input-elements/DateRangePicker/DateRangePicker.js deleted file mode 100644 index 564dd0904..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePicker.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Popover as r,Transition as t,Listbox as a}from"@headlessui/react";import o,{useState as n,useMemo as l}from"react";import d from"../../../assets/CalendarIcon.js";import s from"../../../assets/XCircleIcon.js";import{startOfToday as m,startOfMonth as i}from"date-fns";import{tremorTwMerge as u}from"../../../lib/tremorTwMerge.js";import{getNodeText as c,constructValueToNameMapping as b,getSelectButtonColors as f,hasValue as p}from"../selectUtils.js";import{defaultOptions as k,parseStartDate as v,parseEndDate as g,formatSelectedDates as w,makeDateRangePickerClassName as h}from"./dateRangePickerUtils.js";import y from"../Calendar/Calendar.js";import"../Select/Select.js";import x from"../Select/SelectItem.js";import{enUS as N}from"date-fns/locale";import E from"../../../hooks/useInternalState.js";const S=m(),j=o.forwardRef(((m,j)=>{var C,D;const{value:F,defaultValue:O,onValueChange:V,enableSelect:I=!0,minDate:_,maxDate:P,placeholder:T="Select range",selectPlaceholder:z="Select range",disabled:B=!1,locale:M=N,enableClear:R=!0,displayFormat:Y,children:U,className:X,enableYearNavigation:q=!1,weekStartsOn:A=0,disabledDates:G}=m,H=e(m,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[J,K]=E(O,F),[L,Q]=n(!1),[W,Z]=n(!1),$=l((()=>{const e=[];return _&&e.push({before:_}),P&&e.push({after:P}),[...e,...null!=G?G:[]]}),[_,P,G]),ee=l((()=>{const e=new Map;return U?o.Children.forEach(U,(r=>{var t;e.set(r.props.value,{text:null!==(t=c(r))&&void 0!==t?t:r.props.value,from:r.props.from,to:r.props.to})})):k.forEach((r=>{e.set(r.value,{text:r.text,from:r.from,to:S})})),e}),[U]),re=l((()=>{if(U)return b(U);const e=new Map;return k.forEach((r=>e.set(r.value,r.text))),e}),[U]),te=(null==J?void 0:J.selectValue)||"",ae=v(null==J?void 0:J.from,_,te,ee),oe=g(null==J?void 0:J.to,P,te,ee),ne=ae||oe?w(ae,oe,M,Y):T,le=i(null!==(D=null!==(C=null!=oe?oe:ae)&&void 0!==C?C:P)&&void 0!==D?D:S),de=R&&!B;return o.createElement("div",Object.assign({ref:j,className:u("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",X)},H),o.createElement(r,{as:"div",className:u("w-full",I?"rounded-l-tremor-default":"rounded-tremor-default",L&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},o.createElement("div",{className:"relative w-full"},o.createElement(r.Button,{onFocus:()=>Q(!0),onBlur:()=>Q(!1),disabled:B,className:u("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"rounded-l-tremor-default":"rounded-tremor-default",de?"pr-8":"pr-4",f(p(ae||oe),B))},o.createElement(d,{className:u(h("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),o.createElement("p",{className:"truncate"},ne)),de&&ae?o.createElement("button",{type:"button",className:u("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==V||V({}),K({})}},o.createElement(s,{className:u(h("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),o.createElement(t,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(r.Panel,{focus:!0,className:u("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement(y,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:le,selected:{from:ae,to:oe},onSelect:e=>{null==V||V({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),K({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:M,disabled:$,enableYearNavigation:q,classNames:{day_range_middle:u("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:A},m))))),I&&o.createElement(a,{as:"div",className:u("w-48 -ml-px rounded-r-tremor-default",W&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:te,onChange:e=>{const{from:r,to:t}=ee.get(e),a=null!=t?t:S;null==V||V({from:r,to:a,selectValue:e}),K({from:r,to:a,selectValue:e})},disabled:B},(({value:e})=>{var r;return o.createElement(o.Fragment,null,o.createElement(a.Button,{onFocus:()=>Z(!0),onBlur:()=>Z(!1),className:u("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",f(p(e),B))},e&&null!==(r=re.get(e))&&void 0!==r?r:z),o.createElement(t,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(a.Options,{className:u("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=U?U:k.map((e=>o.createElement(x,{key:e.value,value:e.value},e.text))))))})))}));j.displayName="DateRangePicker";export{j as default}; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs deleted file mode 100644 index f9873c945..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react");require("../Select/Select.cjs");var r=require("../Select/SelectItem.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t);const c=l.default.forwardRef(((t,a)=>{const{value:c,className:s,children:u}=t,i=e.__rest(t,["value","className","children"]);return l.default.createElement(r,Object.assign({ref:a,className:s,value:c},i),null!=u?u:c)}));c.displayName="DateRangePickerItem",module.exports=c; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts deleted file mode 100644 index 43050a352..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react"; -export interface DateRangePickerItemProps extends React.HTMLAttributes { - value: string; - from: Date; - to?: Date; -} -declare const DateRangePickerItem: React.ForwardRefExoticComponent>; -export default DateRangePickerItem; diff --git a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js b/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js deleted file mode 100644 index 0972a02bc..000000000 --- a/dist/components/input-elements/DateRangePicker/DateRangePickerItem.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import"../Select/Select.js";import a from"../Select/SelectItem.js";const l=t.forwardRef(((l,r)=>{const{value:c,className:s,children:m}=l,o=e(l,["value","className","children"]);return t.createElement(a,Object.assign({ref:r,className:s,value:c},o),null!=m?m:c)}));l.displayName="DateRangePickerItem";export{l as default}; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs deleted file mode 100644 index effd7c6ab..000000000 --- a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("date-fns");require("../../../lib/tremorTwMerge.cjs");const e=require("../../../lib/utils.cjs").makeClassName("DateRangePicker"),r=[{value:"tdy",text:"Today",from:t.startOfToday()},{value:"w",text:"Last 7 days",from:t.sub(t.startOfToday(),{days:7})},{value:"t",text:"Last 30 days",from:t.sub(t.startOfToday(),{days:30})},{value:"m",text:"Month to Date",from:t.startOfMonth(t.startOfToday())},{value:"y",text:"Year to Date",from:t.startOfYear(t.startOfToday())}];exports.defaultOptions=r,exports.formatSelectedDates=(e,r,a,o)=>{const s=(null==a?void 0:a.code)||"en-US";if(!e&&!r)return"";if(e&&!r){if(o)return t.format(e,o);const r={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(s,r)}if(e&&r){if(t.isEqual(e,r)){if(o)return t.format(e,o);const r={year:"numeric",month:"short",day:"numeric"};return e.toLocaleDateString(s,r)}if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){if(o)return`${t.format(e,o)} - ${t.format(r,o)}`;const a={month:"short",day:"numeric"};return`${e.toLocaleDateString(s,a)} - \n ${r.getDate()}, ${r.getFullYear()}`}{if(o)return`${t.format(e,o)} - ${t.format(r,o)}`;const a={year:"numeric",month:"short",day:"numeric"};return`${e.toLocaleDateString(s,a)} - \n ${r.toLocaleDateString(s,a)}`}}return""},exports.makeDateRangePickerClassName=e,exports.parseEndDate=(e,r,a,o)=>{var s,n;if(a&&(e=t.startOfDay(null!==(n=null===(s=o.get(a))||void 0===s?void 0:s.to)&&void 0!==n?n:t.startOfToday())),e)return e&&!r?t.startOfDay(e):t.startOfDay(t.min([e,r]))},exports.parseStartDate=(e,r,a,o)=>{var s;if(a&&(e=null===(s=o.get(a))||void 0===s?void 0:s.from),e)return e&&!r?t.startOfDay(e):t.startOfDay(t.max([e,r]))}; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts deleted file mode 100644 index 4ad184103..000000000 --- a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type DateRangePickerOption = { - value: string; - text: string; - from: Date; - to?: Date; -}; -export type DropdownValues = Map>; -export declare const makeDateRangePickerClassName: (className: string) => string; -export declare const parseStartDate: (startDate: Date | undefined, minDate: Date | undefined, selectedDropdownValue: string | undefined, selectValues: DropdownValues) => Date | undefined; -export declare const parseEndDate: (endDate: Date | undefined, maxDate: Date | undefined, selectedDropdownValue: string | undefined, selectValues: DropdownValues) => Date | undefined; -export declare const defaultOptions: DateRangePickerOption[]; -export declare const formatSelectedDates: (startDate: Date | undefined, endDate: Date | undefined, locale?: Locale, displayFormat?: string) => string; diff --git a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js b/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js deleted file mode 100644 index 5ce9b52ec..000000000 --- a/dist/components/input-elements/DateRangePicker/dateRangePickerUtils.js +++ /dev/null @@ -1 +0,0 @@ -import{startOfToday as t,sub as e,startOfMonth as r,startOfYear as o,startOfDay as n,max as a,min as i,format as u,isEqual as l}from"date-fns";import"../../../lib/tremorTwMerge.js";import{makeClassName as m}from"../../../lib/utils.js";const c=m("DateRangePicker"),f=(t,e,r,o)=>{var i;if(r&&(t=null===(i=o.get(r))||void 0===i?void 0:i.from),t)return n(t&&!e?t:a([t,e]))},s=(e,r,o,a)=>{var u,l;if(o&&(e=n(null!==(l=null===(u=a.get(o))||void 0===u?void 0:u.to)&&void 0!==l?l:t())),e)return n(e&&!r?e:i([e,r]))},d=[{value:"tdy",text:"Today",from:t()},{value:"w",text:"Last 7 days",from:e(t(),{days:7})},{value:"t",text:"Last 30 days",from:e(t(),{days:30})},{value:"m",text:"Month to Date",from:r(t())},{value:"y",text:"Year to Date",from:o(t())}],g=(t,e,r,o)=>{const n=(null==r?void 0:r.code)||"en-US";if(!t&&!e)return"";if(t&&!e){if(o)return u(t,o);const e={year:"numeric",month:"short",day:"numeric"};return t.toLocaleDateString(n,e)}if(t&&e){if(l(t,e)){if(o)return u(t,o);const e={year:"numeric",month:"short",day:"numeric"};return t.toLocaleDateString(n,e)}if(t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()){if(o)return`${u(t,o)} - ${u(e,o)}`;const r={month:"short",day:"numeric"};return`${t.toLocaleDateString(n,r)} - \n ${e.getDate()}, ${e.getFullYear()}`}{if(o)return`${u(t,o)} - ${u(e,o)}`;const r={year:"numeric",month:"short",day:"numeric"};return`${t.toLocaleDateString(n,r)} - \n ${e.toLocaleDateString(n,r)}`}}return""};export{d as defaultOptions,g as formatSelectedDates,c as makeDateRangePickerClassName,s as parseEndDate,f as parseStartDate}; diff --git a/dist/components/input-elements/DateRangePicker/index.d.ts b/dist/components/input-elements/DateRangePicker/index.d.ts deleted file mode 100644 index 331559f4c..000000000 --- a/dist/components/input-elements/DateRangePicker/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as DateRangePicker } from "./DateRangePicker"; -export type { DateRangePickerProps, DateRangePickerValue } from "./DateRangePicker"; -export { default as DateRangePickerItem } from "./DateRangePickerItem"; -export type { DateRangePickerItemProps } from "./DateRangePickerItem"; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.cjs b/dist/components/input-elements/MultiSelect/MultiSelect.cjs deleted file mode 100644 index c9e3fbec6..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelect.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs");var r=require("../../../contexts/SelectedValueContext.cjs"),a=require("../../../hooks/useInternalState.cjs"),l=require("../../../assets/ArrowDownHeadIcon.cjs"),o=require("../../../assets/SearchIcon.cjs"),n=require("../../../assets/XCircleIcon.cjs"),s=require("@headlessui/react"),d=require("../../../assets/XIcon.cjs"),u=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs"),m=require("../selectUtils.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=i(t);const p=c.makeClassName("MultiSelect"),b=f.default.forwardRef(((c,i)=>{const{defaultValue:b=[],value:g,onValueChange:x,placeholder:h="Select...",placeholderSearch:k="Search",disabled:w=!1,icon:v,children:E,className:y,required:N,name:M,error:T=!1,errorMessage:C,id:q}=c,j=e.__rest(c,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),S=t.useRef(null),I=v,[V,D]=a(b,g),{reactElementChildren:F,optionsAvailable:A}=t.useMemo((()=>{const e=f.default.Children.toArray(E).filter(t.isValidElement);return{reactElementChildren:e,optionsAvailable:m.getFilteredOptions("",e)}}),[E]),[O,B]=t.useState(""),R=(null!=V?V:[]).length>0,L=t.useMemo((()=>O?m.getFilteredOptions(O,F):A),[O,F,A]),z=()=>{B("")};return f.default.createElement("div",{className:u.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},f.default.createElement("select",{title:"multi-select-hidden",required:N,className:u.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:V,onChange:e=>{e.preventDefault()},name:M,disabled:w,multiple:!0,id:q,onFocus:()=>{const e=S.current;e&&e.focus()}},f.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},h),L.map((e=>{const t=e.props.value,r=e.props.children;return f.default.createElement("option",{className:"hidden",key:t,value:t},r)}))),f.default.createElement(s.Listbox,Object.assign({as:"div",ref:i,defaultValue:V,value:V,onChange:e=>{null==x||x(e),D(e)},disabled:w,className:u.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",y),id:q,multiple:!0},j),(({value:e})=>f.default.createElement(f.default.Fragment,null,f.default.createElement(s.Listbox.Button,{className:u.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"pl-11 -ml-0.5":"pl-3",m.getSelectButtonColors(e.length>0,w,T)),ref:S},I&&f.default.createElement("span",{className:u.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},f.default.createElement(I,{className:u.tremorTwMerge(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),f.default.createElement("div",{className:"h-6 flex items-center"},e.length>0?f.default.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},A.filter((t=>e.includes(t.props.value))).map(((t,r)=>{var a;return f.default.createElement("div",{key:r,className:u.tremorTwMerge("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},f.default.createElement("div",{className:"text-xs truncate "},null!==(a=t.props.children)&&void 0!==a?a:t.props.value),f.default.createElement("div",{onClick:r=>{r.preventDefault();const a=e.filter((e=>e!==t.props.value));null==x||x(a),D(a)}},f.default.createElement(d,{className:u.tremorTwMerge(p("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))}))):f.default.createElement("span",null,h)),f.default.createElement("span",{className:u.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-2.5")},f.default.createElement(l,{className:u.tremorTwMerge(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),R&&!w?f.default.createElement("button",{type:"button",className:u.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),D([]),null==x||x([])}},f.default.createElement(n,{className:u.tremorTwMerge(p("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,f.default.createElement(s.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},f.default.createElement(s.Listbox.Options,{className:u.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},f.default.createElement("div",{className:u.tremorTwMerge("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},f.default.createElement("span",null,f.default.createElement(o,{className:u.tremorTwMerge("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),f.default.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:k,className:u.tremorTwMerge("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>B(e.target.value),value:O})),f.default.createElement(r.Provider,Object.assign({},{onBlur:{handleResetSearch:z}},{value:{selectedValue:e}}),L)))))),T&&C?f.default.createElement("p",{className:u.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},C):null)}));b.displayName="MultiSelect",module.exports=b; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.d.ts b/dist/components/input-elements/MultiSelect/MultiSelect.d.ts deleted file mode 100644 index 8c55b621e..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelect.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -export interface MultiSelectProps extends React.HTMLAttributes { - defaultValue?: string[]; - name?: string; - value?: string[]; - onValueChange?: (value: string[]) => void; - placeholder?: string; - placeholderSearch?: string; - disabled?: boolean; - icon?: React.ElementType | React.JSXElementConstructor; - required?: boolean; - error?: boolean; - errorMessage?: string; - children: React.ReactNode; -} -declare const MultiSelect: React.ForwardRefExoticComponent>; -export default MultiSelect; diff --git a/dist/components/input-elements/MultiSelect/MultiSelect.js b/dist/components/input-elements/MultiSelect/MultiSelect.js deleted file mode 100644 index 0d80be447..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelect.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useRef as r,useMemo as a,isValidElement as o,useState as l}from"react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import n from"../../../contexts/SelectedValueContext.js";import s from"../../../hooks/useInternalState.js";import m from"../../../assets/ArrowDownHeadIcon.js";import d from"../../../assets/SearchIcon.js";import c from"../../../assets/XCircleIcon.js";import{Listbox as u,Transition as i}from"@headlessui/react";import p from"../../../assets/XIcon.js";import{tremorTwMerge as f}from"../../../lib/tremorTwMerge.js";import{makeClassName as b}from"../../../lib/utils.js";import{getFilteredOptions as x,getSelectButtonColors as h}from"../selectUtils.js";const k=b("MultiSelect"),v=t.forwardRef(((b,v)=>{const{defaultValue:g=[],value:w,onValueChange:E,placeholder:y="Select...",placeholderSearch:N="Search",disabled:C=!1,icon:j,children:I,className:S,required:V,name:D,error:M=!1,errorMessage:A,id:F}=b,q=e(b,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),B=r(null),O=j,[R,T]=s(g,w),{reactElementChildren:z,optionsAvailable:P}=a((()=>{const e=t.Children.toArray(I).filter(o);return{reactElementChildren:e,optionsAvailable:x("",e)}}),[I]),[X,H]=l(""),K=(null!=R?R:[]).length>0,U=a((()=>X?x(X,z):P),[X,z,P]),G=()=>{H("")};return t.createElement("div",{className:f("w-full min-w-[10rem] relative text-tremor-default")},t.createElement("select",{title:"multi-select-hidden",required:V,className:f("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:R,onChange:e=>{e.preventDefault()},name:D,disabled:C,multiple:!0,id:F,onFocus:()=>{const e=B.current;e&&e.focus()}},t.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},y),U.map((e=>{const r=e.props.value,a=e.props.children;return t.createElement("option",{className:"hidden",key:r,value:r},a)}))),t.createElement(u,Object.assign({as:"div",ref:v,defaultValue:R,value:R,onChange:e=>{null==E||E(e),T(e)},disabled:C,className:f("w-full min-w-[10rem] relative text-tremor-default",S),id:F,multiple:!0},q),(({value:e})=>t.createElement(t.Fragment,null,t.createElement(u.Button,{className:f("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-11 -ml-0.5":"pl-3",h(e.length>0,C,M)),ref:B},O&&t.createElement("span",{className:f("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},t.createElement(O,{className:f(k("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),t.createElement("div",{className:"h-6 flex items-center"},e.length>0?t.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},P.filter((t=>e.includes(t.props.value))).map(((r,a)=>{var o;return t.createElement("div",{key:a,className:f("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},t.createElement("div",{className:"text-xs truncate "},null!==(o=r.props.children)&&void 0!==o?o:r.props.value),t.createElement("div",{onClick:t=>{t.preventDefault();const a=e.filter((e=>e!==r.props.value));null==E||E(a),T(a)}},t.createElement(p,{className:f(k("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))}))):t.createElement("span",null,y)),t.createElement("span",{className:f("absolute inset-y-0 right-0 flex items-center mr-2.5")},t.createElement(m,{className:f(k("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),K&&!C?t.createElement("button",{type:"button",className:f("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),T([]),null==E||E([])}},t.createElement(c,{className:f(k("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,t.createElement(i,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},t.createElement(u.Options,{className:f("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},t.createElement("div",{className:f("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},t.createElement("span",null,t.createElement(d,{className:f("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),t.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:N,className:f("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>H(e.target.value),value:X})),t.createElement(n.Provider,Object.assign({},{onBlur:{handleResetSearch:G}},{value:{selectedValue:e}}),U)))))),M&&A?t.createElement("p",{className:f("errorMessage","text-sm text-rose-500 mt-1")},A):null)}));v.displayName="MultiSelect";export{v as default}; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs b/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs deleted file mode 100644 index e25275e24..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelectItem.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs");var t=require("../../../contexts/SelectedValueContext.cjs"),r=require("react"),a=require("../../../lib/tremorTwMerge.cjs"),c=require("../../../lib/utils.cjs"),o=require("@headlessui/react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(r);const u=c.makeClassName("MultiSelectItem"),l=s.default.forwardRef(((n,l)=>{const{value:i,className:d,children:m}=n,x=e.__rest(n,["value","className","children"]),{selectedValue:k}=r.useContext(t),f=c.isValueInArray(i,k);return s.default.createElement(o.Listbox.Option,Object.assign({className:a.tremorTwMerge(u("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",d),ref:l,key:i,value:i},x),s.default.createElement("input",{type:"checkbox",className:a.tremorTwMerge(u("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:f,readOnly:!0}),s.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:i))}));l.displayName="MultiSelectItem",module.exports=l; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts b/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts deleted file mode 100644 index ceb00a792..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelectItem.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react"; -export interface MultiSelectItemProps extends React.HTMLAttributes { - value: string; -} -declare const MultiSelectItem: React.ForwardRefExoticComponent>; -export default MultiSelectItem; diff --git a/dist/components/input-elements/MultiSelect/MultiSelectItem.js b/dist/components/input-elements/MultiSelect/MultiSelectItem.js deleted file mode 100644 index 45716c88f..000000000 --- a/dist/components/input-elements/MultiSelect/MultiSelectItem.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import t from"../../../contexts/SelectedValueContext.js";import r,{useContext as o}from"react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{isValueInArray as n,makeClassName as c}from"../../../lib/utils.js";import{Listbox as s}from"@headlessui/react";const m=c("MultiSelectItem"),i=r.forwardRef(((c,i)=>{const{value:l,className:d,children:u}=c,p=e(c,["value","className","children"]),{selectedValue:x}=o(t),k=n(l,x);return r.createElement(s.Option,Object.assign({className:a(m("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",d),ref:i,key:l,value:l},p),r.createElement("input",{type:"checkbox",className:a(m("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:k,readOnly:!0}),r.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:l))}));i.displayName="MultiSelectItem";export{i as default}; diff --git a/dist/components/input-elements/MultiSelect/index.d.ts b/dist/components/input-elements/MultiSelect/index.d.ts deleted file mode 100644 index e4ea57b7f..000000000 --- a/dist/components/input-elements/MultiSelect/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as MultiSelect } from "./MultiSelect"; -export type { MultiSelectProps } from "./MultiSelect"; -export { default as MultiSelectItem } from "./MultiSelectItem"; -export type { MultiSelectItemProps } from "./MultiSelectItem"; diff --git a/dist/components/input-elements/NumberInput/NumberInput.cjs b/dist/components/input-elements/NumberInput/NumberInput.cjs deleted file mode 100644 index d2f4367c7..000000000 --- a/dist/components/input-elements/NumberInput/NumberInput.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../assets/PlusIcon.cjs"),a=require("../../../assets/MinusIcon.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs"),u=require("../BaseInput.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(t);const d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",i=s.default.forwardRef(((o,i)=>{const{onSubmit:p,enableStepper:b=!0,disabled:m,onValueChange:f,onChange:v}=o,k=e.__rest(o,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),w=t.useRef(null),[g,y]=s.default.useState(!1),h=s.default.useCallback((()=>{y(!0)}),[]),x=s.default.useCallback((()=>{y(!1)}),[]),[C,D]=s.default.useState(!1),E=s.default.useCallback((()=>{D(!0)}),[]),N=s.default.useCallback((()=>{D(!1)}),[]);return s.default.createElement(u,Object.assign({type:"number",ref:l.mergeRefs([w,i]),disabled:m,makeInputClassName:l.makeClassName("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){const e=null===(t=w.current)||void 0===t?void 0:t.value;null==p||p(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&h(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&N()},onChange:e=>{m||(null==f||f(parseFloat(e.target.value)),null==v||v(e))},stepper:b?s.default.createElement("div",{className:n.tremorTwMerge("flex justify-center align-middle")},s.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=w.current)||void 0===e||e.stepDown(),null===(t=w.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:n.tremorTwMerge(!m&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.default.createElement(a,{"data-testid":"step-down",className:(g?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),s.default.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(null===(e=w.current)||void 0===e||e.stepUp(),null===(t=w.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:n.tremorTwMerge(!m&&c,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.default.createElement(r,{"data-testid":"step-up",className:(C?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},k))}));i.displayName="NumberInput",module.exports=i; diff --git a/dist/components/input-elements/NumberInput/NumberInput.d.ts b/dist/components/input-elements/NumberInput/NumberInput.d.ts deleted file mode 100644 index 1d21e2663..000000000 --- a/dist/components/input-elements/NumberInput/NumberInput.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import { BaseInputProps } from "../BaseInput"; -export interface NumberInputProps extends Omit { - step?: string | number; - enableStepper?: boolean; - onSubmit?: (value: number) => void; - onValueChange?: (value: number) => void; -} -declare const NumberInput: React.ForwardRefExoticComponent>; -export default NumberInput; diff --git a/dist/components/input-elements/NumberInput/NumberInput.js b/dist/components/input-elements/NumberInput/NumberInput.js deleted file mode 100644 index 1ee9b1698..000000000 --- a/dist/components/input-elements/NumberInput/NumberInput.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useRef as r}from"react";import a from"../../../assets/PlusIcon.js";import n from"../../../assets/MinusIcon.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{mergeRefs as l,makeClassName as s}from"../../../lib/utils.js";import u from"../BaseInput.js";const p="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",i=t.forwardRef(((i,d)=>{const{onSubmit:m,enableStepper:b=!0,disabled:v,onValueChange:f,onChange:k}=i,w=e(i,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),y=r(null),[h,x]=t.useState(!1),g=t.useCallback((()=>{x(!0)}),[]),C=t.useCallback((()=>{x(!1)}),[]),[D,E]=t.useState(!1),N=t.useCallback((()=>{E(!0)}),[]),I=t.useCallback((()=>{E(!1)}),[]);return t.createElement(u,Object.assign({type:"number",ref:l([y,d]),disabled:v,makeInputClassName:s("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){const e=null===(t=y.current)||void 0===t?void 0:t.value;null==m||m(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&g(),"ArrowUp"===e.key&&N()},onKeyUp:e=>{"ArrowDown"===e.key&&C(),"ArrowUp"===e.key&&I()},onChange:e=>{v||(null==f||f(parseFloat(e.target.value)),null==k||k(e))},stepper:b?t.createElement("div",{className:o("flex justify-center align-middle")},t.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;v||(null===(e=y.current)||void 0===e||e.stepDown(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:o(!v&&c,p,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},t.createElement(n,{"data-testid":"step-down",className:(h?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),t.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;v||(null===(e=y.current)||void 0===e||e.stepUp(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:o(!v&&c,p,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},t.createElement(a,{"data-testid":"step-up",className:(D?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},w))}));i.displayName="NumberInput";export{i as default}; diff --git a/dist/components/input-elements/NumberInput/index.d.ts b/dist/components/input-elements/NumberInput/index.d.ts deleted file mode 100644 index cebb2e9a3..000000000 --- a/dist/components/input-elements/NumberInput/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as NumberInput } from "./NumberInput"; -export type { NumberInputProps } from "./NumberInput"; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.cjs b/dist/components/input-elements/SearchSelect/SearchSelect.cjs deleted file mode 100644 index 5bcc89859..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelect.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../hooks/useInternalState.cjs"),a=require("@headlessui/react"),l=require("../../../assets/ArrowDownHeadIcon.cjs"),o=require("../../../assets/XCircleIcon.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),d=require("../../../lib/utils.cjs"),s=require("../selectUtils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(r);const m=d.makeClassName("SearchSelect"),i=d.makeClassName("SearchSelect"),f=c.default.forwardRef(((d,u)=>{const{defaultValue:f="",searchValue:b,onSearchValueChange:p,value:h,onValueChange:g,placeholder:w="Select...",disabled:k=!1,icon:x,enableClear:v=!0,name:N,required:y,error:C=!1,errorMessage:M,children:E,className:T,id:V}=d,q=e.__rest(d,["defaultValue","searchValue","onSearchValueChange","value","onValueChange","placeholder","disabled","icon","enableClear","name","required","error","errorMessage","children","className","id"]),S=r.useRef(null),[j,I]=t("",b),[F,D]=t(f,h),O=x,{reactElementChildren:z,valueToNameMapping:A}=r.useMemo((()=>{const e=c.default.Children.toArray(E).filter(r.isValidElement);return{reactElementChildren:e,valueToNameMapping:s.constructValueToNameMapping(e)}}),[E]),B=r.useMemo((()=>s.getFilteredOptions(null!=j?j:"",z)),[j,z]);return c.default.createElement("div",{className:n.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},c.default.createElement("select",{title:"search-select-hidden",required:y,className:n.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:F,onChange:e=>{e.preventDefault()},name:N,disabled:k,id:V,onFocus:()=>{const e=S.current;e&&e.click()}},c.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},w),B.map((e=>{const r=e.props.value,t=e.props.children;return c.default.createElement("option",{className:"hidden",key:r,value:r},t)}))),c.default.createElement(a.Combobox,Object.assign({as:"div",ref:u,defaultValue:F,value:F,onChange:e=>{null==g||g(e),D(e)},disabled:k,className:n.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",T),id:V},q),(({value:e})=>c.default.createElement(c.default.Fragment,null,c.default.createElement(a.Combobox.Button,{ref:S,className:"w-full"},O&&c.default.createElement("span",{className:n.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},c.default.createElement(O,{className:n.tremorTwMerge(m("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),c.default.createElement(a.Combobox.Input,{className:n.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-10":"pl-3",k?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",s.getSelectButtonColors(s.hasValue(e),k)),placeholder:w,onChange:e=>{null==p||p(e.target.value),I(e.target.value)},displayValue:e=>{var r;return null!==(r=A.get(e))&&void 0!==r?r:""}}),c.default.createElement("div",{className:n.tremorTwMerge("absolute inset-y-0 right-0 flex items-center pr-2.5")},c.default.createElement(l,{className:n.tremorTwMerge(m("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&F?c.default.createElement("button",{type:"button",className:n.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),D(""),I(""),null==g||g(""),null==p||p("")}},c.default.createElement(o,{className:n.tremorTwMerge(i("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,B.length>0&&c.default.createElement(a.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},c.default.createElement(a.Combobox.Options,{className:n.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},B))))),C&&M?c.default.createElement("p",{className:n.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},M):null)}));f.displayName="SearchSelect",module.exports=f; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.d.ts b/dist/components/input-elements/SearchSelect/SearchSelect.d.ts deleted file mode 100644 index bcbfa7681..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelect.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; -export interface SearchSelectProps extends React.HTMLAttributes { - defaultValue?: string; - name?: string; - searchValue?: string; - onSearchValueChange?: (value: string) => void; - value?: string; - onValueChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - icon?: React.ElementType | React.JSXElementConstructor; - required?: boolean; - error?: boolean; - errorMessage?: string; - enableClear?: boolean; - children: React.ReactNode; -} -declare const SearchSelect: React.ForwardRefExoticComponent>; -export default SearchSelect; diff --git a/dist/components/input-elements/SearchSelect/SearchSelect.js b/dist/components/input-elements/SearchSelect/SearchSelect.js deleted file mode 100644 index 4c37ac6d4..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelect.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r,{useRef as t,useMemo as a,isValidElement as l}from"react";import o from"../../../hooks/useInternalState.js";import{Combobox as n,Transition as s}from"@headlessui/react";import d from"../../../assets/ArrowDownHeadIcon.js";import m from"../../../assets/XCircleIcon.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{makeClassName as u}from"../../../lib/utils.js";import{constructValueToNameMapping as i,getFilteredOptions as p,getSelectButtonColors as f,hasValue as b}from"../selectUtils.js";const h=u("SearchSelect"),k=u("SearchSelect"),g=r.forwardRef(((u,g)=>{const{defaultValue:v="",searchValue:x,onSearchValueChange:w,value:y,onValueChange:N,placeholder:E="Select...",disabled:C=!1,icon:S,enableClear:V=!0,name:j,required:I,error:M=!1,errorMessage:T,children:D,className:F,id:q}=u,z=e(u,["defaultValue","searchValue","onSearchValueChange","value","onValueChange","placeholder","disabled","icon","enableClear","name","required","error","errorMessage","children","className","id"]),A=t(null),[O,B]=o("",x),[H,R]=o(v,y),U=S,{reactElementChildren:X,valueToNameMapping:G}=a((()=>{const e=r.Children.toArray(D).filter(l);return{reactElementChildren:e,valueToNameMapping:i(e)}}),[D]),J=a((()=>p(null!=O?O:"",X)),[O,X]);return r.createElement("div",{className:c("w-full min-w-[10rem] relative text-tremor-default")},r.createElement("select",{title:"search-select-hidden",required:I,className:c("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:H,onChange:e=>{e.preventDefault()},name:j,disabled:C,id:q,onFocus:()=>{const e=A.current;e&&e.click()}},r.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},E),J.map((e=>{const t=e.props.value,a=e.props.children;return r.createElement("option",{className:"hidden",key:t,value:t},a)}))),r.createElement(n,Object.assign({as:"div",ref:g,defaultValue:H,value:H,onChange:e=>{null==N||N(e),R(e)},disabled:C,className:c("w-full min-w-[10rem] relative text-tremor-default",F),id:q},z),(({value:e})=>r.createElement(r.Fragment,null,r.createElement(n.Button,{ref:A,className:"w-full"},U&&r.createElement("span",{className:c("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},r.createElement(U,{className:c(h("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),r.createElement(n.Input,{className:c("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 text-tremor-default pr-14 border py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",U?"pl-10":"pl-3",C?"placeholder:text-tremor-content-subtle dark:placeholder:text-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-tremor-content",f(b(e),C)),placeholder:E,onChange:e=>{null==w||w(e.target.value),B(e.target.value)},displayValue:e=>{var r;return null!==(r=G.get(e))&&void 0!==r?r:""}}),r.createElement("div",{className:c("absolute inset-y-0 right-0 flex items-center pr-2.5")},r.createElement(d,{className:c(h("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),V&&H?r.createElement("button",{type:"button",className:c("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),R(""),B(""),null==N||N(""),null==w||w("")}},r.createElement(m,{className:c(k("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,J.length>0&&r.createElement(s,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(n.Options,{className:c("divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},J))))),M&&T?r.createElement("p",{className:c("errorMessage","text-sm text-rose-500 mt-1")},T):null)}));g.displayName="SearchSelect";export{g as default}; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs b/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs deleted file mode 100644 index 8694cc7d1..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelectItem.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),o=require("@headlessui/react");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=c(t);const s=a.makeClassName("SearchSelectItem"),u=n.default.forwardRef(((t,a)=>{const{value:c,icon:u,className:l,children:m}=t,d=e.__rest(t,["value","icon","className","children"]),i=u;return n.default.createElement(o.Combobox.Option,Object.assign({className:r.tremorTwMerge(s("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",l),ref:a,key:c,value:c},d),i&&n.default.createElement(i,{className:r.tremorTwMerge(s("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),n.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=m?m:c))}));u.displayName="SearchSelectItem",module.exports=u; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts b/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts deleted file mode 100644 index ef47d6970..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelectItem.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -export interface SearchSelectItemProps extends React.HTMLAttributes { - value: string; - icon?: React.ElementType; -} -declare const SearchSelectItem: React.ForwardRefExoticComponent>; -export default SearchSelectItem; diff --git a/dist/components/input-elements/SearchSelect/SearchSelectItem.js b/dist/components/input-elements/SearchSelect/SearchSelectItem.js deleted file mode 100644 index 452777a9d..000000000 --- a/dist/components/input-elements/SearchSelect/SearchSelectItem.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import{Combobox as o}from"@headlessui/react";const c=a("SearchSelectItem"),n=t.forwardRef(((a,n)=>{const{value:m,icon:s,className:i,children:l}=a,d=e(a,["value","icon","className","children"]),u=s;return t.createElement(o.Option,Object.assign({className:r(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",i),ref:n,key:m,value:m},d),u&&t.createElement(u,{className:r(c("icon"),"flex-none h-5 w-5 mr-3","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),t.createElement("span",{className:"whitespace-nowrap truncate"},null!=l?l:m))}));n.displayName="SearchSelectItem";export{n as default}; diff --git a/dist/components/input-elements/SearchSelect/index.d.ts b/dist/components/input-elements/SearchSelect/index.d.ts deleted file mode 100644 index 60336d9b0..000000000 --- a/dist/components/input-elements/SearchSelect/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as SearchSelect } from "./SearchSelect"; -export type { SearchSelectProps } from "./SearchSelect"; -export { default as SearchSelectItem } from "./SearchSelectItem"; -export type { SearchSelectItemProps } from "./SearchSelectItem"; diff --git a/dist/components/input-elements/Select/Select.cjs b/dist/components/input-elements/Select/Select.cjs deleted file mode 100644 index 819284923..000000000 --- a/dist/components/input-elements/Select/Select.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../assets/ArrowDownHeadIcon.cjs"),a=require("../../../assets/XCircleIcon.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),n=require("../selectUtils.cjs"),s=require("@headlessui/react"),d=require("../../../hooks/useInternalState.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=u(r);const c=o.makeClassName("Select"),i=m.default.forwardRef(((o,u)=>{const{defaultValue:i="",value:f,onValueChange:b,placeholder:p="Select...",disabled:w=!1,icon:g,enableClear:h=!1,required:k,children:v,name:x,error:y=!1,errorMessage:N,className:E,id:M}=o,T=e.__rest(o,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),q=r.useRef(null),C=r.Children.toArray(v),[j,V]=d(i,f),I=g,S=r.useMemo((()=>{const e=m.default.Children.toArray(v).filter(r.isValidElement);return n.constructValueToNameMapping(e)}),[v]);return m.default.createElement("div",{className:l.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default")},m.default.createElement("select",{title:"select-hidden",required:k,className:l.tremorTwMerge("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:j,onChange:e=>{e.preventDefault()},name:x,disabled:w,id:M,onFocus:()=>{const e=q.current;e&&e.focus()}},m.default.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),C.map((e=>{const r=e.props.value,t=e.props.children;return m.default.createElement("option",{className:"hidden",key:r,value:r},t)}))),m.default.createElement(s.Listbox,Object.assign({as:"div",ref:u,defaultValue:j,value:j,onChange:e=>{null==b||b(e),V(e)},disabled:w,className:l.tremorTwMerge("w-full min-w-[10rem] relative text-tremor-default",E),id:M},T),(({value:e})=>{var r;return m.default.createElement(m.default.Fragment,null,m.default.createElement(s.Listbox.Button,{ref:q,className:l.tremorTwMerge("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",I?"pl-10":"pl-3",n.getSelectButtonColors(n.hasValue(e),w,y))},I&&m.default.createElement("span",{className:l.tremorTwMerge("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},m.default.createElement(I,{className:l.tremorTwMerge(c("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),m.default.createElement("span",{className:"w-[90%] block truncate"},e&&null!==(r=S.get(e))&&void 0!==r?r:p),m.default.createElement("span",{className:l.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-3")},m.default.createElement(t,{className:l.tremorTwMerge(c("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),h&&j?m.default.createElement("button",{type:"button",className:l.tremorTwMerge("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),V(""),null==b||b("")}},m.default.createElement(a,{className:l.tremorTwMerge(c("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,m.default.createElement(s.Transition,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},m.default.createElement(s.Listbox.Options,{className:l.tremorTwMerge("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},v)))})),y&&N?m.default.createElement("p",{className:l.tremorTwMerge("errorMessage","text-sm text-rose-500 mt-1")},N):null)}));i.displayName="Select",module.exports=i; diff --git a/dist/components/input-elements/Select/Select.d.ts b/dist/components/input-elements/Select/Select.d.ts deleted file mode 100644 index e35fea476..000000000 --- a/dist/components/input-elements/Select/Select.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React from "react"; -export interface SelectProps extends React.HTMLAttributes { - value?: string; - name?: string; - defaultValue?: string; - onValueChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - icon?: React.JSXElementConstructor; - enableClear?: boolean; - required?: boolean; - error?: boolean; - errorMessage?: string; - children: React.ReactNode; -} -declare const Select: React.ForwardRefExoticComponent>; -export default Select; diff --git a/dist/components/input-elements/Select/Select.js b/dist/components/input-elements/Select/Select.js deleted file mode 100644 index 9f79afe83..000000000 --- a/dist/components/input-elements/Select/Select.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r,{useRef as t,Children as a,useMemo as o,isValidElement as l}from"react";import n from"../../../assets/ArrowDownHeadIcon.js";import s from"../../../assets/XCircleIcon.js";import{tremorTwMerge as d}from"../../../lib/tremorTwMerge.js";import{makeClassName as m}from"../../../lib/utils.js";import{constructValueToNameMapping as c,getSelectButtonColors as i,hasValue as u}from"../selectUtils.js";import{Listbox as b,Transition as f}from"@headlessui/react";import p from"../../../hooks/useInternalState.js";const h=m("Select"),k=r.forwardRef(((m,k)=>{const{defaultValue:w="",value:v,onValueChange:x,placeholder:y="Select...",disabled:g=!1,icon:N,enableClear:E=!1,required:C,children:j,name:I,error:V=!1,errorMessage:D,className:F,id:M}=m,S=e(m,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),q=t(null),A=a.toArray(j),[T,z]=p(w,v),O=N,B=o((()=>{const e=r.Children.toArray(j).filter(l);return c(e)}),[j]);return r.createElement("div",{className:d("w-full min-w-[10rem] relative text-tremor-default")},r.createElement("select",{title:"select-hidden",required:C,className:d("h-full w-full absolute left-0 top-0 z-0 opacity-0"),value:T,onChange:e=>{e.preventDefault()},name:I,disabled:g,id:M,onFocus:()=>{const e=q.current;e&&e.focus()}},r.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},y),A.map((e=>{const t=e.props.value,a=e.props.children;return r.createElement("option",{className:"hidden",key:t,value:t},a)}))),r.createElement(b,Object.assign({as:"div",ref:k,defaultValue:T,value:T,onChange:e=>{null==x||x(e),z(e)},disabled:g,className:d("w-full min-w-[10rem] relative text-tremor-default",F),id:M},S),(({value:e})=>{var t;return r.createElement(r.Fragment,null,r.createElement(b.Button,{ref:q,className:d("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",O?"pl-10":"pl-3",i(u(e),g,V))},O&&r.createElement("span",{className:d("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},r.createElement(O,{className:d(h("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),r.createElement("span",{className:"w-[90%] block truncate"},e&&null!==(t=B.get(e))&&void 0!==t?t:y),r.createElement("span",{className:d("absolute inset-y-0 right-0 flex items-center mr-3")},r.createElement(n,{className:d(h("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),E&&T?r.createElement("button",{type:"button",className:d("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),z(""),null==x||x("")}},r.createElement(s,{className:d(h("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,r.createElement(f,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},r.createElement(b.Options,{className:d("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},j)))})),V&&D?r.createElement("p",{className:d("errorMessage","text-sm text-rose-500 mt-1")},D):null)}));k.displayName="Select";export{k as default}; diff --git a/dist/components/input-elements/Select/SelectItem.cjs b/dist/components/input-elements/Select/SelectItem.cjs deleted file mode 100644 index 1011e2cf3..000000000 --- a/dist/components/input-elements/Select/SelectItem.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=c(t);const s=o.makeClassName("SelectItem"),u=n.default.forwardRef(((t,o)=>{const{value:c,icon:u,className:l,children:i}=t,d=e.__rest(t,["value","icon","className","children"]),m=u;return n.default.createElement(r.Listbox.Option,Object.assign({className:a.tremorTwMerge(s("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",l),ref:o,key:c,value:c},d),m&&n.default.createElement(m,{className:a.tremorTwMerge(s("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),n.default.createElement("span",{className:"whitespace-nowrap truncate"},null!=i?i:c))}));u.displayName="SelectItem",module.exports=u; diff --git a/dist/components/input-elements/Select/SelectItem.d.ts b/dist/components/input-elements/Select/SelectItem.d.ts deleted file mode 100644 index d08cf36fd..000000000 --- a/dist/components/input-elements/Select/SelectItem.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -export interface SelectItemProps extends React.HTMLAttributes { - value: string; - icon?: React.ElementType; -} -declare const SelectItem: React.ForwardRefExoticComponent>; -export default SelectItem; diff --git a/dist/components/input-elements/Select/SelectItem.js b/dist/components/input-elements/Select/SelectItem.js deleted file mode 100644 index 3d79093fa..000000000 --- a/dist/components/input-elements/Select/SelectItem.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import{Listbox as r}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const c=o("SelectItem"),n=t.forwardRef(((o,n)=>{const{value:m,icon:s,className:i,children:l}=o,d=e(o,["value","icon","className","children"]),u=s;return t.createElement(r.Option,Object.assign({className:a(c("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",i),ref:n,key:m,value:m},d),u&&t.createElement(u,{className:a(c("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),t.createElement("span",{className:"whitespace-nowrap truncate"},null!=l?l:m))}));n.displayName="SelectItem";export{n as default}; diff --git a/dist/components/input-elements/Select/index.d.ts b/dist/components/input-elements/Select/index.d.ts deleted file mode 100644 index 8c0e47459..000000000 --- a/dist/components/input-elements/Select/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as Select } from "./Select"; -export type { SelectProps } from "./Select"; -export { default as SelectItem } from "./SelectItem"; -export type { SelectItemProps } from "./SelectItem"; diff --git a/dist/components/input-elements/Switch/Switch.cjs b/dist/components/input-elements/Switch/Switch.cjs deleted file mode 100644 index b9efe855d..000000000 --- a/dist/components/input-elements/Switch/Switch.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("../../../hooks/useInternalState.cjs"),o=require("react"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs"),s=require("../../util-elements/Tooltip/Tooltip.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=d(o);const u=n.makeClassName("Switch"),c=i.default.forwardRef(((d,c)=>{const{checked:m,defaultChecked:g=!1,onChange:b,color:f,name:k,error:h,errorMessage:p,disabled:w,required:C,tooltip:x,id:M}=d,T=e.__rest(d,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),N=(e=>({bgColor:e?n.getColorClassNames(e,a.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:e?n.getColorClassNames(e,a.colorPalette.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}))(f),[q,j]=t(g,m),[v,E]=o.useState(!1),{tooltipProps:y,getReferenceProps:S}=s.useTooltip(300);return i.default.createElement("div",{className:"flex flex-row items-center justify-start"},i.default.createElement(s.default,Object.assign({text:x},y)),i.default.createElement("div",Object.assign({ref:n.mergeRefs([c,y.refs.setReference]),className:l.tremorTwMerge(u("root"),"flex flex-row relative h-5")},T,S),i.default.createElement("input",{type:"checkbox",className:l.tremorTwMerge(u("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:k,required:C,checked:q,onChange:e=>{e.preventDefault()}}),i.default.createElement(r.Switch,{checked:q,onChange:e=>{j(e),null==b||b(e)},disabled:w,className:l.tremorTwMerge(u("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",w?"cursor-not-allowed":""),onFocus:()=>E(!0),onBlur:()=>E(!1),id:M},i.default.createElement("span",{className:l.tremorTwMerge(u("sr-only"),"sr-only")},"Switch ",q?"on":"off"),i.default.createElement("span",{"aria-hidden":"true",className:l.tremorTwMerge(u("background"),q?N.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),i.default.createElement("span",{"aria-hidden":"true",className:l.tremorTwMerge(u("round"),q?l.tremorTwMerge(N.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",v?l.tremorTwMerge("ring-2",N.ringColor):"")}))),h&&p?i.default.createElement("p",{className:l.tremorTwMerge(u("errorMessage"),"text-sm text-red-500 mt-1 ")},p):null)}));c.displayName="Switch",module.exports=c; diff --git a/dist/components/input-elements/Switch/Switch.d.ts b/dist/components/input-elements/Switch/Switch.d.ts deleted file mode 100644 index 9e1580ebc..000000000 --- a/dist/components/input-elements/Switch/Switch.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Color } from "lib"; -import React from "react"; -export interface SwitchProps extends Omit, "onChange"> { - checked?: boolean; - defaultChecked?: boolean; - onChange?: (value: boolean) => void; - color?: Color; - name?: string; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - required?: boolean; - id?: string; - tooltip?: string; -} -declare const Switch: React.ForwardRefExoticComponent>; -export default Switch; diff --git a/dist/components/input-elements/Switch/Switch.js b/dist/components/input-elements/Switch/Switch.js deleted file mode 100644 index a18cb720d..000000000 --- a/dist/components/input-elements/Switch/Switch.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Switch as r}from"@headlessui/react";import o from"../../../hooks/useInternalState.js";import t,{useState as a}from"react";import{colorPalette as n}from"../../../lib/theme.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,getColorClassNames as i,makeClassName as d}from"../../../lib/utils.js";import m,{useTooltip as c}from"../../util-elements/Tooltip/Tooltip.js";const u=d("Switch"),b=t.forwardRef(((d,b)=>{const{checked:g,defaultChecked:f=!1,onChange:p,color:h,name:k,error:w,errorMessage:x,disabled:C,required:j,tooltip:E,id:N}=d,v=e(d,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),y=(e=>({bgColor:e?i(e,n.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:e?i(e,n.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}))(h),[S,M]=o(f,g),[q,R]=a(!1),{tooltipProps:T,getReferenceProps:O}=c(300);return t.createElement("div",{className:"flex flex-row items-center justify-start"},t.createElement(m,Object.assign({text:E},T)),t.createElement("div",Object.assign({ref:s([b,T.refs.setReference]),className:l(u("root"),"flex flex-row relative h-5")},v,O),t.createElement("input",{type:"checkbox",className:l(u("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:k,required:j,checked:S,onChange:e=>{e.preventDefault()}}),t.createElement(r,{checked:S,onChange:e=>{M(e),null==p||p(e)},disabled:C,className:l(u("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",C?"cursor-not-allowed":""),onFocus:()=>R(!0),onBlur:()=>R(!1),id:N},t.createElement("span",{className:l(u("sr-only"),"sr-only")},"Switch ",S?"on":"off"),t.createElement("span",{"aria-hidden":"true",className:l(u("background"),S?y.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),t.createElement("span",{"aria-hidden":"true",className:l(u("round"),S?l(y.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",q?l("ring-2",y.ringColor):"")}))),w&&x?t.createElement("p",{className:l(u("errorMessage"),"text-sm text-red-500 mt-1 ")},x):null)}));b.displayName="Switch";export{b as default}; diff --git a/dist/components/input-elements/Switch/index.d.ts b/dist/components/input-elements/Switch/index.d.ts deleted file mode 100644 index eaf14f132..000000000 --- a/dist/components/input-elements/Switch/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Switch } from "./Switch"; -export type { SwitchProps } from "./Switch"; diff --git a/dist/components/input-elements/Tabs/Tab.cjs b/dist/components/input-elements/Tabs/Tab.cjs deleted file mode 100644 index a8e1600b8..000000000 --- a/dist/components/input-elements/Tabs/Tab.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("@headlessui/react"),t=require("../../../lib/theme.cjs"),o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),s=require("react"),n=require("./TabList.cjs"),d=require("../../../contexts/BaseColorContext.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs"),require("../../../contexts/SelectedValueContext.cjs");var l=c(s);const i=a.makeClassName("Tab");function u(e,r){switch(e){case"line":return o.tremorTwMerge("ui-selected:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","dark:hover:border-dark-tremor-content-emphasis dark:hover:text-dark-tremor-content-emphasis dark:text-dark-tremor-content",r?a.getColorClassNames(r,t.colorPalette.border).selectBorderColor:"ui-selected:border-tremor-brand dark:ui-selected:border-dark-tremor-brand");case"solid":return o.tremorTwMerge("border-transparent border rounded-tremor-small px-2.5 py-1","ui-selected:border-tremor-border ui-selected:bg-tremor-background ui-selected:shadow-tremor-input hover:text-tremor-content-emphasis ui-selected:text-tremor-brand","dark:ui-selected:border-dark-tremor-border dark:ui-selected:bg-dark-tremor-background dark:ui-selected:shadow-dark-tremor-input dark:hover:text-dark-tremor-content-emphasis dark:ui-selected:text-dark-tremor-brand",r?a.getColorClassNames(r,t.colorPalette.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}const m=l.default.forwardRef(((c,m)=>{const{icon:x,className:b,children:k}=c,h=e.__rest(c,["icon","className","children"]),p=s.useContext(n.TabVariantContext),C=s.useContext(d),f=x;return l.default.createElement(r.Tab,Object.assign({ref:m,className:o.tremorTwMerge(i("root"),"flex whitespace-nowrap truncate max-w-xs outline-none focus:ring-0 text-tremor-default transition duration-100",C?a.getColorClassNames(C,t.colorPalette.text).selectTextColor:"solid"===p?"ui-selected:text-tremor-content-emphasis dark:ui-selected:text-dark-tremor-content-emphasis":"ui-selected:text-tremor-brand dark:ui-selected:text-dark-tremor-brand",u(p,C),b)},h),f?l.default.createElement(f,{className:o.tremorTwMerge(i("icon"),"flex-none h-5 w-5",k?"mr-2":"")}):null,k?l.default.createElement("span",null,k):null)}));m.displayName="Tab",module.exports=m; diff --git a/dist/components/input-elements/Tabs/Tab.d.ts b/dist/components/input-elements/Tabs/Tab.d.ts deleted file mode 100644 index ff2555c84..000000000 --- a/dist/components/input-elements/Tabs/Tab.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react"; -export interface TabProps extends React.ButtonHTMLAttributes { - icon?: React.ElementType; -} -declare const Tab: React.ForwardRefExoticComponent>; -export default Tab; diff --git a/dist/components/input-elements/Tabs/Tab.js b/dist/components/input-elements/Tabs/Tab.js deleted file mode 100644 index bab4fe9b6..000000000 --- a/dist/components/input-elements/Tabs/Tab.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Tab as r}from"@headlessui/react";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as n}from"../../../lib/utils.js";import s,{useContext as d}from"react";import{TabVariantContext as m}from"./TabList.js";import i from"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";const c=n("Tab");function l(e,r){switch(e){case"line":return o("ui-selected:border-b-2 hover:border-b-2 border-transparent transition duration-100 -mb-px px-2 py-2","hover:border-tremor-content hover:text-tremor-content-emphasis text-tremor-content","dark:hover:border-dark-tremor-content-emphasis dark:hover:text-dark-tremor-content-emphasis dark:text-dark-tremor-content",r?a(r,t.border).selectBorderColor:"ui-selected:border-tremor-brand dark:ui-selected:border-dark-tremor-brand");case"solid":return o("border-transparent border rounded-tremor-small px-2.5 py-1","ui-selected:border-tremor-border ui-selected:bg-tremor-background ui-selected:shadow-tremor-input hover:text-tremor-content-emphasis ui-selected:text-tremor-brand","dark:ui-selected:border-dark-tremor-border dark:ui-selected:bg-dark-tremor-background dark:ui-selected:shadow-dark-tremor-input dark:hover:text-dark-tremor-content-emphasis dark:ui-selected:text-dark-tremor-brand",r?a(r,t.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}const u=s.forwardRef(((n,u)=>{const{icon:b,className:x,children:p}=n,k=e(n,["icon","className","children"]),h=d(m),f=d(i),j=b;return s.createElement(r,Object.assign({ref:u,className:o(c("root"),"flex whitespace-nowrap truncate max-w-xs outline-none focus:ring-0 text-tremor-default transition duration-100",f?a(f,t.text).selectTextColor:"solid"===h?"ui-selected:text-tremor-content-emphasis dark:ui-selected:text-dark-tremor-content-emphasis":"ui-selected:text-tremor-brand dark:ui-selected:text-dark-tremor-brand",l(h,f),x)},k),j?s.createElement(j,{className:o(c("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)}));u.displayName="Tab";export{u as default}; diff --git a/dist/components/input-elements/Tabs/TabGroup.cjs b/dist/components/input-elements/Tabs/TabGroup.cjs deleted file mode 100644 index 62db30244..000000000 --- a/dist/components/input-elements/Tabs/TabGroup.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(require("react"));const l=t.makeClassName("TabGroup"),d=s.default.forwardRef(((t,n)=>{const{defaultIndex:d,index:u,onIndexChange:i,children:o,className:c}=t,f=e.__rest(t,["defaultIndex","index","onIndexChange","children","className"]);return s.default.createElement(r.Tab.Group,Object.assign({as:"div",ref:n,defaultIndex:d,selectedIndex:u,onChange:i,className:a.tremorTwMerge(l("root"),"w-full",c)},f),o)}));d.displayName="TabGroup",module.exports=d; diff --git a/dist/components/input-elements/Tabs/TabGroup.d.ts b/dist/components/input-elements/Tabs/TabGroup.d.ts deleted file mode 100644 index 286b73bd5..000000000 --- a/dist/components/input-elements/Tabs/TabGroup.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -export interface TabGroupProps extends React.HTMLAttributes { - defaultIndex?: number; - index?: number; - onIndexChange?: (index: number) => void; - children: React.ReactElement[] | React.ReactElement; -} -declare const TabGroup: React.ForwardRefExoticComponent>; -export default TabGroup; diff --git a/dist/components/input-elements/Tabs/TabGroup.js b/dist/components/input-elements/Tabs/TabGroup.js deleted file mode 100644 index f133bed5e..000000000 --- a/dist/components/input-elements/Tabs/TabGroup.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Tab as r}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";import t from"react";const n=o("TabGroup"),s=t.forwardRef(((o,s)=>{const{defaultIndex:d,index:l,onIndexChange:i,children:m,className:f}=o,c=e(o,["defaultIndex","index","onIndexChange","children","className"]);return t.createElement(r.Group,Object.assign({as:"div",ref:s,defaultIndex:d,selectedIndex:l,onChange:i,className:a(n("root"),"w-full",f)},c),m)}));s.displayName="TabGroup";export{s as default}; diff --git a/dist/components/input-elements/Tabs/TabList.cjs b/dist/components/input-elements/Tabs/TabList.cjs deleted file mode 100644 index f0663887e..000000000 --- a/dist/components/input-elements/Tabs/TabList.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react"),t=require("../../../contexts/BaseColorContext.cjs");require("../../../contexts/IndexContext.cjs"),require("../../../contexts/RootStylesContext.cjs"),require("../../../contexts/SelectedValueContext.cjs");var a=require("@headlessui/react"),o=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(r);const c=s.makeClassName("TabList"),n=r.createContext("line"),u={line:o.tremorTwMerge("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:o.tremorTwMerge("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=i.default.forwardRef(((r,s)=>{const{color:l,variant:d="line",children:b,className:x}=r,f=e.__rest(r,["color","variant","children","className"]);return i.default.createElement(a.Tab.List,Object.assign({ref:s,className:o.tremorTwMerge(c("root"),"justify-start overflow-x-clip",u[d],x)},f),i.default.createElement(n.Provider,{value:d},i.default.createElement(t.Provider,{value:l},b)))}));d.displayName="TabList",exports.TabVariantContext=n,exports.default=d; diff --git a/dist/components/input-elements/Tabs/TabList.d.ts b/dist/components/input-elements/Tabs/TabList.d.ts deleted file mode 100644 index 5c8d22bba..000000000 --- a/dist/components/input-elements/Tabs/TabList.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -import { Color } from "lib"; -export type TabVariant = "line" | "solid"; -export declare const TabVariantContext: React.Context; -export interface TabListProps extends React.HTMLAttributes { - color?: Color; - variant?: TabVariant; - children: React.ReactElement[] | React.ReactElement; -} -declare const TabList: React.ForwardRefExoticComponent>; -export default TabList; diff --git a/dist/components/input-elements/Tabs/TabList.js b/dist/components/input-elements/Tabs/TabList.js deleted file mode 100644 index 991b3b037..000000000 --- a/dist/components/input-elements/Tabs/TabList.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r,{createContext as t}from"react";import o from"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{Tab as a}from"@headlessui/react";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const i=l("TabList"),m=t("line"),n={line:s("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:s("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},c=r.forwardRef(((t,l)=>{const{color:c,variant:d="line",children:b,className:f}=t,p=e(t,["color","variant","children","className"]);return r.createElement(a.List,Object.assign({ref:l,className:s(i("root"),"justify-start overflow-x-clip",n[d],f)},p),r.createElement(m.Provider,{value:d},r.createElement(o.Provider,{value:c},b)))}));c.displayName="TabList";export{m as TabVariantContext,c as default}; diff --git a/dist/components/input-elements/Tabs/TabPanel.cjs b/dist/components/input-elements/Tabs/TabPanel.cjs deleted file mode 100644 index 0f99153ea..000000000 --- a/dist/components/input-elements/Tabs/TabPanel.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib");require("../../../contexts/BaseColorContext.cjs");var t=require("../../../contexts/IndexContext.cjs");require("../../../contexts/RootStylesContext.cjs");var r=require("../../../contexts/SelectedValueContext.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),l=require("react");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=c(l);const n=a.makeClassName("TabPanel"),u=o.default.forwardRef(((a,c)=>{const{children:u,className:i}=a,d=e.__rest(a,["children","className"]),{selectedValue:x}=l.useContext(r),f=x===l.useContext(t);return o.default.createElement("div",Object.assign({ref:c,className:s.tremorTwMerge(n("root"),"w-full mt-2",f?"":"hidden",i),"aria-selected":f?"true":"false"},d),u)}));u.displayName="TabPanel",module.exports=u; diff --git a/dist/components/input-elements/Tabs/TabPanel.d.ts b/dist/components/input-elements/Tabs/TabPanel.d.ts deleted file mode 100644 index 3f476df50..000000000 --- a/dist/components/input-elements/Tabs/TabPanel.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TabPanel: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TabPanel; diff --git a/dist/components/input-elements/Tabs/TabPanel.js b/dist/components/input-elements/Tabs/TabPanel.js deleted file mode 100644 index da5017f75..000000000 --- a/dist/components/input-elements/Tabs/TabPanel.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import"../../../contexts/BaseColorContext.js";import t from"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import o from"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";import a,{useContext as l}from"react";const m=s("TabPanel"),i=a.forwardRef(((s,i)=>{const{children:n,className:c}=s,d=e(s,["children","className"]),{selectedValue:f}=l(o),p=f===l(t);return a.createElement("div",Object.assign({ref:i,className:r(m("root"),"w-full mt-2",p?"":"hidden",c),"aria-selected":p?"true":"false"},d),n)}));i.displayName="TabPanel";export{i as default}; diff --git a/dist/components/input-elements/Tabs/TabPanels.cjs b/dist/components/input-elements/Tabs/TabPanels.cjs deleted file mode 100644 index 8e69f649a..000000000 --- a/dist/components/input-elements/Tabs/TabPanels.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("@headlessui/react");require("../../../contexts/BaseColorContext.cjs");var r=require("../../../contexts/IndexContext.cjs");require("../../../contexts/RootStylesContext.cjs");var a=require("../../../contexts/SelectedValueContext.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(require("react"));const n=l.makeClassName("TabPanels"),o=u.default.forwardRef(((l,c)=>{const{children:o,className:i}=l,d=e.__rest(l,["children","className"]);return u.default.createElement(t.Tab.Panels,Object.assign({as:"div",ref:c,className:s.tremorTwMerge(n("root"),"w-full",i)},d),(({selectedIndex:e})=>u.default.createElement(a.Provider,{value:{selectedValue:e}},u.default.Children.map(o,((e,t)=>u.default.createElement(r.Provider,{value:t},e))))))}));o.displayName="TabPanels",module.exports=o; diff --git a/dist/components/input-elements/Tabs/TabPanels.d.ts b/dist/components/input-elements/Tabs/TabPanels.d.ts deleted file mode 100644 index 9ede10ab6..000000000 --- a/dist/components/input-elements/Tabs/TabPanels.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TabPanels: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TabPanels; diff --git a/dist/components/input-elements/Tabs/TabPanels.js b/dist/components/input-elements/Tabs/TabPanels.js deleted file mode 100644 index bebad6424..000000000 --- a/dist/components/input-elements/Tabs/TabPanels.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Tab as t}from"@headlessui/react";import"../../../contexts/BaseColorContext.js";import r from"../../../contexts/IndexContext.js";import"../../../contexts/RootStylesContext.js";import o from"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import l from"react";const m=a("TabPanels"),n=l.forwardRef(((a,n)=>{const{children:i,className:c}=a,d=e(a,["children","className"]);return l.createElement(t.Panels,Object.assign({as:"div",ref:n,className:s(m("root"),"w-full",c)},d),(({selectedIndex:e})=>l.createElement(o.Provider,{value:{selectedValue:e}},l.Children.map(i,((e,t)=>l.createElement(r.Provider,{value:t},e))))))}));n.displayName="TabPanels";export{n as default}; diff --git a/dist/components/input-elements/Tabs/index.d.ts b/dist/components/input-elements/Tabs/index.d.ts deleted file mode 100644 index ced74550c..000000000 --- a/dist/components/input-elements/Tabs/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as Tab } from "./Tab"; -export type { TabProps } from "./Tab"; -export { default as TabGroup } from "./TabGroup"; -export type { TabGroupProps } from "./TabGroup"; -export { default as TabList } from "./TabList"; -export type { TabListProps } from "./TabList"; -export { default as TabPanel } from "./TabPanel"; -export { default as TabPanels } from "./TabPanels"; diff --git a/dist/components/input-elements/TextInput/TextInput.cjs b/dist/components/input-elements/TextInput/TextInput.cjs deleted file mode 100644 index 96bdb7482..000000000 --- a/dist/components/input-elements/TextInput/TextInput.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs"),a=require("../BaseInput.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t);const i=r.makeClassName("TextInput"),l=u.default.forwardRef(((t,r)=>{const{type:s="text"}=t,l=e.__rest(t,["type"]);return u.default.createElement(a,Object.assign({ref:r,type:s,makeInputClassName:i},l))}));l.displayName="TextInput",module.exports=l; diff --git a/dist/components/input-elements/TextInput/TextInput.d.ts b/dist/components/input-elements/TextInput/TextInput.d.ts deleted file mode 100644 index 0b84ce657..000000000 --- a/dist/components/input-elements/TextInput/TextInput.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import React from "react"; -import { BaseInputProps } from "../BaseInput"; -export type TextInputProps = Omit & { - type?: "text" | "password" | "email" | "url"; - defaultValue?: string; - value?: string; - onValueChange?: (value: string) => void; - icon?: React.ElementType | React.JSXElementConstructor; - error?: boolean; - errorMessage?: string; - disabled?: boolean; -}; -declare const TextInput: React.ForwardRefExoticComponent & { - type?: "text" | "url" | "email" | "password" | undefined; - defaultValue?: string | undefined; - value?: string | undefined; - onValueChange?: ((value: string) => void) | undefined; - icon?: React.JSXElementConstructor | React.ElementType | undefined; - error?: boolean | undefined; - errorMessage?: string | undefined; - disabled?: boolean | undefined; -} & React.RefAttributes>; -export default TextInput; diff --git a/dist/components/input-elements/TextInput/TextInput.js b/dist/components/input-elements/TextInput/TextInput.js deleted file mode 100644 index 99fde48d8..000000000 --- a/dist/components/input-elements/TextInput/TextInput.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as t}from"tslib";import e from"react";import"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import m from"../BaseInput.js";const o=r("TextInput"),p=e.forwardRef(((r,p)=>{const{type:s="text"}=r,a=t(r,["type"]);return e.createElement(m,Object.assign({ref:p,type:s,makeInputClassName:o},a))}));p.displayName="TextInput";export{p as default}; diff --git a/dist/components/input-elements/TextInput/index.d.ts b/dist/components/input-elements/TextInput/index.d.ts deleted file mode 100644 index 927640751..000000000 --- a/dist/components/input-elements/TextInput/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as TextInput } from "./TextInput"; -export type { TextInputProps } from "./TextInput"; diff --git a/dist/components/input-elements/Textarea/Textarea.cjs b/dist/components/input-elements/Textarea/Textarea.cjs deleted file mode 100644 index 65f858f00..000000000 --- a/dist/components/input-elements/Textarea/Textarea.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("../selectUtils.cjs"),t=require("../../../hooks/useInternalState.cjs"),a=require("react"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(a);const n=o.makeClassName("Textarea"),d=s.default.forwardRef(((u,d)=>{const{value:c,defaultValue:m="",placeholder:i="Type...",error:f=!1,errorMessage:g,disabled:b=!1,className:h,onChange:p,onValueChange:x}=u,k=e.__rest(u,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[v,w]=t(m,c),C=a.useRef(null),T=r.hasValue(v);return s.default.createElement(s.default.Fragment,null,s.default.createElement("textarea",Object.assign({ref:o.mergeRefs([C,d]),value:v,placeholder:i,disabled:b,className:l.tremorTwMerge(n("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",r.getSelectButtonColors(T,b,f),b?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",h),"data-testid":"text-area",onChange:e=>{null==p||p(e),w(e.target.value),null==x||x(e.target.value)}},k)),f&&g?s.default.createElement("p",{className:l.tremorTwMerge(n("errorMessage"),"text-sm text-red-500 mt-1")},g):null)}));d.displayName="Textarea",module.exports=d; diff --git a/dist/components/input-elements/Textarea/Textarea.d.ts b/dist/components/input-elements/Textarea/Textarea.d.ts deleted file mode 100644 index e92a9652a..000000000 --- a/dist/components/input-elements/Textarea/Textarea.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -export interface TextareaProps extends React.TextareaHTMLAttributes { - defaultValue?: string | number; - value?: string | number; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - onValueChange?: (value: any) => void; -} -declare const Textarea: React.ForwardRefExoticComponent>; -export default Textarea; diff --git a/dist/components/input-elements/Textarea/Textarea.js b/dist/components/input-elements/Textarea/Textarea.js deleted file mode 100644 index 2db39ef2b..000000000 --- a/dist/components/input-elements/Textarea/Textarea.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{getSelectButtonColors as r,hasValue as t}from"../selectUtils.js";import a from"../../../hooks/useInternalState.js";import o,{useRef as l}from"react";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{mergeRefs as s,makeClassName as d}from"../../../lib/utils.js";const m=d("Textarea"),u=o.forwardRef(((d,u)=>{const{value:c,defaultValue:i="",placeholder:f="Type...",error:p=!1,errorMessage:b,disabled:g=!1,className:h,onChange:x,onValueChange:k}=d,j=e(d,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[v,w]=a(i,c),C=l(null),N=t(v);return o.createElement(o.Fragment,null,o.createElement("textarea",Object.assign({ref:s([C,u]),value:v,placeholder:f,disabled:g,className:n(m("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",r(N,g,p),g?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",h),"data-testid":"text-area",onChange:e=>{null==x||x(e),w(e.target.value),null==k||k(e.target.value)}},j)),p&&b?o.createElement("p",{className:n(m("errorMessage"),"text-sm text-red-500 mt-1")},b):null)}));u.displayName="Textarea";export{u as default}; diff --git a/dist/components/input-elements/Textarea/index.d.ts b/dist/components/input-elements/Textarea/index.d.ts deleted file mode 100644 index 934962fa7..000000000 --- a/dist/components/input-elements/Textarea/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Textarea } from "./Textarea"; -export type { TextareaProps } from "./Textarea"; diff --git a/dist/components/input-elements/index.d.ts b/dist/components/input-elements/index.d.ts deleted file mode 100644 index 89f7fd3d3..000000000 --- a/dist/components/input-elements/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from "./Button"; -export * from "./DatePicker"; -export * from "./DateRangePicker"; -export * from "./MultiSelect"; -export * from "./NumberInput"; -export * from "./SearchSelect"; -export * from "./Select"; -export * from "./Switch"; -export * from "./Tabs"; -export * from "./Textarea"; -export * from "./TextInput"; diff --git a/dist/components/input-elements/selectUtils.cjs b/dist/components/input-elements/selectUtils.cjs deleted file mode 100644 index 618e1f79d..000000000 --- a/dist/components/input-elements/selectUtils.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../lib/tremorTwMerge.cjs");function e(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var t=e(require("react"));const o=r=>["string","number"].includes(typeof r)?r:r instanceof Array?r.map(o).join(""):"object"==typeof r&&r?o(r.props.children):void 0;exports.constructValueToNameMapping=function(r){const e=new Map;return t.default.Children.map(r,(r=>{var t;e.set(r.props.value,null!==(t=o(r))&&void 0!==t?t:r.props.value)})),e},exports.getFilteredOptions=function(r,e){return t.default.Children.map(e,(e=>{var t;if((null!==(t=o(e))&&void 0!==t?t:e.props.value).toLowerCase().includes(r.toLowerCase()))return e}))},exports.getNodeText=o,exports.getSelectButtonColors=(e,t,o=!1)=>r.tremorTwMerge(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",o&&"text-red-500",o?"border-red-500":"border-tremor-border dark:border-dark-tremor-border"),exports.hasValue=function(r){return null!=r&&""!==r}; diff --git a/dist/components/input-elements/selectUtils.d.ts b/dist/components/input-elements/selectUtils.d.ts deleted file mode 100644 index 720c8300d..000000000 --- a/dist/components/input-elements/selectUtils.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -export interface SelectItemProps { - value: string; - children?: React.ReactNode; -} -export declare const getNodeText: (node: React.ReactElement) => string | React.ReactElement | undefined; -export declare function constructValueToNameMapping(children: React.ReactElement[] | React.ReactElement): Map; -export declare function getFilteredOptions(searchQuery: string, children: React.ReactElement[]): React.ReactElement[]; -export declare const getSelectButtonColors: (hasSelection: boolean, isDisabled: boolean, hasError?: boolean) => string; -export declare function hasValue(value: T | null | undefined): boolean; diff --git a/dist/components/input-elements/selectUtils.js b/dist/components/input-elements/selectUtils.js deleted file mode 100644 index 813bb951c..000000000 --- a/dist/components/input-elements/selectUtils.js +++ /dev/null @@ -1 +0,0 @@ -import{tremorTwMerge as r}from"../../lib/tremorTwMerge.js";import e from"react";const t=r=>["string","number"].includes(typeof r)?r:r instanceof Array?r.map(t).join(""):"object"==typeof r&&r?t(r.props.children):void 0;function o(r){const o=new Map;return e.Children.map(r,(r=>{var e;o.set(r.props.value,null!==(e=t(r))&&void 0!==e?e:r.props.value)})),o}function n(r,o){return e.Children.map(o,(e=>{var o;if((null!==(o=t(e))&&void 0!==o?o:e.props.value).toLowerCase().includes(r.toLowerCase()))return e}))}const d=(e,t,o=!1)=>r(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",o&&"text-red-500",o?"border-red-500":"border-tremor-border dark:border-dark-tremor-border");function a(r){return null!=r&&""!==r}export{o as constructValueToNameMapping,n as getFilteredOptions,t as getNodeText,d as getSelectButtonColors,a as hasValue}; diff --git a/dist/components/layout-elements/Accordion/Accordion.cjs b/dist/components/layout-elements/Accordion/Accordion.cjs deleted file mode 100644 index 8c511ff58..000000000 --- a/dist/components/layout-elements/Accordion/Accordion.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("@headlessui/react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var t=require("../../../contexts/RootStylesContext.cjs");require("../../../contexts/SelectedValueContext.cjs");var o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs"),s=require("react");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=d(s);const c=a.makeClassName("Accordion"),l=s.createContext({isOpen:!1}),u=n.default.forwardRef(((a,d)=>{var u;const{defaultOpen:i=!1,children:f,className:m}=a,b=e.__rest(a,["defaultOpen","children","className"]),x=null!==(u=s.useContext(t))&&void 0!==u?u:o.tremorTwMerge("rounded-tremor-default border");return n.default.createElement(r.Disclosure,Object.assign({as:"div",ref:d,className:o.tremorTwMerge(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",x,m),defaultOpen:i},b),(({open:e})=>n.default.createElement(l.Provider,{value:{isOpen:e}},f)))}));u.displayName="Accordion",exports.OpenContext=l,exports.default=u; diff --git a/dist/components/layout-elements/Accordion/Accordion.d.ts b/dist/components/layout-elements/Accordion/Accordion.d.ts deleted file mode 100644 index 434579c5d..000000000 --- a/dist/components/layout-elements/Accordion/Accordion.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -interface OpenContextValue { - isOpen: boolean; -} -export declare const OpenContext: React.Context; -export interface AccordionProps extends React.HTMLAttributes { - defaultOpen?: boolean; -} -declare const Accordion: React.ForwardRefExoticComponent>; -export default Accordion; diff --git a/dist/components/layout-elements/Accordion/Accordion.js b/dist/components/layout-elements/Accordion/Accordion.js deleted file mode 100644 index aeb7da036..000000000 --- a/dist/components/layout-elements/Accordion/Accordion.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{Disclosure as r}from"@headlessui/react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import o from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";import d,{createContext as s,useContext as n}from"react";const m=a("Accordion"),i=s({isOpen:!1}),l=d.forwardRef(((a,s)=>{var l;const{defaultOpen:c=!1,children:p,className:f}=a,u=e(a,["defaultOpen","children","className"]),b=null!==(l=n(o))&&void 0!==l?l:t("rounded-tremor-default border");return d.createElement(r,Object.assign({as:"div",ref:s,className:t(m("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",b,f),defaultOpen:c},u),(({open:e})=>d.createElement(i.Provider,{value:{isOpen:e}},p)))}));l.displayName="Accordion";export{i as OpenContext,l as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.cjs b/dist/components/layout-elements/Accordion/AccordionBody.cjs deleted file mode 100644 index d11a57365..000000000 --- a/dist/components/layout-elements/Accordion/AccordionBody.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(r);const l=s.makeClassName("AccordionBody"),i=c.default.forwardRef(((r,s)=>{const{children:o,className:i}=r,u=e.__rest(r,["children","className"]);return c.default.createElement(t.Disclosure.Panel,Object.assign({ref:s,className:a.tremorTwMerge(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",i)},u),o)}));i.displayName="AccordionBody",module.exports=i; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.d.ts b/dist/components/layout-elements/Accordion/AccordionBody.d.ts deleted file mode 100644 index 3e710cfd0..000000000 --- a/dist/components/layout-elements/Accordion/AccordionBody.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const AccordionBody: React.ForwardRefExoticComponent & React.RefAttributes>; -export default AccordionBody; diff --git a/dist/components/layout-elements/Accordion/AccordionBody.js b/dist/components/layout-elements/Accordion/AccordionBody.js deleted file mode 100644 index 0963f67d7..000000000 --- a/dist/components/layout-elements/Accordion/AccordionBody.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as r}from"tslib";import e from"react";import{Disclosure as t}from"@headlessui/react";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const m=a("AccordionBody"),s=e.forwardRef(((a,s)=>{const{children:c,className:l}=a,i=r(a,["children","className"]);return e.createElement(t.Panel,Object.assign({ref:s,className:o(m("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},i),c)}));s.displayName="AccordionBody";export{s as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.cjs b/dist/components/layout-elements/Accordion/AccordionHeader.cjs deleted file mode 100644 index e0372f9ae..000000000 --- a/dist/components/layout-elements/Accordion/AccordionHeader.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("@headlessui/react"),a=require("../../../assets/ArrowUpHeadIcon.cjs"),s=require("./Accordion.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(t);const i=n.makeClassName("AccordionHeader"),u=c.default.forwardRef(((n,o)=>{const{children:u,className:d}=n,m=e.__rest(n,["children","className"]),{isOpen:f}=t.useContext(s.OpenContext);return c.default.createElement(r.Disclosure.Button,Object.assign({ref:o,className:l.tremorTwMerge(i("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},m),c.default.createElement("div",{className:l.tremorTwMerge(i("children"),"flex flex-1 text-inherit mr-4")},u),c.default.createElement("div",null,c.default.createElement(a,{className:l.tremorTwMerge(i("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))}));u.displayName="AccordionHeader",module.exports=u; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.d.ts b/dist/components/layout-elements/Accordion/AccordionHeader.d.ts deleted file mode 100644 index 3ceef3d30..000000000 --- a/dist/components/layout-elements/Accordion/AccordionHeader.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const AccordionHeader: React.ForwardRefExoticComponent & React.RefAttributes>; -export default AccordionHeader; diff --git a/dist/components/layout-elements/Accordion/AccordionHeader.js b/dist/components/layout-elements/Accordion/AccordionHeader.js deleted file mode 100644 index e4d202bb3..000000000 --- a/dist/components/layout-elements/Accordion/AccordionHeader.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t,{useContext as r}from"react";import{Disclosure as o}from"@headlessui/react";import a from"../../../assets/ArrowUpHeadIcon.js";import{OpenContext as s}from"./Accordion.js";import{tremorTwMerge as m}from"../../../lib/tremorTwMerge.js";import{makeClassName as n}from"../../../lib/utils.js";const i=n("AccordionHeader"),l=t.forwardRef(((n,l)=>{const{children:c,className:d}=n,f=e(n,["children","className"]),{isOpen:p}=r(s);return t.createElement(o.Button,Object.assign({ref:l,className:m(i("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},f),t.createElement("div",{className:m(i("children"),"flex flex-1 text-inherit mr-4")},c),t.createElement("div",null,t.createElement(a,{className:m(i("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",p?"transition-all":"transition-all -rotate-180")})))}));l.displayName="AccordionHeader";export{l as default}; diff --git a/dist/components/layout-elements/Accordion/AccordionList.cjs b/dist/components/layout-elements/Accordion/AccordionList.cjs deleted file mode 100644 index 821b281fd..000000000 --- a/dist/components/layout-elements/Accordion/AccordionList.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var t=require("../../../contexts/RootStylesContext.cjs");require("../../../contexts/SelectedValueContext.cjs");var o=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=d(r);const c=a.makeClassName("AccordionList"),n=l.default.forwardRef(((r,a)=>{const{children:d,className:n}=r,u=e.__rest(r,["children","className"]),s=l.default.Children.count(d);return l.default.createElement("div",Object.assign({ref:a,className:o.tremorTwMerge(c("root"),"rounded-tremor-default","shadow-tremor-card","dark:shadow-dark-tremor-card",n)},u),l.default.Children.map(d,((e,r)=>0===r?l.default.createElement(t.Provider,{value:o.tremorTwMerge("rounded-t-tremor-default border")},l.default.cloneElement(e)):r===s-1?l.default.createElement(t.Provider,{value:o.tremorTwMerge("rounded-b-tremor-default border-l border-r border-b")},l.default.cloneElement(e)):l.default.createElement(t.Provider,{value:o.tremorTwMerge("border-l border-r border-b")},l.default.cloneElement(e)))))}));n.displayName="AccordionList",module.exports=n; diff --git a/dist/components/layout-elements/Accordion/AccordionList.d.ts b/dist/components/layout-elements/Accordion/AccordionList.d.ts deleted file mode 100644 index 387dfb722..000000000 --- a/dist/components/layout-elements/Accordion/AccordionList.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react"; -export interface AccordionListProps extends React.HTMLAttributes { - children: React.ReactElement[] | React.ReactElement; -} -declare const AccordionList: React.ForwardRefExoticComponent>; -export default AccordionList; diff --git a/dist/components/layout-elements/Accordion/AccordionList.js b/dist/components/layout-elements/Accordion/AccordionList.js deleted file mode 100644 index 3b634797d..000000000 --- a/dist/components/layout-elements/Accordion/AccordionList.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r from"react";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import t from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{makeClassName as d}from"../../../lib/utils.js";const l=d("AccordionList"),n=r.forwardRef(((d,n)=>{const{children:a,className:m}=d,s=e(d,["children","className"]),c=r.Children.count(a);return r.createElement("div",Object.assign({ref:n,className:o(l("root"),"rounded-tremor-default","shadow-tremor-card","dark:shadow-dark-tremor-card",m)},s),r.Children.map(a,((e,d)=>0===d?r.createElement(t.Provider,{value:o("rounded-t-tremor-default border")},r.cloneElement(e)):d===c-1?r.createElement(t.Provider,{value:o("rounded-b-tremor-default border-l border-r border-b")},r.cloneElement(e)):r.createElement(t.Provider,{value:o("border-l border-r border-b")},r.cloneElement(e)))))}));n.displayName="AccordionList";export{n as default}; diff --git a/dist/components/layout-elements/Accordion/index.d.ts b/dist/components/layout-elements/Accordion/index.d.ts deleted file mode 100644 index ed5cb11bb..000000000 --- a/dist/components/layout-elements/Accordion/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { default as Accordion } from "./Accordion"; -export type { AccordionProps } from "./Accordion"; -export { default as AccordionBody } from "./AccordionBody"; -export { default as AccordionHeader } from "./AccordionHeader"; -export { default as AccordionList } from "./AccordionList"; -export type { AccordionListProps } from "./AccordionList"; diff --git a/dist/components/layout-elements/Card/Card.cjs b/dist/components/layout-elements/Card/Card.cjs deleted file mode 100644 index 481ad162c..000000000 --- a/dist/components/layout-elements/Card/Card.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var r=require("tslib"),e=require("react"),t=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var s=d(e);const n=i.makeClassName("Card"),l=r=>{if(!r)return"";switch(r){case t.HorizontalPositions.Left:return"border-l-4";case t.VerticalPositions.Top:return"border-t-4";case t.HorizontalPositions.Right:return"border-r-4";case t.VerticalPositions.Bottom:return"border-b-4";default:return""}},c=s.default.forwardRef(((e,t)=>{const{decoration:d="",decorationColor:c,children:u,className:b}=e,m=r.__rest(e,["decoration","decorationColor","children","className"]);return s.default.createElement("div",Object.assign({ref:t,className:a.tremorTwMerge(n("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",c?i.getColorClassNames(c,o.colorPalette.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",l(d),b)},m),u)}));c.displayName="Card",module.exports=c; diff --git a/dist/components/layout-elements/Card/Card.d.ts b/dist/components/layout-elements/Card/Card.d.ts deleted file mode 100644 index 3426bae53..000000000 --- a/dist/components/layout-elements/Card/Card.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react"; -import { Color, HorizontalPosition, VerticalPosition } from "lib"; -export interface CardProps extends React.HTMLAttributes { - decoration?: HorizontalPosition | VerticalPosition | ""; - decorationColor?: Color; -} -declare const Card: React.ForwardRefExoticComponent>; -export default Card; diff --git a/dist/components/layout-elements/Card/Card.js b/dist/components/layout-elements/Card/Card.js deleted file mode 100644 index ef84af496..000000000 --- a/dist/components/layout-elements/Card/Card.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as r}from"tslib";import e from"react";import{VerticalPositions as o,HorizontalPositions as t}from"../../../lib/constants.js";import{colorPalette as a}from"../../../lib/theme.js";import{tremorTwMerge as d}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as i,makeClassName as m}from"../../../lib/utils.js";const n=m("Card"),s=r=>{if(!r)return"";switch(r){case t.Left:return"border-l-4";case o.Top:return"border-t-4";case t.Right:return"border-r-4";case o.Bottom:return"border-b-4";default:return""}},c=e.forwardRef(((o,t)=>{const{decoration:m="",decorationColor:c,children:l,className:b}=o,f=r(o,["decoration","decorationColor","children","className"]);return e.createElement("div",Object.assign({ref:t,className:d(n("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",c?i(c,a.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",s(m),b)},f),l)}));c.displayName="Card";export{c as default}; diff --git a/dist/components/layout-elements/Card/index.d.ts b/dist/components/layout-elements/Card/index.d.ts deleted file mode 100644 index d26483de4..000000000 --- a/dist/components/layout-elements/Card/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Card } from "./Card"; -export type { CardProps } from "./Card"; diff --git a/dist/components/layout-elements/Dialog/Dialog.cjs b/dist/components/layout-elements/Dialog/Dialog.cjs deleted file mode 100644 index 103f5eb7c..000000000 --- a/dist/components/layout-elements/Dialog/Dialog.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),a=require("react"),t=require("@headlessui/react"),r=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(a);const n=i.makeClassName("dialog"),o=s.default.forwardRef(((a,i)=>{const{children:l,className:o}=a,c=e.__rest(a,["children","className"]);return s.default.createElement(t.Transition,{as:s.default.Fragment,appear:!0,show:a.open},s.default.createElement(t.Dialog,Object.assign({as:"div",ref:i},c,{className:r.tremorTwMerge(n("root"),"relative z-50",o)}),s.default.createElement(t.Transition.Child,{as:s.default.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},s.default.createElement("div",{className:r.tremorTwMerge("fixed inset-0 bg-slate-950/30 dark:bg-slate-950/50 transition-opacity")})),s.default.createElement("div",{className:"fixed inset-0 overflow-y-auto w-screen"},s.default.createElement("div",{className:"flex min-h-full items-center justify-center p-4"},l))))}));o.displayName="Dialog",module.exports=o; diff --git a/dist/components/layout-elements/Dialog/Dialog.d.ts b/dist/components/layout-elements/Dialog/Dialog.d.ts deleted file mode 100644 index 1b6a50ec7..000000000 --- a/dist/components/layout-elements/Dialog/Dialog.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; -type Without = { - [P in Exclude]?: never; -}; -type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; -export type DialogProps = React.HTMLAttributes & { - open: boolean; - onClose: (val: boolean) => void; - role?: "dialog" | "alertdialog"; -} & XOR<{ - unmount?: boolean; -}, { - static?: boolean; -}>; -declare const Dialog: React.ForwardRefExoticComponent>; -export default Dialog; diff --git a/dist/components/layout-elements/Dialog/Dialog.js b/dist/components/layout-elements/Dialog/Dialog.js deleted file mode 100644 index 3b9d52f37..000000000 --- a/dist/components/layout-elements/Dialog/Dialog.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import a from"react";import{Transition as t,Dialog as r}from"@headlessui/react";import{tremorTwMerge as i}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";const o=s("dialog"),l=a.forwardRef(((s,l)=>{const{children:m,className:n}=s,c=e(s,["children","className"]);return a.createElement(t,{as:a.Fragment,appear:!0,show:s.open},a.createElement(r,Object.assign({as:"div",ref:l},c,{className:i(o("root"),"relative z-50",n)}),a.createElement(t.Child,{as:a.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},a.createElement("div",{className:i("fixed inset-0 bg-slate-950/30 dark:bg-slate-950/50 transition-opacity")})),a.createElement("div",{className:"fixed inset-0 overflow-y-auto w-screen"},a.createElement("div",{className:"flex min-h-full items-center justify-center p-4"},m))))}));l.displayName="Dialog";export{l as default}; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.cjs b/dist/components/layout-elements/Dialog/DialogPanel.cjs deleted file mode 100644 index c66510422..000000000 --- a/dist/components/layout-elements/Dialog/DialogPanel.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("@headlessui/react"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");require("../../../contexts/BaseColorContext.cjs"),require("../../../contexts/IndexContext.cjs");var n=require("../../../contexts/RootStylesContext.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../contexts/SelectedValueContext.cjs");var s=l(r);const i=o.makeClassName("dialog"),c=s.default.forwardRef(((r,o)=>{var l;const{children:c,className:d}=r,u=e.__rest(r,["children","className"]),m=null!==(l=s.default.useContext(n))&&void 0!==l?l:a.tremorTwMerge("rounded-tremor-default p-6");return s.default.createElement(t.Transition.Child,{as:s.default.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},s.default.createElement(t.Dialog.Panel,Object.assign({ref:o,className:a.tremorTwMerge(i("panel"),"w-full max-w-lg overflow-hidden text-left ring-1 shadow-tremor transition-all transform","bg-tremor-background text-tremor-content ring-tremor-ring","dark:bg-dark-tremor-background dark:text-dark-tremor-content dark:ring-dark-tremor-ring",m,d)},u),c))}));c.displayName="DialogPanel",module.exports=c; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.d.ts b/dist/components/layout-elements/Dialog/DialogPanel.d.ts deleted file mode 100644 index e8ef0b834..000000000 --- a/dist/components/layout-elements/Dialog/DialogPanel.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import React from "react"; -export type DialogPanelProps = React.HTMLAttributes; -declare const DialogPanel: React.ForwardRefExoticComponent>; -export default DialogPanel; diff --git a/dist/components/layout-elements/Dialog/DialogPanel.js b/dist/components/layout-elements/Dialog/DialogPanel.js deleted file mode 100644 index f9ac63224..000000000 --- a/dist/components/layout-elements/Dialog/DialogPanel.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{Transition as r,Dialog as o}from"@headlessui/react";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as n}from"../../../lib/utils.js";import"../../../contexts/BaseColorContext.js";import"../../../contexts/IndexContext.js";import l from"../../../contexts/RootStylesContext.js";import"../../../contexts/SelectedValueContext.js";const s=n("dialog"),i=t.forwardRef(((n,i)=>{var m;const{children:c,className:d}=n,p=e(n,["children","className"]),f=null!==(m=t.useContext(l))&&void 0!==m?m:a("rounded-tremor-default p-6");return t.createElement(r.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},t.createElement(o.Panel,Object.assign({ref:i,className:a(s("panel"),"w-full max-w-lg overflow-hidden text-left ring-1 shadow-tremor transition-all transform","bg-tremor-background text-tremor-content ring-tremor-ring","dark:bg-dark-tremor-background dark:text-dark-tremor-content dark:ring-dark-tremor-ring",f,d)},p),c))}));i.displayName="DialogPanel";export{i as default}; diff --git a/dist/components/layout-elements/Dialog/index.d.ts b/dist/components/layout-elements/Dialog/index.d.ts deleted file mode 100644 index 945dcab0a..000000000 --- a/dist/components/layout-elements/Dialog/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Dialog, type DialogProps } from "./Dialog"; -export { default as DialogPanel, type DialogPanelProps } from "./DialogPanel"; diff --git a/dist/components/layout-elements/Divider/Divider.cjs b/dist/components/layout-elements/Divider/Divider.cjs deleted file mode 100644 index 8466576ec..000000000 --- a/dist/components/layout-elements/Divider/Divider.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(require("react"));const d=t.makeClassName("Divider"),m=l.default.forwardRef(((t,a)=>{const{className:m,children:o}=t,s=e.__rest(t,["className","children"]);return l.default.createElement("div",Object.assign({ref:a,className:r.tremorTwMerge(d("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",m)},s),o?l.default.createElement(l.default.Fragment,null,l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),l.default.createElement("div",{className:r.tremorTwMerge("text-inherit whitespace-nowrap")},o),l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):l.default.createElement("div",{className:r.tremorTwMerge("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))}));m.displayName="Divider",module.exports=m; diff --git a/dist/components/layout-elements/Divider/Divider.d.ts b/dist/components/layout-elements/Divider/Divider.d.ts deleted file mode 100644 index a0eb9461f..000000000 --- a/dist/components/layout-elements/Divider/Divider.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const Divider: React.ForwardRefExoticComponent & React.RefAttributes>; -export default Divider; diff --git a/dist/components/layout-elements/Divider/Divider.js b/dist/components/layout-elements/Divider/Divider.js deleted file mode 100644 index 62de13114..000000000 --- a/dist/components/layout-elements/Divider/Divider.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as t}from"../../../lib/utils.js";import a from"react";const m=t("Divider"),o=a.forwardRef(((t,o)=>{const{className:l,children:d}=t,s=e(t,["className","children"]);return a.createElement("div",Object.assign({ref:o,className:r(m("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",l)},s),d?a.createElement(a.Fragment,null,a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),a.createElement("div",{className:r("text-inherit whitespace-nowrap")},d),a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):a.createElement("div",{className:r("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))}));o.displayName="Divider";export{o as default}; diff --git a/dist/components/layout-elements/Divider/index.d.ts b/dist/components/layout-elements/Divider/index.d.ts deleted file mode 100644 index 5aafb2563..000000000 --- a/dist/components/layout-elements/Divider/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Divider } from "./Divider"; diff --git a/dist/components/layout-elements/Flex/Flex.cjs b/dist/components/layout-elements/Flex/Flex.cjs deleted file mode 100644 index a607569ee..000000000 --- a/dist/components/layout-elements/Flex/Flex.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("react"));const i=r.makeClassName("Flex"),n={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},a={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},o=l.default.forwardRef(((r,s)=>{const{flexDirection:o="row",justifyContent:f="between",alignItems:u="center",children:m,className:d}=r,j=e.__rest(r,["flexDirection","justifyContent","alignItems","children","className"]);return l.default.createElement("div",Object.assign({ref:s,className:t.tremorTwMerge(i("root"),"flex w-full",c[o],n[f],a[u],d)},j),m)}));o.displayName="Flex",module.exports=o; diff --git a/dist/components/layout-elements/Flex/Flex.d.ts b/dist/components/layout-elements/Flex/Flex.d.ts deleted file mode 100644 index e5cc7d7cc..000000000 --- a/dist/components/layout-elements/Flex/Flex.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import { AlignItems, FlexDirection, JustifyContent } from "../../../lib"; -export interface FlexProps extends React.HTMLAttributes { - flexDirection?: FlexDirection; - justifyContent?: JustifyContent; - alignItems?: AlignItems; - children: React.ReactNode; -} -declare const Flex: React.ForwardRefExoticComponent>; -export default Flex; diff --git a/dist/components/layout-elements/Flex/Flex.js b/dist/components/layout-elements/Flex/Flex.js deleted file mode 100644 index 5d57e811d..000000000 --- a/dist/components/layout-elements/Flex/Flex.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import s from"react";const i=r("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},n={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},o={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},a=s.forwardRef(((r,a)=>{const{flexDirection:f="row",justifyContent:c="between",alignItems:m="center",children:u,className:d}=r,j=e(r,["flexDirection","justifyContent","alignItems","children","className"]);return s.createElement("div",Object.assign({ref:a,className:t(i("root"),"flex w-full",o[f],l[c],n[m],d)},j),u)}));a.displayName="Flex";export{a as default}; diff --git a/dist/components/layout-elements/Flex/index.d.ts b/dist/components/layout-elements/Flex/index.d.ts deleted file mode 100644 index 4cd8021c0..000000000 --- a/dist/components/layout-elements/Flex/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Flex } from "./Flex"; -export type { FlexProps } from "./Flex"; diff --git a/dist/components/layout-elements/Grid/Col.cjs b/dist/components/layout-elements/Grid/Col.cjs deleted file mode 100644 index 1dc36bb71..000000000 --- a/dist/components/layout-elements/Grid/Col.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),n=require("../../../lib/utils.cjs"),a=require("react"),l=require("./styles.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(a);const s=n.makeClassName("Col"),u=o.default.forwardRef(((n,a)=>{const{numColSpan:t=1,numColSpanSm:u,numColSpanMd:c,numColSpanLg:m,children:i,className:S}=n,p=e.__rest(n,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return o.default.createElement("div",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),(()=>{const e=d(t,l.colSpan),n=d(u,l.colSpanSm),a=d(c,l.colSpanMd),o=d(m,l.colSpanLg);return r.tremorTwMerge(e,n,a,o)})(),S)},p),i)}));u.displayName="Col",module.exports=u; diff --git a/dist/components/layout-elements/Grid/Col.d.ts b/dist/components/layout-elements/Grid/Col.d.ts deleted file mode 100644 index 0e5d758ef..000000000 --- a/dist/components/layout-elements/Grid/Col.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -export interface ColProps extends React.HTMLAttributes { - numColSpan?: number; - numColSpanSm?: number; - numColSpanMd?: number; - numColSpanLg?: number; -} -declare const Col: React.ForwardRefExoticComponent>; -export default Col; diff --git a/dist/components/layout-elements/Grid/Col.js b/dist/components/layout-elements/Grid/Col.js deleted file mode 100644 index 804227dea..000000000 --- a/dist/components/layout-elements/Grid/Col.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as o}from"tslib";import{tremorTwMerge as n}from"../../../lib/tremorTwMerge.js";import{makeClassName as r}from"../../../lib/utils.js";import m from"react";import{colSpan as e,colSpanSm as l,colSpanMd as t,colSpanLg as a}from"./styles.js";const s=r("Col"),i=m.forwardRef(((r,i)=>{const{numColSpan:p=1,numColSpanSm:c,numColSpanMd:u,numColSpanLg:S,children:C,className:d}=r,f=o(r,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),b=(o,n)=>o&&Object.keys(n).includes(String(o))?n[o]:"";return m.createElement("div",Object.assign({ref:i,className:n(s("root"),(()=>{const o=b(p,e),r=b(c,l),m=b(u,t),s=b(S,a);return n(o,r,m,s)})(),d)},f),C)}));i.displayName="Col";export{i as default}; diff --git a/dist/components/layout-elements/Grid/Grid.cjs b/dist/components/layout-elements/Grid/Grid.cjs deleted file mode 100644 index e63968a65..000000000 --- a/dist/components/layout-elements/Grid/Grid.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),t=require("react"),m=require("./styles.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=i(t);const l=s.makeClassName("Grid"),a=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",d=u.default.forwardRef(((s,t)=>{const{numItems:i=1,numItemsSm:d,numItemsMd:n,numItemsLg:c,children:o,className:g}=s,f=e.__rest(s,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),I=a(i,m.gridCols),b=a(d,m.gridColsSm),j=a(n,m.gridColsMd),M=a(c,m.gridColsLg),q=r.tremorTwMerge(I,b,j,M);return u.default.createElement("div",Object.assign({ref:t,className:r.tremorTwMerge(l("root"),"grid",q,g)},f),o)}));d.displayName="Grid",module.exports=d; diff --git a/dist/components/layout-elements/Grid/Grid.d.ts b/dist/components/layout-elements/Grid/Grid.d.ts deleted file mode 100644 index fc83cddb7..000000000 --- a/dist/components/layout-elements/Grid/Grid.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -export interface GridProps extends React.HTMLAttributes { - numItems?: number; - numItemsSm?: number; - numItemsMd?: number; - numItemsLg?: number; - children: React.ReactNode; -} -declare const Grid: React.ForwardRefExoticComponent>; -export default Grid; diff --git a/dist/components/layout-elements/Grid/Grid.js b/dist/components/layout-elements/Grid/Grid.js deleted file mode 100644 index c364c2e1d..000000000 --- a/dist/components/layout-elements/Grid/Grid.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as m}from"tslib";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{makeClassName as s}from"../../../lib/utils.js";import t from"react";import{gridCols as r,gridColsSm as i,gridColsMd as n,gridColsLg as o}from"./styles.js";const a=s("Grid"),l=(m,e)=>m&&Object.keys(e).includes(String(m))?e[m]:"",c=t.forwardRef(((s,c)=>{const{numItems:d=1,numItemsSm:u,numItemsMd:f,numItemsLg:I,children:p,className:g}=s,b=m(s,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),j=l(d,r),N=l(u,i),y=l(f,n),M=l(I,o),S=e(j,N,y,M);return t.createElement("div",Object.assign({ref:c,className:e(a("root"),"grid",S,g)},b),p)}));c.displayName="Grid";export{c as default}; diff --git a/dist/components/layout-elements/Grid/index.d.ts b/dist/components/layout-elements/Grid/index.d.ts deleted file mode 100644 index b7bb8e691..000000000 --- a/dist/components/layout-elements/Grid/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as Col } from "./Col"; -export type { ColProps } from "./Col"; -export { default as Grid } from "./Grid"; -export type { GridProps } from "./Grid"; diff --git a/dist/components/layout-elements/Grid/styles.cjs b/dist/components/layout-elements/Grid/styles.cjs deleted file mode 100644 index c10a36c20..000000000 --- a/dist/components/layout-elements/Grid/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.colSpan={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},exports.colSpanLg={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"},exports.colSpanMd={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},exports.colSpanSm={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},exports.gridCols={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},exports.gridColsLg={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},exports.gridColsMd={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},exports.gridColsSm={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"}; diff --git a/dist/components/layout-elements/Grid/styles.d.ts b/dist/components/layout-elements/Grid/styles.d.ts deleted file mode 100644 index f15a8629e..000000000 --- a/dist/components/layout-elements/Grid/styles.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type GridClassesMapping = { - [key: string]: string; -}; -export declare const gridCols: GridClassesMapping; -export declare const gridColsSm: GridClassesMapping; -export declare const gridColsMd: GridClassesMapping; -export declare const gridColsLg: GridClassesMapping; -export declare const colSpan: GridClassesMapping; -export declare const colSpanSm: GridClassesMapping; -export declare const colSpanMd: GridClassesMapping; -export declare const colSpanLg: GridClassesMapping; diff --git a/dist/components/layout-elements/Grid/styles.js b/dist/components/layout-elements/Grid/styles.js deleted file mode 100644 index 434cafd12..000000000 --- a/dist/components/layout-elements/Grid/styles.js +++ /dev/null @@ -1 +0,0 @@ -const s={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},l={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},o={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},c={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},d={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},g={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},n={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},p={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"};export{d as colSpan,p as colSpanLg,n as colSpanMd,g as colSpanSm,s as gridCols,c as gridColsLg,o as gridColsMd,l as gridColsSm}; diff --git a/dist/components/layout-elements/index.d.ts b/dist/components/layout-elements/index.d.ts deleted file mode 100644 index c92f948a4..000000000 --- a/dist/components/layout-elements/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./Accordion"; -export * from "./Card"; -export * from "./Divider"; -export * from "./Flex"; -export * from "./Grid"; -export * from "./Dialog"; diff --git a/dist/components/list-elements/List/List.cjs b/dist/components/list-elements/List/List.cjs deleted file mode 100644 index ca013963a..000000000 --- a/dist/components/list-elements/List/List.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs"),t=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(require("react"));const s=t.makeClassName("List"),d=i.default.forwardRef(((t,a)=>{const{children:d,className:l}=t,o=e.__rest(t,["children","className"]);return i.default.createElement("ul",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),"w-full divide-y","divide-tremor-border text-tremor-content","dark:divide-dark-tremor-border dark:text-dark-tremor-content",l)},o),d)}));d.displayName="List",module.exports=d; diff --git a/dist/components/list-elements/List/List.d.ts b/dist/components/list-elements/List/List.d.ts deleted file mode 100644 index b56b0b54e..000000000 --- a/dist/components/list-elements/List/List.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const List: React.ForwardRefExoticComponent & React.RefAttributes>; -export default List; diff --git a/dist/components/list-elements/List/List.js b/dist/components/list-elements/List/List.js deleted file mode 100644 index 66de5e7a7..000000000 --- a/dist/components/list-elements/List/List.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as r}from"tslib";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{makeClassName as t}from"../../../lib/utils.js";import o from"react";const i=t("List"),a=o.forwardRef(((t,a)=>{const{children:m,className:s}=t,d=r(t,["children","className"]);return o.createElement("ul",Object.assign({ref:a,className:e(i("root"),"w-full divide-y","divide-tremor-border text-tremor-content","dark:divide-dark-tremor-border dark:text-dark-tremor-content",s)},d),m)}));a.displayName="List";export{a as default}; diff --git a/dist/components/list-elements/List/ListItem.cjs b/dist/components/list-elements/List/ListItem.cjs deleted file mode 100644 index 64b7e2b1e..000000000 --- a/dist/components/list-elements/List/ListItem.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(t);const i=l.makeClassName("ListItem"),u=s.default.forwardRef(((t,l)=>{const{children:a,className:u}=t,c=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("li",Object.assign({ref:l,className:r.tremorTwMerge(i("root"),"w-full flex justify-between items-center text-tremor-default py-2",u)},c),a))}));u.displayName="ListItem",module.exports=u; diff --git a/dist/components/list-elements/List/ListItem.d.ts b/dist/components/list-elements/List/ListItem.d.ts deleted file mode 100644 index 077c98a59..000000000 --- a/dist/components/list-elements/List/ListItem.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const ListItem: React.ForwardRefExoticComponent & React.RefAttributes>; -export default ListItem; diff --git a/dist/components/list-elements/List/ListItem.js b/dist/components/list-elements/List/ListItem.js deleted file mode 100644 index b33600b01..000000000 --- a/dist/components/list-elements/List/ListItem.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const m=l("ListItem"),s=t.forwardRef(((l,s)=>{const{children:a,className:i}=l,o=e(l,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("li",Object.assign({ref:s,className:r(m("root"),"w-full flex justify-between items-center text-tremor-default py-2",i)},o),a))}));s.displayName="ListItem";export{s as default}; diff --git a/dist/components/list-elements/List/index.d.ts b/dist/components/list-elements/List/index.d.ts deleted file mode 100644 index 7944cfdf9..000000000 --- a/dist/components/list-elements/List/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as List } from "./List"; -export { default as ListItem } from "./ListItem"; diff --git a/dist/components/list-elements/Table/Table.cjs b/dist/components/list-elements/Table/Table.cjs deleted file mode 100644 index 278427525..000000000 --- a/dist/components/list-elements/Table/Table.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const o=a.makeClassName("Table"),c=s.default.forwardRef(((t,a)=>{const{children:l,className:c}=t,u=e.__rest(t,["children","className"]);return s.default.createElement("div",{className:r.tremorTwMerge(o("root"),"overflow-auto",c)},s.default.createElement("table",Object.assign({ref:a,className:r.tremorTwMerge(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},u),l))}));c.displayName="Table",module.exports=c; diff --git a/dist/components/list-elements/Table/Table.d.ts b/dist/components/list-elements/Table/Table.d.ts deleted file mode 100644 index 615653b5e..000000000 --- a/dist/components/list-elements/Table/Table.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const Table: React.ForwardRefExoticComponent & React.RefAttributes>; -export default Table; diff --git a/dist/components/list-elements/Table/Table.js b/dist/components/list-elements/Table/Table.js deleted file mode 100644 index 534c30d44..000000000 --- a/dist/components/list-elements/Table/Table.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const o=a("Table"),l=t.forwardRef(((a,l)=>{const{children:m,className:s}=a,c=e(a,["children","className"]);return t.createElement("div",{className:r(o("root"),"overflow-auto",s)},t.createElement("table",Object.assign({ref:l,className:r(o("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},c),m))}));l.displayName="Table";export{l as default}; diff --git a/dist/components/list-elements/Table/TableBody.cjs b/dist/components/list-elements/Table/TableBody.cjs deleted file mode 100644 index fa99b806e..000000000 --- a/dist/components/list-elements/Table/TableBody.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(r);const i=a.makeClassName("TableBody"),s=d.default.forwardRef(((r,a)=>{const{children:l,className:s}=r,o=e.__rest(r,["children","className"]);return d.default.createElement(d.default.Fragment,null,d.default.createElement("tbody",Object.assign({ref:a,className:t.tremorTwMerge(i("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",s)},o),l))}));s.displayName="TableBody",module.exports=s; diff --git a/dist/components/list-elements/Table/TableBody.d.ts b/dist/components/list-elements/Table/TableBody.d.ts deleted file mode 100644 index 322a2bcf6..000000000 --- a/dist/components/list-elements/Table/TableBody.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableBody: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableBody; diff --git a/dist/components/list-elements/Table/TableBody.js b/dist/components/list-elements/Table/TableBody.js deleted file mode 100644 index 9e102b25e..000000000 --- a/dist/components/list-elements/Table/TableBody.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableBody"),i=r.forwardRef(((o,i)=>{const{children:d,className:l}=o,m=e(o,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tbody",Object.assign({ref:i,className:t(a("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",l)},m),d))}));i.displayName="TableBody";export{i as default}; diff --git a/dist/components/list-elements/Table/TableCell.cjs b/dist/components/list-elements/Table/TableCell.cjs deleted file mode 100644 index 8382bd206..000000000 --- a/dist/components/list-elements/Table/TableCell.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);const i=l.makeClassName("TableCell"),c=s.default.forwardRef(((r,l)=>{const{children:a,className:c}=r,u=e.__rest(r,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("td",Object.assign({ref:l,className:t.tremorTwMerge(i("root"),"align-middle whitespace-nowrap text-left p-4",c)},u),a))}));c.displayName="TableCell",module.exports=c; diff --git a/dist/components/list-elements/Table/TableCell.d.ts b/dist/components/list-elements/Table/TableCell.d.ts deleted file mode 100644 index 7e7f6038d..000000000 --- a/dist/components/list-elements/Table/TableCell.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableCell: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableCell; diff --git a/dist/components/list-elements/Table/TableCell.js b/dist/components/list-elements/Table/TableCell.js deleted file mode 100644 index f5d90d18a..000000000 --- a/dist/components/list-elements/Table/TableCell.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as l}from"../../../lib/utils.js";const a=l("TableCell"),m=r.forwardRef(((l,m)=>{const{children:s,className:o}=l,i=e(l,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("td",Object.assign({ref:m,className:t(a("root"),"align-middle whitespace-nowrap text-left p-4",o)},i),s))}));m.displayName="TableCell";export{m as default}; diff --git a/dist/components/list-elements/Table/TableFoot.cjs b/dist/components/list-elements/Table/TableFoot.cjs deleted file mode 100644 index 5ca929878..000000000 --- a/dist/components/list-elements/Table/TableFoot.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);const l=o.makeClassName("TableFoot"),d=s.default.forwardRef(((r,o)=>{const{children:a,className:d}=r,c=e.__rest(r,["children","className"]);return s.default.createElement("tfoot",Object.assign({ref:o,className:t.tremorTwMerge(l("root"),"text-left font-medium border-t-[1px] ","text-tremor-content border-tremor-border","dark:text-dark-tremor-content dark:border-dark-tremor-border",d)},c),a)}));d.displayName="TableFoot",module.exports=d; diff --git a/dist/components/list-elements/Table/TableFoot.d.ts b/dist/components/list-elements/Table/TableFoot.d.ts deleted file mode 100644 index 9571f1099..000000000 --- a/dist/components/list-elements/Table/TableFoot.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableFoot: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableFoot; diff --git a/dist/components/list-elements/Table/TableFoot.js b/dist/components/list-elements/Table/TableFoot.js deleted file mode 100644 index 5492e973a..000000000 --- a/dist/components/list-elements/Table/TableFoot.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as r}from"tslib";import e from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableFoot"),m=e.forwardRef(((o,m)=>{const{children:s,className:d}=o,l=r(o,["children","className"]);return e.createElement("tfoot",Object.assign({ref:m,className:t(a("root"),"text-left font-medium border-t-[1px] ","text-tremor-content border-tremor-border","dark:text-dark-tremor-content dark:border-dark-tremor-border",d)},l),s)}));m.displayName="TableFoot";export{m as default}; diff --git a/dist/components/list-elements/Table/TableFooterCell.cjs b/dist/components/list-elements/Table/TableFooterCell.cjs deleted file mode 100644 index e40275c16..000000000 --- a/dist/components/list-elements/Table/TableFooterCell.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(t);const s=a.makeClassName("TableFooterCell"),n=o.default.forwardRef(((t,a)=>{const{children:l,className:n}=t,c=e.__rest(t,["children","className"]);return o.default.createElement(o.default.Fragment,null,o.default.createElement("th",Object.assign({ref:a,className:r.tremorTwMerge(s("root"),"top-0 px-4 py-3.5","text-tremor-content font-medium","dark:text-dark-tremor-content",n)},c),l))}));n.displayName="TableFooterCell",module.exports=n; diff --git a/dist/components/list-elements/Table/TableFooterCell.d.ts b/dist/components/list-elements/Table/TableFooterCell.d.ts deleted file mode 100644 index baef22428..000000000 --- a/dist/components/list-elements/Table/TableFooterCell.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableFooterCell: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableFooterCell; diff --git a/dist/components/list-elements/Table/TableFooterCell.js b/dist/components/list-elements/Table/TableFooterCell.js deleted file mode 100644 index 5188d274c..000000000 --- a/dist/components/list-elements/Table/TableFooterCell.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const l=o("TableFooterCell"),a=t.forwardRef(((o,a)=>{const{children:m,className:s}=o,n=e(o,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("th",Object.assign({ref:a,className:r(l("root"),"top-0 px-4 py-3.5","text-tremor-content font-medium","dark:text-dark-tremor-content",s)},n),m))}));a.displayName="TableFooterCell";export{a as default}; diff --git a/dist/components/list-elements/Table/TableHead.cjs b/dist/components/list-elements/Table/TableHead.cjs deleted file mode 100644 index aef4ed5ed..000000000 --- a/dist/components/list-elements/Table/TableHead.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const c=a.makeClassName("TableHead"),n=s.default.forwardRef(((t,a)=>{const{children:l,className:n}=t,u=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("thead",Object.assign({ref:a,className:r.tremorTwMerge(c("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",n)},u),l))}));n.displayName="TableHead",module.exports=n; diff --git a/dist/components/list-elements/Table/TableHead.d.ts b/dist/components/list-elements/Table/TableHead.d.ts deleted file mode 100644 index 69a2f410d..000000000 --- a/dist/components/list-elements/Table/TableHead.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableHead: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableHead; diff --git a/dist/components/list-elements/Table/TableHead.js b/dist/components/list-elements/Table/TableHead.js deleted file mode 100644 index ee75c7035..000000000 --- a/dist/components/list-elements/Table/TableHead.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const o=a("TableHead"),l=t.forwardRef(((a,l)=>{const{children:m,className:s}=a,n=e(a,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("thead",Object.assign({ref:l,className:r(o("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",s)},n),m))}));l.displayName="TableHead";export{l as default}; diff --git a/dist/components/list-elements/Table/TableHeaderCell.cjs b/dist/components/list-elements/Table/TableHeaderCell.cjs deleted file mode 100644 index 08b4da5a3..000000000 --- a/dist/components/list-elements/Table/TableHeaderCell.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t);const n=a.makeClassName("TableHeaderCell"),o=s.default.forwardRef(((t,a)=>{const{children:l,className:o}=t,c=e.__rest(t,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("th",Object.assign({ref:a,className:r.tremorTwMerge(n("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",o)},c),l))}));o.displayName="TableHeaderCell",module.exports=o; diff --git a/dist/components/list-elements/Table/TableHeaderCell.d.ts b/dist/components/list-elements/Table/TableHeaderCell.d.ts deleted file mode 100644 index f665da95b..000000000 --- a/dist/components/list-elements/Table/TableHeaderCell.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableHeaderCell: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableHeaderCell; diff --git a/dist/components/list-elements/Table/TableHeaderCell.js b/dist/components/list-elements/Table/TableHeaderCell.js deleted file mode 100644 index c1c242a6e..000000000 --- a/dist/components/list-elements/Table/TableHeaderCell.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{makeClassName as o}from"../../../lib/utils.js";const a=o("TableHeaderCell"),l=t.forwardRef(((o,l)=>{const{children:s,className:m}=o,n=e(o,["children","className"]);return t.createElement(t.Fragment,null,t.createElement("th",Object.assign({ref:l,className:r(a("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",m)},n),s))}));l.displayName="TableHeaderCell";export{l as default}; diff --git a/dist/components/list-elements/Table/TableRow.cjs b/dist/components/list-elements/Table/TableRow.cjs deleted file mode 100644 index 7c0d8b5ba..000000000 --- a/dist/components/list-elements/Table/TableRow.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r);const u=a.makeClassName("TableRow"),c=s.default.forwardRef(((r,a)=>{const{children:l,className:c}=r,i=e.__rest(r,["children","className"]);return s.default.createElement(s.default.Fragment,null,s.default.createElement("tr",Object.assign({ref:a,className:t.tremorTwMerge(u("row"),c)},i),l))}));c.displayName="TableRow",module.exports=c; diff --git a/dist/components/list-elements/Table/TableRow.d.ts b/dist/components/list-elements/Table/TableRow.d.ts deleted file mode 100644 index 9e16ea2a2..000000000 --- a/dist/components/list-elements/Table/TableRow.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const TableRow: React.ForwardRefExoticComponent & React.RefAttributes>; -export default TableRow; diff --git a/dist/components/list-elements/Table/TableRow.js b/dist/components/list-elements/Table/TableRow.js deleted file mode 100644 index 53b8aad6e..000000000 --- a/dist/components/list-elements/Table/TableRow.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import r from"react";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{makeClassName as a}from"../../../lib/utils.js";const l=a("TableRow"),m=r.forwardRef(((a,m)=>{const{children:o,className:s}=a,i=e(a,["children","className"]);return r.createElement(r.Fragment,null,r.createElement("tr",Object.assign({ref:m,className:t(l("row"),s)},i),o))}));m.displayName="TableRow";export{m as default}; diff --git a/dist/components/list-elements/Table/index.d.ts b/dist/components/list-elements/Table/index.d.ts deleted file mode 100644 index b63bbe265..000000000 --- a/dist/components/list-elements/Table/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as Table } from "./Table"; -export { default as TableBody } from "./TableBody"; -export { default as TableCell } from "./TableCell"; -export { default as TableFoot } from "./TableFoot"; -export { default as TableFooterCell } from "./TableFooterCell"; -export { default as TableHead } from "./TableHead"; -export { default as TableHeaderCell } from "./TableHeaderCell"; -export { default as TableRow } from "./TableRow"; diff --git a/dist/components/list-elements/index.d.ts b/dist/components/list-elements/index.d.ts deleted file mode 100644 index 0667dd2d0..000000000 --- a/dist/components/list-elements/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./List"; -export * from "./Table"; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs deleted file mode 100644 index 55a2e6651..000000000 --- a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),n=require("../../chart-elements/common/utils.cjs"),i=require("../../chart-elements/common/NoData.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(t);const m=u.default.forwardRef(((t,c)=>{const{data:m=[],categories:d=[],index:f,stack:p=!1,colors:C=o.themeColorRange,showAnimation:y=!1,animationDuration:g=900,showGradient:x=!0,curveType:h="linear",connectNulls:N=!1,noDataText:v,autoMinValue:E=!1,minValue:k,maxValue:A,className:j}=t,q=e.__rest(t,["data","categories","index","stack","colors","showAnimation","animationDuration","showGradient","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),w=n.constructCategoryColors(d,C),b=n.getYAxisDomain(E,k,A);return u.default.createElement("div",Object.assign({ref:c,className:l.tremorTwMerge("w-28 h-12",j)},q),u.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?u.default.createElement(a.AreaChart,{data:m,margin:{top:1,left:1,right:1,bottom:1}},u.default.createElement(a.YAxis,{hide:!0,domain:b}),u.default.createElement(a.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var t,a;return u.default.createElement("defs",{key:e},x?u.default.createElement("linearGradient",{className:s.getColorClassNames(null!==(t=w.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).textColor,id:w.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},u.default.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),u.default.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):u.default.createElement("linearGradient",{className:s.getColorClassNames(null!==(a=w.get(e))&&void 0!==a?a:r.BaseColors.Gray,o.colorPalette.text).textColor,id:w.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},u.default.createElement("stop",{stopColor:"currentColor",stopOpacity:.3})))})),d.map((e=>{var t;return u.default.createElement(a.Area,{className:s.getColorClassNames(null!==(t=w.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).strokeColor,strokeOpacity:1,dot:!1,key:e,name:e,type:h,dataKey:e,stroke:"",fill:`url(#${w.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:y,animationDuration:g,stackId:p?"a":void 0,connectNulls:N})}))):u.default.createElement(i,{noDataText:v})))}));m.displayName="AreaChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts deleted file mode 100644 index aaac77750..000000000 --- a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -import { CurveType } from "../../../lib/inputTypes"; -import BaseSparkChartProps from "../common/BaseSparkChartProps"; -export interface SparkAreaChartProps extends BaseSparkChartProps { - stack?: boolean; - curveType?: CurveType; - connectNulls?: boolean; - showGradient?: boolean; -} -declare const AreaChart: React.ForwardRefExoticComponent>; -export default AreaChart; diff --git a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js b/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js deleted file mode 100644 index e8e6590fd..000000000 --- a/dist/components/spark-elements/SparkAreaChart/SparkAreaChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import{ResponsiveContainer as a,AreaChart as o,YAxis as r,XAxis as n,Area as l}from"recharts";import{BaseColors as i}from"../../../lib/constants.js";import{themeColorRange as s,colorPalette as m}from"../../../lib/theme.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as u}from"../../../lib/utils.js";import{constructCategoryColors as d,getYAxisDomain as p}from"../../chart-elements/common/utils.js";import f from"../../chart-elements/common/NoData.js";const y=t.forwardRef(((y,h)=>{const{data:x=[],categories:g=[],index:E,stack:N=!1,colors:k=s,showAnimation:v=!1,animationDuration:C=900,showGradient:j=!0,curveType:w="linear",connectNulls:b=!1,noDataText:D,autoMinValue:G=!1,minValue:A,maxValue:T,className:V}=y,O=e(y,["data","categories","index","stack","colors","showAnimation","animationDuration","showGradient","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),M=d(g,k),K=p(G,A,T);return t.createElement("div",Object.assign({ref:h,className:c("w-28 h-12",V)},O),t.createElement(a,{className:"h-full w-full"},(null==x?void 0:x.length)?t.createElement(o,{data:x,margin:{top:1,left:1,right:1,bottom:1}},t.createElement(r,{hide:!0,domain:K}),t.createElement(n,{hide:!0,dataKey:E}),g.map((e=>{var a,o;return t.createElement("defs",{key:e},j?t.createElement("linearGradient",{className:u(null!==(a=M.get(e))&&void 0!==a?a:i.Gray,m.text).textColor,id:M.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:.4}),t.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):t.createElement("linearGradient",{className:u(null!==(o=M.get(e))&&void 0!==o?o:i.Gray,m.text).textColor,id:M.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},t.createElement("stop",{stopColor:"currentColor",stopOpacity:.3})))})),g.map((e=>{var a;return t.createElement(l,{className:u(null!==(a=M.get(e))&&void 0!==a?a:i.Gray,m.text).strokeColor,strokeOpacity:1,dot:!1,key:e,name:e,type:w,dataKey:e,stroke:"",fill:`url(#${M.get(e)})`,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:v,animationDuration:C,stackId:N?"a":void 0,connectNulls:b})}))):t.createElement(f,{noDataText:D})))}));y.displayName="AreaChart";export{y as default}; diff --git a/dist/components/spark-elements/SparkAreaChart/index.d.ts b/dist/components/spark-elements/SparkAreaChart/index.d.ts deleted file mode 100644 index adf7015d5..000000000 --- a/dist/components/spark-elements/SparkAreaChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as SparkAreaChart } from "./SparkAreaChart"; -export type { SparkAreaChartProps } from "./SparkAreaChart"; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs b/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs deleted file mode 100644 index a37d279f0..000000000 --- a/dist/components/spark-elements/SparkBarChart/SparkBarChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),a=require("../../../lib/constants.cjs"),t=require("../../../lib/theme.cjs"),r=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("react"),o=require("recharts"),n=require("../../chart-elements/common/utils.cjs"),s=require("../../chart-elements/common/NoData.cjs");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(l);const m=u.default.forwardRef(((l,c)=>{const{data:m=[],categories:d=[],index:f,colors:g=t.themeColorRange,stack:h=!1,relative:x=!1,animationDuration:v=900,showAnimation:C=!1,noDataText:b,autoMinValue:p=!1,minValue:q,maxValue:j,className:w}=l,y=e.__rest(l,["data","categories","index","colors","stack","relative","animationDuration","showAnimation","noDataText","autoMinValue","minValue","maxValue","className"]),D=n.constructCategoryColors(d,g),N=n.getYAxisDomain(p,q,j);return u.default.createElement("div",Object.assign({ref:c,className:r.tremorTwMerge("w-28 h-12",w)},y),u.default.createElement(o.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?u.default.createElement(o.BarChart,{data:m,stackOffset:x?"expand":"none",margin:{top:0,left:-1.5,right:-1.5,bottom:0}},u.default.createElement(o.YAxis,{hide:!0,domain:N}),u.default.createElement(o.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var l;return u.default.createElement(o.Bar,{className:r.tremorTwMerge(i.getColorClassNames(null!==(l=D.get(e))&&void 0!==l?l:a.BaseColors.Gray,t.colorPalette.background).fillColor),key:e,name:e,type:"linear",stackId:h||x?"a":void 0,dataKey:e,fill:"",isAnimationActive:C,animationDuration:v})}))):u.default.createElement(s,{noDataText:b})))}));m.displayName="SparkBarChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts b/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts deleted file mode 100644 index 58a69eb2a..000000000 --- a/dist/components/spark-elements/SparkBarChart/SparkBarChart.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react"; -import BaseSparkChartProps from "../common/BaseSparkChartProps"; -export interface SparkBarChartProps extends BaseSparkChartProps { - stack?: boolean; - relative?: boolean; -} -declare const SparkBarChart: React.ForwardRefExoticComponent>; -export default SparkBarChart; diff --git a/dist/components/spark-elements/SparkBarChart/SparkBarChart.js b/dist/components/spark-elements/SparkBarChart/SparkBarChart.js deleted file mode 100644 index 9982486f1..000000000 --- a/dist/components/spark-elements/SparkBarChart/SparkBarChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as a}from"tslib";import{BaseColors as e}from"../../../lib/constants.js";import{themeColorRange as t,colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as i}from"../../../lib/utils.js";import m from"react";import{ResponsiveContainer as n,BarChart as l,YAxis as s,XAxis as c,Bar as u}from"recharts";import{constructCategoryColors as d,getYAxisDomain as f}from"../../chart-elements/common/utils.js";import p from"../../chart-elements/common/NoData.js";const h=m.forwardRef(((h,g)=>{const{data:x=[],categories:b=[],index:v,colors:j=t,stack:k=!1,relative:D=!1,animationDuration:E=900,showAnimation:N=!1,noDataText:w,autoMinValue:y=!1,minValue:V,maxValue:A,className:T}=h,M=a(h,["data","categories","index","colors","stack","relative","animationDuration","showAnimation","noDataText","autoMinValue","minValue","maxValue","className"]),C=d(b,j),K=f(y,V,A);return m.createElement("div",Object.assign({ref:g,className:r("w-28 h-12",T)},M),m.createElement(n,{className:"h-full w-full"},(null==x?void 0:x.length)?m.createElement(l,{data:x,stackOffset:D?"expand":"none",margin:{top:0,left:-1.5,right:-1.5,bottom:0}},m.createElement(s,{hide:!0,domain:K}),m.createElement(c,{hide:!0,dataKey:v}),b.map((a=>{var t;return m.createElement(u,{className:r(i(null!==(t=C.get(a))&&void 0!==t?t:e.Gray,o.background).fillColor),key:a,name:a,type:"linear",stackId:k||D?"a":void 0,dataKey:a,fill:"",isAnimationActive:N,animationDuration:E})}))):m.createElement(p,{noDataText:w})))}));h.displayName="SparkBarChart";export{h as default}; diff --git a/dist/components/spark-elements/SparkBarChart/index.d.ts b/dist/components/spark-elements/SparkBarChart/index.d.ts deleted file mode 100644 index ea3b365e8..000000000 --- a/dist/components/spark-elements/SparkBarChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as SparkBarChart } from "./SparkBarChart"; -export type { SparkBarChartProps } from "./SparkBarChart"; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs b/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs deleted file mode 100644 index d564bbea6..000000000 --- a/dist/components/spark-elements/SparkLineChart/SparkLineChart.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),a=require("recharts"),r=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs"),n=require("../../../lib/tremorTwMerge.cjs"),i=require("../../../lib/utils.cjs"),l=require("../../chart-elements/common/utils.cjs"),s=require("../../chart-elements/common/NoData.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);const m=c.default.forwardRef(((t,u)=>{const{data:m=[],categories:d=[],index:f,colors:h=o.themeColorRange,animationDuration:g=900,showAnimation:p=!1,curveType:x="linear",connectNulls:y=!1,noDataText:N,autoMinValue:v=!1,minValue:C,maxValue:j,className:q}=t,b=e.__rest(t,["data","categories","index","colors","animationDuration","showAnimation","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),k=l.constructCategoryColors(d,h),w=l.getYAxisDomain(v,C,j);return c.default.createElement("div",Object.assign({ref:u,className:n.tremorTwMerge("w-28 h-12",q)},b),c.default.createElement(a.ResponsiveContainer,{className:"h-full w-full"},(null==m?void 0:m.length)?c.default.createElement(a.LineChart,{data:m,margin:{top:1,left:1,right:1,bottom:1}},c.default.createElement(a.YAxis,{hide:!0,domain:w}),c.default.createElement(a.XAxis,{hide:!0,dataKey:f}),d.map((e=>{var t;return c.default.createElement(a.Line,{className:n.tremorTwMerge(i.getColorClassNames(null!==(t=k.get(e))&&void 0!==t?t:r.BaseColors.Gray,o.colorPalette.text).strokeColor),strokeOpacity:1,dot:!1,key:e,name:e,type:x,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:p,animationDuration:g,connectNulls:y})}))):c.default.createElement(s,{noDataText:N})))}));m.displayName="SparkLineChart",module.exports=m; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts b/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts deleted file mode 100644 index 245cf9cc3..000000000 --- a/dist/components/spark-elements/SparkLineChart/SparkLineChart.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import { CurveType } from "../../../lib/inputTypes"; -import BaseSparkChartProps from "../common/BaseSparkChartProps"; -export interface SparkLineChartProps extends BaseSparkChartProps { - curveType?: CurveType; - connectNulls?: boolean; -} -declare const SparkLineChart: React.ForwardRefExoticComponent>; -export default SparkLineChart; diff --git a/dist/components/spark-elements/SparkLineChart/SparkLineChart.js b/dist/components/spark-elements/SparkLineChart/SparkLineChart.js deleted file mode 100644 index c63959998..000000000 --- a/dist/components/spark-elements/SparkLineChart/SparkLineChart.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import{ResponsiveContainer as a,LineChart as o,YAxis as r,XAxis as n,Line as i}from"recharts";import{BaseColors as m}from"../../../lib/constants.js";import{themeColorRange as l,colorPalette as s}from"../../../lib/theme.js";import{tremorTwMerge as c}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as u}from"../../../lib/utils.js";import{constructCategoryColors as d,getYAxisDomain as p}from"../../chart-elements/common/utils.js";import f from"../../chart-elements/common/NoData.js";const h=t.forwardRef(((h,N)=>{const{data:x=[],categories:y=[],index:g,colors:j=l,animationDuration:k=900,showAnimation:b=!1,curveType:v="linear",connectNulls:D=!1,noDataText:E,autoMinValue:w=!1,minValue:T,maxValue:V,className:A}=h,L=e(h,["data","categories","index","colors","animationDuration","showAnimation","curveType","connectNulls","noDataText","autoMinValue","minValue","maxValue","className"]),M=d(y,j),C=p(w,T,V);return t.createElement("div",Object.assign({ref:N,className:c("w-28 h-12",A)},L),t.createElement(a,{className:"h-full w-full"},(null==x?void 0:x.length)?t.createElement(o,{data:x,margin:{top:1,left:1,right:1,bottom:1}},t.createElement(r,{hide:!0,domain:C}),t.createElement(n,{hide:!0,dataKey:g}),y.map((e=>{var a;return t.createElement(i,{className:c(u(null!==(a=M.get(e))&&void 0!==a?a:m.Gray,s.text).strokeColor),strokeOpacity:1,dot:!1,key:e,name:e,type:v,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:b,animationDuration:k,connectNulls:D})}))):t.createElement(f,{noDataText:E})))}));h.displayName="SparkLineChart";export{h as default}; diff --git a/dist/components/spark-elements/SparkLineChart/index.d.ts b/dist/components/spark-elements/SparkLineChart/index.d.ts deleted file mode 100644 index 5e93d8e5c..000000000 --- a/dist/components/spark-elements/SparkLineChart/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as SparkLineChart } from "./SparkLineChart"; -export type { SparkLineChartProps } from "./SparkLineChart"; diff --git a/dist/components/spark-elements/common/BaseSparkChartProps.d.ts b/dist/components/spark-elements/common/BaseSparkChartProps.d.ts deleted file mode 100644 index 3e41dbeab..000000000 --- a/dist/components/spark-elements/common/BaseSparkChartProps.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// -import BaseAnimationTimingProps from "components/chart-elements/common/BaseAnimationTimingProps"; -import { Color } from "../../../lib"; -type FixedProps = { - eventType: "dot" | "category" | "bar" | "slice" | "bubble"; - categoryClicked: string; -}; -type BaseEventProps = FixedProps & { - [key: string]: number | string; -}; -export type EventProps = BaseEventProps | null | undefined; -interface BaseSparkChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { - data: any[]; - categories: string[]; - index: string; - colors?: (Color | string)[]; - noDataText?: string; - autoMinValue?: boolean; - minValue?: number; - maxValue?: number; -} -export default BaseSparkChartProps; diff --git a/dist/components/spark-elements/index.d.ts b/dist/components/spark-elements/index.d.ts deleted file mode 100644 index b81686344..000000000 --- a/dist/components/spark-elements/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./SparkBarChart"; -export * from "./SparkLineChart"; -export * from "./SparkAreaChart"; diff --git a/dist/components/text-elements/Bold/Bold.cjs b/dist/components/text-elements/Bold/Bold.cjs deleted file mode 100644 index c132c49c6..000000000 --- a/dist/components/text-elements/Bold/Bold.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));const s=a.default.forwardRef(((t,s)=>{const{children:l,className:c}=t,i=e.__rest(t,["children","className"]);return a.default.createElement("b",Object.assign({ref:s,className:r.tremorTwMerge("text-inherit font-bold",c)},i),l)}));s.displayName="Bold",module.exports=s; diff --git a/dist/components/text-elements/Bold/Bold.d.ts b/dist/components/text-elements/Bold/Bold.d.ts deleted file mode 100644 index ff7cdeddb..000000000 --- a/dist/components/text-elements/Bold/Bold.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const Bold: React.ForwardRefExoticComponent & React.RefAttributes>; -export default Bold; diff --git a/dist/components/text-elements/Bold/Bold.js b/dist/components/text-elements/Bold/Bold.js deleted file mode 100644 index d9a20c0e1..000000000 --- a/dist/components/text-elements/Bold/Bold.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import t from"react";const a=t.forwardRef(((a,o)=>{const{children:s,className:l}=a,m=e(a,["children","className"]);return t.createElement("b",Object.assign({ref:o,className:r("text-inherit font-bold",l)},m),s)}));a.displayName="Bold";export{a as default}; diff --git a/dist/components/text-elements/Bold/index.d.ts b/dist/components/text-elements/Bold/index.d.ts deleted file mode 100644 index 3ad208e46..000000000 --- a/dist/components/text-elements/Bold/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Bold } from "./Bold"; diff --git a/dist/components/text-elements/Callout/Callout.cjs b/dist/components/text-elements/Callout/Callout.cjs deleted file mode 100644 index 38c4af015..000000000 --- a/dist/components/text-elements/Callout/Callout.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("react"),t=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(r);const d=o.makeClassName("Callout"),m=s.default.forwardRef(((r,l)=>{const{title:m,icon:c,color:i,className:n,children:u}=r,b=e.__rest(r,["title","icon","color","className","children"]),f=c;return s.default.createElement("div",Object.assign({ref:l,className:a.tremorTwMerge(d("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?a.tremorTwMerge(o.getColorClassNames(i,t.colorPalette.background).bgColor,o.getColorClassNames(i,t.colorPalette.darkBorder).borderColor,o.getColorClassNames(i,t.colorPalette.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):a.tremorTwMerge("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),n)},b),s.default.createElement("div",{className:a.tremorTwMerge(d("header"),"flex items-start")},f?s.default.createElement(f,{className:a.tremorTwMerge(d("icon"),"flex-none h-5 w-5 mr-1.5")}):null,s.default.createElement("h4",{className:a.tremorTwMerge(d("title"),"font-semibold")},m)),s.default.createElement("p",{className:a.tremorTwMerge(d("body"),"overflow-y-auto",u?"mt-2":"")},u))}));m.displayName="Callout",module.exports=m; diff --git a/dist/components/text-elements/Callout/Callout.d.ts b/dist/components/text-elements/Callout/Callout.d.ts deleted file mode 100644 index 2724d09ed..000000000 --- a/dist/components/text-elements/Callout/Callout.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -import { Color } from "lib"; -export interface CalloutProps extends React.HTMLAttributes { - title: string; - icon?: React.ElementType; - color?: Color; -} -declare const Callout: React.ForwardRefExoticComponent>; -export default Callout; diff --git a/dist/components/text-elements/Callout/Callout.js b/dist/components/text-elements/Callout/Callout.js deleted file mode 100644 index 5f0eb6402..000000000 --- a/dist/components/text-elements/Callout/Callout.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import r from"react";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as l}from"../../../lib/utils.js";const m=l("Callout"),d=r.forwardRef(((l,d)=>{const{title:s,icon:i,color:n,className:c,children:b}=l,f=e(l,["title","icon","color","className","children"]),p=i;return r.createElement("div",Object.assign({ref:d,className:o(m("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",n?o(a(n,t.background).bgColor,a(n,t.darkBorder).borderColor,a(n,t.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):o("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),c)},f),r.createElement("div",{className:o(m("header"),"flex items-start")},p?r.createElement(p,{className:o(m("icon"),"flex-none h-5 w-5 mr-1.5")}):null,r.createElement("h4",{className:o(m("title"),"font-semibold")},s)),r.createElement("p",{className:o(m("body"),"overflow-y-auto",b?"mt-2":"")},b))}));d.displayName="Callout";export{d as default}; diff --git a/dist/components/text-elements/Callout/index.d.ts b/dist/components/text-elements/Callout/index.d.ts deleted file mode 100644 index 8880eb860..000000000 --- a/dist/components/text-elements/Callout/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Callout } from "./Callout"; -export type { CalloutProps } from "./Callout"; diff --git a/dist/components/text-elements/Italic/Italic.cjs b/dist/components/text-elements/Italic/Italic.cjs deleted file mode 100644 index f79786bcb..000000000 --- a/dist/components/text-elements/Italic/Italic.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/tremorTwMerge.cjs");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(require("react"));const i=a.default.forwardRef(((t,i)=>{const{children:s,className:c}=t,l=e.__rest(t,["children","className"]);return a.default.createElement("i",Object.assign({ref:i,className:r.tremorTwMerge("italic text-inherit",c)},l),s)}));i.displayName="Italic",module.exports=i; diff --git a/dist/components/text-elements/Italic/Italic.d.ts b/dist/components/text-elements/Italic/Italic.d.ts deleted file mode 100644 index d28eec613..000000000 --- a/dist/components/text-elements/Italic/Italic.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import React from "react"; -declare const Italic: React.ForwardRefExoticComponent & React.RefAttributes>; -export default Italic; diff --git a/dist/components/text-elements/Italic/Italic.js b/dist/components/text-elements/Italic/Italic.js deleted file mode 100644 index 873e2353f..000000000 --- a/dist/components/text-elements/Italic/Italic.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import t from"react";const a=t.forwardRef(((a,i)=>{const{children:s,className:c}=a,l=e(a,["children","className"]);return t.createElement("i",Object.assign({ref:i,className:r("italic text-inherit",c)},l),s)}));a.displayName="Italic";export{a as default}; diff --git a/dist/components/text-elements/Italic/index.d.ts b/dist/components/text-elements/Italic/index.d.ts deleted file mode 100644 index 833e33144..000000000 --- a/dist/components/text-elements/Italic/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Italic } from "./Italic"; diff --git a/dist/components/text-elements/Legend/Legend.cjs b/dist/components/text-elements/Legend/Legend.cjs deleted file mode 100644 index 79ccd4a0b..000000000 --- a/dist/components/text-elements/Legend/Legend.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs"),n=require("../../../assets/ChevronLeftFill.cjs"),a=require("../../../assets/ChevronRightFill.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(t);const s=o.makeClassName("Legend"),i=({name:e,color:t,onClick:n,activeLegend:a})=>{const u=!!n;return c.default.createElement("li",{className:l.tremorTwMerge(s("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",u?"cursor-pointer":"cursor-default","text-tremor-content",u?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",u?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:r=>{r.stopPropagation(),null==n||n(e,t)}},c.default.createElement("svg",{className:l.tremorTwMerge("flex-none h-2 w-2 mr-1.5",o.getColorClassNames(t,r.colorPalette.text).textColor,a&&a!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},c.default.createElement("circle",{cx:4,cy:4,r:4})),c.default.createElement("p",{className:l.tremorTwMerge("whitespace-nowrap truncate text-tremor-default","text-tremor-content",u?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==e?"opacity-40":"opacity-100",u?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},d=({icon:e,onClick:r,disabled:o})=>{const n=e,[a,u]=c.default.useState(!1),i=c.default.useRef(null);return c.default.useEffect((()=>(a?i.current=setInterval((()=>{null==r||r()}),300):clearInterval(i.current),()=>clearInterval(i.current))),[a,r]),t.useEffect((()=>{o&&(clearInterval(i.current),u(!1))}),[o]),c.default.createElement("button",{type:"button",className:l.tremorTwMerge(s("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==r||r()},onMouseDown:e=>{e.stopPropagation(),u(!0)},onMouseUp:e=>{e.stopPropagation(),u(!1)}},c.default.createElement(n,{className:"w-full"}))},m=c.default.forwardRef(((o,u)=>{var m,f;const{categories:g,colors:v=r.themeColorRange,className:p,onClickLegendItem:k,activeLegend:b,enableLegendSlider:h=!1}=o,w=e.__rest(o,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=c.default.useRef(null),[E,L]=c.default.useState(null),[y,C]=c.default.useState(null),N=c.default.useRef(null),M=t.useCallback((()=>{const e=null==x?void 0:x.current;if(!e)return;const t=e.scrollLeft>0,r=e.scrollWidth-e.clientWidth>e.scrollLeft;L({left:t,right:r})}),[L]),T=t.useCallback((e=>{var t;const r=null==x?void 0:x.current,l=null!==(t=null==r?void 0:r.clientWidth)&&void 0!==t?t:0;r&&h&&(r.scrollTo({left:"left"===e?r.scrollLeft-l:r.scrollLeft+l,behavior:"smooth"}),setTimeout((()=>{M()}),400))}),[h,M]);c.default.useEffect((()=>{const e=e=>{"ArrowLeft"===e?T("left"):"ArrowRight"===e&&T("right")};return y?(e(y),N.current=setInterval((()=>{e(y)}),300)):clearInterval(N.current),()=>clearInterval(N.current)}),[y,T]);const I=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),C(e.key))},j=e=>{e.stopPropagation(),C(null)};return c.default.useEffect((()=>{const e=null==x?void 0:x.current;return h&&(M(),null==e||e.addEventListener("keydown",I),null==e||e.addEventListener("keyup",j)),()=>{null==e||e.removeEventListener("keydown",I),null==e||e.removeEventListener("keyup",j)}}),[M,h]),c.default.createElement("ol",Object.assign({ref:u,className:l.tremorTwMerge(s("root"),"relative overflow-hidden",p)},w),c.default.createElement("div",{ref:x,tabIndex:0,className:l.tremorTwMerge("h-full flex",h?(null==E?void 0:E.right)||(null==E?void 0:E.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},g.map(((e,t)=>c.default.createElement(i,{key:`item-${t}`,name:e,color:v[t],onClick:k,activeLegend:b})))),h&&((null==E?void 0:E.right)||(null==E?void 0:E.left))?c.default.createElement(c.default.Fragment,null,c.default.createElement("div",{className:l.tremorTwMerge("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),c.default.createElement("div",{className:l.tremorTwMerge("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),c.default.createElement("div",{className:l.tremorTwMerge("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},c.default.createElement(d,{icon:n,onClick:()=>{C(null),T("left")},disabled:null===(m=!(null==E?void 0:E.left))||void 0===m||m}),c.default.createElement(d,{icon:a,onClick:()=>{C(null),T("right")},disabled:null===(f=!(null==E?void 0:E.right))||void 0===f||f}))):null)}));m.displayName="Legend",module.exports=m; diff --git a/dist/components/text-elements/Legend/Legend.d.ts b/dist/components/text-elements/Legend/Legend.d.ts deleted file mode 100644 index ba90e50fc..000000000 --- a/dist/components/text-elements/Legend/Legend.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import { Color } from "lib"; -export interface LegendItemProps { - name: string; - color: Color | string; - onClick?: (name: string, color: Color | string) => void; - activeLegend?: string; -} -export interface ScrollButtonProps { - icon: React.ElementType; - onClick?: () => void; - disabled?: boolean; -} -export interface LegendProps extends React.OlHTMLAttributes { - categories: string[]; - colors?: (Color | string)[]; - onClickLegendItem?: (category: string, color: Color | string) => void; - activeLegend?: string; - enableLegendSlider?: boolean; -} -declare const Legend: React.ForwardRefExoticComponent>; -export default Legend; diff --git a/dist/components/text-elements/Legend/Legend.js b/dist/components/text-elements/Legend/Legend.js deleted file mode 100644 index 52999c0df..000000000 --- a/dist/components/text-elements/Legend/Legend.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t,{useCallback as r,useEffect as o}from"react";import{colorPalette as n,themeColorRange as l}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{makeClassName as c,getColorClassNames as s}from"../../../lib/utils.js";import i from"../../../assets/ChevronLeftFill.js";import u from"../../../assets/ChevronRightFill.js";const d=c("Legend"),m=({name:e,color:r,onClick:o,activeLegend:l})=>{const c=!!o;return t.createElement("li",{className:a(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:t=>{t.stopPropagation(),null==o||o(e,r)}},t.createElement("svg",{className:a("flex-none h-2 w-2 mr-1.5",s(r,n.text).textColor,l&&l!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},t.createElement("circle",{cx:4,cy:4,r:4})),t.createElement("p",{className:a("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",l&&l!==e?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},p=({icon:e,onClick:r,disabled:n})=>{const l=e,[c,s]=t.useState(!1),i=t.useRef(null);return t.useEffect((()=>(c?i.current=setInterval((()=>{null==r||r()}),300):clearInterval(i.current),()=>clearInterval(i.current))),[c,r]),o((()=>{n&&(clearInterval(i.current),s(!1))}),[n]),t.createElement("button",{type:"button",className:a(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",n?"cursor-not-allowed":"cursor-pointer",n?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",n?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:n,onClick:e=>{e.stopPropagation(),null==r||r()},onMouseDown:e=>{e.stopPropagation(),s(!0)},onMouseUp:e=>{e.stopPropagation(),s(!1)}},t.createElement(l,{className:"w-full"}))},g=t.forwardRef(((o,n)=>{var c,s;const{categories:g,colors:f=l,className:v,onClickLegendItem:k,activeLegend:b,enableLegendSlider:h=!1}=o,x=e(o,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),w=t.useRef(null),[E,L]=t.useState(null),[y,C]=t.useState(null),N=t.useRef(null),I=r((()=>{const e=null==w?void 0:w.current;if(!e)return;const t=e.scrollLeft>0,r=e.scrollWidth-e.clientWidth>e.scrollLeft;L({left:t,right:r})}),[L]),j=r((e=>{var t;const r=null==w?void 0:w.current,o=null!==(t=null==r?void 0:r.clientWidth)&&void 0!==t?t:0;r&&h&&(r.scrollTo({left:"left"===e?r.scrollLeft-o:r.scrollLeft+o,behavior:"smooth"}),setTimeout((()=>{I()}),400))}),[h,I]);t.useEffect((()=>{const e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return y?(e(y),N.current=setInterval((()=>{e(y)}),300)):clearInterval(N.current),()=>clearInterval(N.current)}),[y,j]);const R=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),C(e.key))},P=e=>{e.stopPropagation(),C(null)};return t.useEffect((()=>{const e=null==w?void 0:w.current;return h&&(I(),null==e||e.addEventListener("keydown",R),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",R),null==e||e.removeEventListener("keyup",P)}}),[I,h]),t.createElement("ol",Object.assign({ref:n,className:a(d("root"),"relative overflow-hidden",v)},x),t.createElement("div",{ref:w,tabIndex:0,className:a("h-full flex",h?(null==E?void 0:E.right)||(null==E?void 0:E.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},g.map(((e,r)=>t.createElement(m,{key:`item-${r}`,name:e,color:f[r],onClick:k,activeLegend:b})))),h&&((null==E?void 0:E.right)||(null==E?void 0:E.left))?t.createElement(t.Fragment,null,t.createElement("div",{className:a("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),t.createElement("div",{className:a("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),t.createElement("div",{className:a("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},t.createElement(p,{icon:i,onClick:()=>{C(null),j("left")},disabled:null===(c=!(null==E?void 0:E.left))||void 0===c||c}),t.createElement(p,{icon:u,onClick:()=>{C(null),j("right")},disabled:null===(s=!(null==E?void 0:E.right))||void 0===s||s}))):null)}));g.displayName="Legend";export{g as default}; diff --git a/dist/components/text-elements/Legend/index.d.ts b/dist/components/text-elements/Legend/index.d.ts deleted file mode 100644 index 3a8906ef1..000000000 --- a/dist/components/text-elements/Legend/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Legend } from "./Legend"; -export type { LegendProps } from "./Legend"; diff --git a/dist/components/text-elements/Metric/Metric.cjs b/dist/components/text-elements/Metric/Metric.cjs deleted file mode 100644 index 0714b5038..000000000 --- a/dist/components/text-elements/Metric/Metric.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("react"));const a=l.default.forwardRef(((s,a)=>{const{color:c,children:i,className:n}=s,m=e.__rest(s,["color","children","className"]);return l.default.createElement("p",Object.assign({ref:a,className:t.tremorTwMerge("font-semibold text-tremor-metric",c?o.getColorClassNames(c,r.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",n)},m),i)}));a.displayName="Metric",module.exports=a; diff --git a/dist/components/text-elements/Metric/Metric.d.ts b/dist/components/text-elements/Metric/Metric.d.ts deleted file mode 100644 index e5bc8beb3..000000000 --- a/dist/components/text-elements/Metric/Metric.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -export interface MetricProps extends React.HTMLAttributes { - color?: Color; -} -declare const Metric: React.ForwardRefExoticComponent>; -export default Metric; diff --git a/dist/components/text-elements/Metric/Metric.js b/dist/components/text-elements/Metric/Metric.js deleted file mode 100644 index e9abc3b45..000000000 --- a/dist/components/text-elements/Metric/Metric.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as r}from"tslib";import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,a)=>{const{color:i,children:l,className:c}=s,n=r(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:a,className:e("font-semibold text-tremor-metric",i?o(i,t.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},n),l)}));s.displayName="Metric";export{s as default}; diff --git a/dist/components/text-elements/Metric/index.d.ts b/dist/components/text-elements/Metric/index.d.ts deleted file mode 100644 index 8637311c2..000000000 --- a/dist/components/text-elements/Metric/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Metric } from "./Metric"; -export type { MetricProps } from "./Metric"; diff --git a/dist/components/text-elements/Subtitle/Subtitle.cjs b/dist/components/text-elements/Subtitle/Subtitle.cjs deleted file mode 100644 index fd0437570..000000000 --- a/dist/components/text-elements/Subtitle/Subtitle.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(require("react"));const o=a.default.forwardRef(((l,o)=>{const{color:c,children:i,className:u}=l,n=e.__rest(l,["color","children","className"]);return a.default.createElement("p",Object.assign({ref:o,className:t.tremorTwMerge(c?s.getColorClassNames(c,r.colorPalette.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",u)},n),i)}));o.displayName="Subtitle",module.exports=o; diff --git a/dist/components/text-elements/Subtitle/Subtitle.d.ts b/dist/components/text-elements/Subtitle/Subtitle.d.ts deleted file mode 100644 index aab8d06fa..000000000 --- a/dist/components/text-elements/Subtitle/Subtitle.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -export interface SubtitleProps extends React.HTMLAttributes { - color?: Color; -} -declare const Subtitle: React.ForwardRefExoticComponent>; -export default Subtitle; diff --git a/dist/components/text-elements/Subtitle/Subtitle.js b/dist/components/text-elements/Subtitle/Subtitle.js deleted file mode 100644 index d77ac5672..000000000 --- a/dist/components/text-elements/Subtitle/Subtitle.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import{colorPalette as e}from"../../../lib/theme.js";import{tremorTwMerge as r}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,a)=>{const{color:i,children:l,className:c}=s,n=t(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:a,className:r(i?o(i,e.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},n),l)}));s.displayName="Subtitle";export{s as default}; diff --git a/dist/components/text-elements/Subtitle/index.d.ts b/dist/components/text-elements/Subtitle/index.d.ts deleted file mode 100644 index f345945e8..000000000 --- a/dist/components/text-elements/Subtitle/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Subtitle } from "./Subtitle"; -export type { SubtitleProps } from "./Subtitle"; diff --git a/dist/components/text-elements/Text/Text.cjs b/dist/components/text-elements/Text/Text.cjs deleted file mode 100644 index 84e31d231..000000000 --- a/dist/components/text-elements/Text/Text.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),r=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(require("react"));const l=a.default.forwardRef(((o,l)=>{const{color:c,className:s,children:u}=o;return a.default.createElement("p",{ref:l,className:t.tremorTwMerge("text-tremor-default",c?r.getColorClassNames(c,e.colorPalette.text).textColor:t.tremorTwMerge("text-tremor-content","dark:text-dark-tremor-content"),s)},u)}));l.displayName="Text",module.exports=l; diff --git a/dist/components/text-elements/Text/Text.d.ts b/dist/components/text-elements/Text/Text.d.ts deleted file mode 100644 index 9499898aa..000000000 --- a/dist/components/text-elements/Text/Text.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib/inputTypes"; -export interface TextProps extends React.HTMLAttributes { - color?: Color; -} -declare const Text: React.ForwardRefExoticComponent>; -export default Text; diff --git a/dist/components/text-elements/Text/Text.js b/dist/components/text-elements/Text/Text.js deleted file mode 100644 index 8f81dab0b..000000000 --- a/dist/components/text-elements/Text/Text.js +++ /dev/null @@ -1 +0,0 @@ -import{colorPalette as t}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as r}from"../../../lib/utils.js";import o from"react";const m=o.forwardRef(((m,a)=>{const{color:l,className:s,children:c}=m;return o.createElement("p",{ref:a,className:e("text-tremor-default",l?r(l,t.text).textColor:e("text-tremor-content","dark:text-dark-tremor-content"),s)},c)}));m.displayName="Text";export{m as default}; diff --git a/dist/components/text-elements/Text/index.d.ts b/dist/components/text-elements/Text/index.d.ts deleted file mode 100644 index bd1f8e517..000000000 --- a/dist/components/text-elements/Text/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Text } from "./Text"; -export type { TextProps } from "./Text"; diff --git a/dist/components/text-elements/Title/Title.cjs b/dist/components/text-elements/Title/Title.cjs deleted file mode 100644 index b2fc7b56a..000000000 --- a/dist/components/text-elements/Title/Title.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("../../../lib/theme.cjs"),r=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(require("react"));const a=s.default.forwardRef(((l,a)=>{const{color:c,children:i,className:n}=l,u=e.__rest(l,["color","children","className"]);return s.default.createElement("p",Object.assign({ref:a,className:r.tremorTwMerge("font-medium text-tremor-title",c?o.getColorClassNames(c,t.colorPalette.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",n)},u),i)}));a.displayName="Title",module.exports=a; diff --git a/dist/components/text-elements/Title/Title.d.ts b/dist/components/text-elements/Title/Title.d.ts deleted file mode 100644 index 1dc669769..000000000 --- a/dist/components/text-elements/Title/Title.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -export interface TitleProps extends React.HTMLAttributes { - color?: Color; -} -declare const Title: React.ForwardRefExoticComponent>; -export default Title; diff --git a/dist/components/text-elements/Title/Title.js b/dist/components/text-elements/Title/Title.js deleted file mode 100644 index b21076e02..000000000 --- a/dist/components/text-elements/Title/Title.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as t}from"tslib";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as e}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as o}from"../../../lib/utils.js";import m from"react";const s=m.forwardRef(((s,l)=>{const{color:a,children:i,className:c}=s,n=t(s,["color","children","className"]);return m.createElement("p",Object.assign({ref:l,className:e("font-medium text-tremor-title",a?o(a,r.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},n),i)}));s.displayName="Title";export{s as default}; diff --git a/dist/components/text-elements/Title/index.d.ts b/dist/components/text-elements/Title/index.d.ts deleted file mode 100644 index b9308cc23..000000000 --- a/dist/components/text-elements/Title/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Title } from "./Title"; -export type { TitleProps } from "./Title"; diff --git a/dist/components/text-elements/index.d.ts b/dist/components/text-elements/index.d.ts deleted file mode 100644 index fdfc25228..000000000 --- a/dist/components/text-elements/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from "./Bold"; -export * from "./Callout"; -export * from "./Italic"; -export * from "./Legend"; -export * from "./Metric"; -export * from "./Subtitle"; -export * from "./Text"; -export * from "./Title"; diff --git a/dist/components/util-elements/Tooltip/Tooltip.cjs b/dist/components/util-elements/Tooltip/Tooltip.cjs deleted file mode 100644 index 5e072b5c8..000000000 --- a/dist/components/util-elements/Tooltip/Tooltip.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@floating-ui/react"),t=require("../../../lib/tremorTwMerge.cjs"),o=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(o);const a=({text:e,open:o,x:r,y:a,refs:i,strategy:l,getFloatingProps:n})=>o&&e?s.default.createElement("div",Object.assign({className:t.tremorTwMerge("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1 whitespace-nowrap","text-white bg-tremor-background-emphasis","text-white dark:bg-dark-tremor-background-subtle"),ref:i.setFloating,style:{position:l,top:null!=a?a:0,left:null!=r?r:0}},n()),e):null;a.displayName="Tooltip",exports.default=a,exports.useTooltip=t=>{const[r,s]=o.useState(!1),[a,i]=o.useState(),{x:l,y:n,refs:u,strategy:p,context:c}=e.useFloating({open:r,onOpenChange:e=>{if(e&&t){const o=setTimeout((()=>{s(e)}),t);i(o)}else clearTimeout(a),s(e)},placement:"top",whileElementsMounted:e.autoUpdate,middleware:[e.offset(5),e.flip({fallbackAxisSideDirection:"start"}),e.shift()]}),f=e.useHover(c,{move:!1}),g=e.useFocus(c),d=e.useDismiss(c),m=e.useRole(c,{role:"tooltip"}),{getReferenceProps:x,getFloatingProps:y}=e.useInteractions([f,g,d,m]);return{tooltipProps:{open:r,x:l,y:n,refs:u,strategy:p,getFloatingProps:y},getReferenceProps:x}}; diff --git a/dist/components/util-elements/Tooltip/Tooltip.d.ts b/dist/components/util-elements/Tooltip/Tooltip.d.ts deleted file mode 100644 index 520f1e676..000000000 --- a/dist/components/util-elements/Tooltip/Tooltip.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ExtendedRefs, ReferenceType, Strategy } from "@floating-ui/react"; -import React from "react"; -export declare const useTooltip: (delay?: number) => { - tooltipProps: { - open: boolean; - x: number | null; - y: number | null; - refs: ExtendedRefs; - strategy: Strategy; - getFloatingProps: (userProps?: React.HTMLProps | undefined) => Record; - }; - getReferenceProps: (userProps?: React.HTMLProps | undefined) => Record; -}; -export interface TooltipProps { - text?: string; - open: boolean; - x: number | null; - y: number | null; - refs: ExtendedRefs; - strategy: Strategy; - getFloatingProps: (userProps?: React.HTMLProps | undefined) => Record; -} -declare const Tooltip: { - ({ text, open, x, y, refs, strategy, getFloatingProps }: TooltipProps): React.JSX.Element | null; - displayName: string; -}; -export default Tooltip; diff --git a/dist/components/util-elements/Tooltip/Tooltip.js b/dist/components/util-elements/Tooltip/Tooltip.js deleted file mode 100644 index 66a0e2f3e..000000000 --- a/dist/components/util-elements/Tooltip/Tooltip.js +++ /dev/null @@ -1 +0,0 @@ -import{useFloating as e,autoUpdate as t,offset as o,flip as r,shift as s,useHover as a,useFocus as i,useDismiss as l,useRole as n,useInteractions as p}from"@floating-ui/react";import{tremorTwMerge as m}from"../../../lib/tremorTwMerge.js";import g,{useState as c}from"react";const f=m=>{const[g,f]=c(!1),[d,u]=c(),{x:x,y:y,refs:b,strategy:w,context:h}=e({open:g,onOpenChange:e=>{if(e&&m){const t=setTimeout((()=>{f(e)}),m);u(t)}else clearTimeout(d),f(e)},placement:"top",whileElementsMounted:t,middleware:[o(5),r({fallbackAxisSideDirection:"start"}),s()]}),P=a(h,{move:!1}),k=i(h),F=l(h),T=n(h,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:v}=p([P,k,F,T]);return{tooltipProps:{open:g,x:x,y:y,refs:b,strategy:w,getFloatingProps:v},getReferenceProps:j}},d=({text:e,open:t,x:o,y:r,refs:s,strategy:a,getFloatingProps:i})=>t&&e?g.createElement("div",Object.assign({className:m("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1 whitespace-nowrap","text-white bg-tremor-background-emphasis","text-white dark:bg-dark-tremor-background-subtle"),ref:s.setFloating,style:{position:a,top:null!=r?r:0,left:null!=o?o:0}},i()),e):null;d.displayName="Tooltip";export{d as default,f as useTooltip}; diff --git a/dist/components/util-elements/Tooltip/index.d.ts b/dist/components/util-elements/Tooltip/index.d.ts deleted file mode 100644 index 72248a58c..000000000 --- a/dist/components/util-elements/Tooltip/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Tooltip } from "./Tooltip"; -export type { TooltipProps } from "./Tooltip"; diff --git a/dist/components/util-elements/index.d.ts b/dist/components/util-elements/index.d.ts deleted file mode 100644 index 46bb2f247..000000000 --- a/dist/components/util-elements/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Tooltip"; diff --git a/dist/components/vis-elements/BarList/BarList.cjs b/dist/components/vis-elements/BarList/BarList.cjs deleted file mode 100644 index b9a7d8f4a..000000000 --- a/dist/components/vis-elements/BarList/BarList.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),t=require("react"),r=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);const m=l.makeClassName("BarList");function s(t,n){const{data:s=[],color:c,valueFormatter:i=l.defaultValueFormatter,showAnimation:u=!1,onValueChange:d,className:f}=t,b=e.__rest(t,["data","color","valueFormatter","showAnimation","onValueChange","className"]),p=(e=>{let t=-1/0;return e.forEach((e=>{t=Math.max(t,e)})),e.map((e=>0===e?0:Math.max(e/t*100,1)))})(s.map((e=>e.value)));return o.default.createElement("div",Object.assign({ref:n,className:a.tremorTwMerge(m("root"),"flex justify-between space-x-6",f)},b),o.default.createElement("div",{className:a.tremorTwMerge(m("bars"),"relative w-full")},s.map(((e,t)=>{var n,i,f;const b=e.icon;return o.default.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:a.tremorTwMerge(m("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||c?l.getColorClassNames(null!==(i=e.color)&&void 0!==i?i:c,r.colorPalette.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===s.length-1?"mb-0":"mb-2"),style:{width:`${p[t]}%`,transition:u?"all 1s":""}},o.default.createElement("div",{className:a.tremorTwMerge("absolute max-w-full flex left-2",d?"cursor-pointer":""),onClick:()=>{null==d||d(e)}},b?o.default.createElement(b,{className:a.tremorTwMerge(m("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.default.createElement("a",{href:e.href,target:null!==(f=e.target)&&void 0!==f?f:"_blank",rel:"noreferrer",className:a.tremorTwMerge(m("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",d?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==d||d(e)}},e.name):o.default.createElement("p",{className:a.tremorTwMerge(m("barText"),"whitespace-nowrap truncate text-tremor-default",d?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==d||d(e)}},e.name)))}))),o.default.createElement("div",{className:"text-right min-w-min"},s.map(((e,t)=>{var r;return o.default.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:e.name,className:a.tremorTwMerge(m("labelWrapper"),"flex justify-end items-center","h-9",t===s.length-1?"mb-0":"mb-2")},o.default.createElement("p",{className:a.tremorTwMerge(m("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},i(e.value)))}))))}s.displayName="BarList";const c=o.default.forwardRef(s);module.exports=c; diff --git a/dist/components/vis-elements/BarList/BarList.d.ts b/dist/components/vis-elements/BarList/BarList.d.ts deleted file mode 100644 index fa5004301..000000000 --- a/dist/components/vis-elements/BarList/BarList.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import React from "react"; -import { Color, ValueFormatter } from "lib"; -type Bar = T & { - key?: string; - value: number; - name: string; - icon?: React.JSXElementConstructor; - href?: string; - target?: string; - color?: Color; -}; -export interface BarListProps extends React.HTMLAttributes { - data: Bar[]; - valueFormatter?: ValueFormatter; - color?: Color; - showAnimation?: boolean; - onValueChange?: (payload: Bar) => void; -} -declare function BarListInner(props: BarListProps, ref: React.ForwardedRef): React.JSX.Element; -declare namespace BarListInner { - var displayName: string; -} -declare const BarList: (p: BarListProps & { - ref?: React.ForwardedRef | undefined; -}) => ReturnType; -export default BarList; diff --git a/dist/components/vis-elements/BarList/BarList.js b/dist/components/vis-elements/BarList/BarList.js deleted file mode 100644 index 8a2d3186f..000000000 --- a/dist/components/vis-elements/BarList/BarList.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import t from"react";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as a}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as l,defaultValueFormatter as o}from"../../../lib/utils.js";const m=l("BarList");function s(l,s){const{data:c=[],color:i,valueFormatter:u=o,showAnimation:d=!1,onValueChange:p,className:b}=l,f=e(l,["data","color","valueFormatter","showAnimation","onValueChange","className"]),h=(e=>{let t=-1/0;return e.forEach((e=>{t=Math.max(t,e)})),e.map((e=>0===e?0:Math.max(e/t*100,1)))})(c.map((e=>e.value)));return t.createElement("div",Object.assign({ref:s,className:a(m("root"),"flex justify-between space-x-6",b)},f),t.createElement("div",{className:a(m("bars"),"relative w-full")},c.map(((e,l)=>{var o,s,u;const b=e.icon;return t.createElement("div",{key:null!==(o=e.key)&&void 0!==o?o:e.name,className:a(m("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||i?n(null!==(s=e.color)&&void 0!==s?s:i,r.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",l===c.length-1?"mb-0":"mb-2"),style:{width:`${h[l]}%`,transition:d?"all 1s":""}},t.createElement("div",{className:a("absolute max-w-full flex left-2",p?"cursor-pointer":""),onClick:()=>{null==p||p(e)}},b?t.createElement(b,{className:a(m("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?t.createElement("a",{href:e.href,target:null!==(u=e.target)&&void 0!==u?u:"_blank",rel:"noreferrer",className:a(m("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",p?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==p||p(e)}},e.name):t.createElement("p",{className:a(m("barText"),"whitespace-nowrap truncate text-tremor-default",p?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:()=>{null==p||p(e)}},e.name)))}))),t.createElement("div",{className:"text-right min-w-min"},c.map(((e,r)=>{var n;return t.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:a(m("labelWrapper"),"flex justify-end items-center","h-9",r===c.length-1?"mb-0":"mb-2")},t.createElement("p",{className:a(m("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))}))))}s.displayName="BarList";const c=t.forwardRef(s);export{c as default}; diff --git a/dist/components/vis-elements/BarList/index.d.ts b/dist/components/vis-elements/BarList/index.d.ts deleted file mode 100644 index ad0bc6366..000000000 --- a/dist/components/vis-elements/BarList/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as BarList } from "./BarList"; -export type { BarListProps } from "./BarList"; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.cjs b/dist/components/vis-elements/CategoryBar/CategoryBar.cjs deleted file mode 100644 index 03e46b86d..000000000 --- a/dist/components/vis-elements/CategoryBar/CategoryBar.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),t=require("react"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),l=require("../../../lib/theme.cjs"),a=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(t);const m=o.makeClassName("CategoryBar"),i=({values:e})=>{const t=o.sumNumericArray(e);let r=0,l=0;return n.default.createElement("div",{className:a.tremorTwMerge(m("labels"),"relative flex w-full text-tremor-default h-5 mb-2","text-tremor-content","dark:text-dark-tremor-content")},e.slice(0,e.length).map(((e,o)=>{r+=e;const s=(e>=.1*t||l>=.09*t)&&t-r>=.15*t&&r>=.1*t;return l=s?0:l+=e,n.default.createElement("div",{key:`item-${o}`,className:"flex items-center justify-end",style:{width:`${e}%`}},n.default.createElement("span",{className:a.tremorTwMerge(s?"block":"hidden","left-1/2 translate-x-1/2")},r))})),n.default.createElement("div",{className:a.tremorTwMerge("absolute bottom-0 flex items-center left-0")},"0"),n.default.createElement("div",{className:a.tremorTwMerge("absolute bottom-0 flex items-center right-0")},t))},u=n.default.forwardRef(((t,s)=>{const{values:u=[],colors:c=l.themeColorRange,markerValue:d,showLabels:f=!0,tooltip:g,showAnimation:b=!1,className:v}=t,w=e.__rest(t,["values","colors","markerValue","showLabels","tooltip","showAnimation","className"]),h=((e,t,r)=>{if(void 0===e)return"";let a=0;for(let s=0;s=e)return m}return""})(d,u,c),{tooltipProps:p,getReferenceProps:N}=r.useTooltip();return n.default.createElement(n.default.Fragment,null,n.default.createElement(r.default,Object.assign({text:g},p)),n.default.createElement("div",Object.assign({ref:s,className:a.tremorTwMerge(m("root"),v)},w),f?n.default.createElement(i,{values:u}):null,n.default.createElement("div",{className:a.tremorTwMerge(m("barWrapper"),"relative w-full flex items-center h-2")},n.default.createElement("div",{className:a.tremorTwMerge("flex-1 flex items-center h-full overflow-hidden rounded-tremor-full")},u.map(((e,t)=>{var r;const s=null!==(r=c[t])&&void 0!==r?r:"gray";return n.default.createElement("div",{key:`item-${t}`,className:a.tremorTwMerge(m("categoryBar"),"h-full",o.getColorClassNames(s,l.colorPalette.background).bgColor),style:{width:`${e}%`}})}))),void 0!==d?n.default.createElement("div",Object.assign({ref:p.refs.setReference,className:a.tremorTwMerge(m("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${d}%`,transition:b?"all 1s":""}},N),n.default.createElement("div",{className:a.tremorTwMerge(m("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",h)})):null)))}));u.displayName="CategoryBar",module.exports=u; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts b/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts deleted file mode 100644 index ebd4c3d1e..000000000 --- a/dist/components/vis-elements/CategoryBar/CategoryBar.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -export interface CategoryBarProps extends React.HTMLAttributes { - values: number[]; - colors?: Color[]; - markerValue?: number; - showLabels?: boolean; - tooltip?: string; - showAnimation?: boolean; -} -declare const CategoryBar: React.ForwardRefExoticComponent>; -export default CategoryBar; diff --git a/dist/components/vis-elements/CategoryBar/CategoryBar.js b/dist/components/vis-elements/CategoryBar/CategoryBar.js deleted file mode 100644 index d28107f48..000000000 --- a/dist/components/vis-elements/CategoryBar/CategoryBar.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import t from"react";import r,{useTooltip as l}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as a,themeColorRange as s}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as m,sumNumericArray as i}from"../../../lib/utils.js";const c=m("CategoryBar"),d=({values:e})=>{const r=i(e);let l=0,a=0;return t.createElement("div",{className:o(c("labels"),"relative flex w-full text-tremor-default h-5 mb-2","text-tremor-content","dark:text-dark-tremor-content")},e.slice(0,e.length).map(((e,s)=>{l+=e;const n=(e>=.1*r||a>=.09*r)&&r-l>=.15*r&&l>=.1*r;return a=n?0:a+=e,t.createElement("div",{key:`item-${s}`,className:"flex items-center justify-end",style:{width:`${e}%`}},t.createElement("span",{className:o(n?"block":"hidden","left-1/2 translate-x-1/2")},l))})),t.createElement("div",{className:o("absolute bottom-0 flex items-center left-0")},"0"),t.createElement("div",{className:o("absolute bottom-0 flex items-center right-0")},r))},f=t.forwardRef(((m,i)=>{const{values:f=[],colors:u=s,markerValue:b,showLabels:v=!0,tooltip:p,showAnimation:g=!1,className:h}=m,x=e(m,["values","colors","markerValue","showLabels","tooltip","showAnimation","className"]),E=((e,t,r)=>{if(void 0===e)return"";let l=0;for(let s=0;s=e)return m}return""})(b,f,u),{tooltipProps:N,getReferenceProps:k}=l();return t.createElement(t.Fragment,null,t.createElement(r,Object.assign({text:p},N)),t.createElement("div",Object.assign({ref:i,className:o(c("root"),h)},x),v?t.createElement(d,{values:f}):null,t.createElement("div",{className:o(c("barWrapper"),"relative w-full flex items-center h-2")},t.createElement("div",{className:o("flex-1 flex items-center h-full overflow-hidden rounded-tremor-full")},f.map(((e,r)=>{var l;const s=null!==(l=u[r])&&void 0!==l?l:"gray";return t.createElement("div",{key:`item-${r}`,className:o(c("categoryBar"),"h-full",n(s,a.background).bgColor),style:{width:`${e}%`}})}))),void 0!==b?t.createElement("div",Object.assign({ref:N.refs.setReference,className:o(c("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${b}%`,transition:g?"all 1s":""}},k),t.createElement("div",{className:o(c("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",E)})):null)))}));f.displayName="CategoryBar";export{f as default}; diff --git a/dist/components/vis-elements/CategoryBar/index.d.ts b/dist/components/vis-elements/CategoryBar/index.d.ts deleted file mode 100644 index fcfb2a7a7..000000000 --- a/dist/components/vis-elements/CategoryBar/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as CategoryBar } from "./CategoryBar"; -export type { CategoryBarProps } from "./CategoryBar"; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.cjs b/dist/components/vis-elements/DeltaBar/DeltaBar.cjs deleted file mode 100644 index 854583d3f..000000000 --- a/dist/components/vis-elements/DeltaBar/DeltaBar.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/constants.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),s=require("../../../lib/utils.cjs"),o=require("./styles.cjs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=i(r);const u=s.makeClassName("DeltaBar"),d=n.default.forwardRef(((r,i)=>{const{value:d,isIncreasePositive:c=!0,showAnimation:m=!1,className:f,tooltip:g}=r,b=e.__rest(r,["value","isIncreasePositive","showAnimation","className","tooltip"]),p=s.mapInputsToDeltaType((e=>e>=0?a.DeltaTypes.Increase:a.DeltaTypes.Decrease)(d),c),{tooltipProps:v,getReferenceProps:w}=t.useTooltip();return n.default.createElement(n.default.Fragment,null,n.default.createElement(t.default,Object.assign({text:g},v)),n.default.createElement("div",Object.assign({ref:i,className:l.tremorTwMerge(u("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",f)},b),n.default.createElement("div",{className:"flex justify-end h-full w-1/2"},d<0?n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(u("negativeDeltaBar"),"rounded-l-tremor-full",o.colors[p].bgColor),style:{width:`${Math.abs(d)}%`,transition:m?"all 1s":""}},w)):null),n.default.createElement("div",{className:l.tremorTwMerge(u("separator"),"ring-2 z-10 rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted bg-tremor-background-emphasis","dark:ring-dark-tremor-brand-inverted dark:bg-dark-tremor-background-emphasis")}),n.default.createElement("div",{className:l.tremorTwMerge(u("positiveDeltaBarWrapper"),"flex justify-start h-full w-1/2")},d>=0?n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(u("positiveDeltaBar"),"rounded-r-tremor-full",o.colors[p].bgColor),style:{width:`${Math.abs(d)}%`,transition:m?"all 1s":""}},w)):null)))}));d.displayName="DeltaBar",module.exports=d; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts b/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts deleted file mode 100644 index 0d8c8b457..000000000 --- a/dist/components/vis-elements/DeltaBar/DeltaBar.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import React from "react"; -export interface DeltaBarProps extends React.HTMLAttributes { - value: number; - isIncreasePositive?: boolean; - tooltip?: string; - showAnimation?: boolean; -} -declare const DeltaBar: React.ForwardRefExoticComponent>; -export default DeltaBar; diff --git a/dist/components/vis-elements/DeltaBar/DeltaBar.js b/dist/components/vis-elements/DeltaBar/DeltaBar.js deleted file mode 100644 index 999e824df..000000000 --- a/dist/components/vis-elements/DeltaBar/DeltaBar.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{DeltaTypes as s}from"../../../lib/constants.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{makeClassName as o,mapInputsToDeltaType as i}from"../../../lib/utils.js";import{colors as n}from"./styles.js";const m=o("DeltaBar"),c=r.forwardRef(((o,c)=>{const{value:d,isIncreasePositive:f=!0,showAnimation:u=!1,className:b,tooltip:p}=o,g=e(o,["value","isIncreasePositive","showAnimation","className","tooltip"]),v=i((e=>e>=0?s.Increase:s.Decrease)(d),f),{tooltipProps:h,getReferenceProps:j}=a();return r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:p},h)),r.createElement("div",Object.assign({ref:c,className:l(m("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",b)},g),r.createElement("div",{className:"flex justify-end h-full w-1/2"},d<0?r.createElement("div",Object.assign({ref:h.refs.setReference,className:l(m("negativeDeltaBar"),"rounded-l-tremor-full",n[v].bgColor),style:{width:`${Math.abs(d)}%`,transition:u?"all 1s":""}},j)):null),r.createElement("div",{className:l(m("separator"),"ring-2 z-10 rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted bg-tremor-background-emphasis","dark:ring-dark-tremor-brand-inverted dark:bg-dark-tremor-background-emphasis")}),r.createElement("div",{className:l(m("positiveDeltaBarWrapper"),"flex justify-start h-full w-1/2")},d>=0?r.createElement("div",Object.assign({ref:h.refs.setReference,className:l(m("positiveDeltaBar"),"rounded-r-tremor-full",n[v].bgColor),style:{width:`${Math.abs(d)}%`,transition:u?"all 1s":""}},j)):null)))}));c.displayName="DeltaBar";export{c as default}; diff --git a/dist/components/vis-elements/DeltaBar/index.d.ts b/dist/components/vis-elements/DeltaBar/index.d.ts deleted file mode 100644 index be676dfaa..000000000 --- a/dist/components/vis-elements/DeltaBar/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as DeltaBar } from "./DeltaBar"; -export type { DeltaBarProps } from "./DeltaBar"; diff --git a/dist/components/vis-elements/DeltaBar/styles.cjs b/dist/components/vis-elements/DeltaBar/styles.cjs deleted file mode 100644 index 9f9b76917..000000000 --- a/dist/components/vis-elements/DeltaBar/styles.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../lib/constants.cjs"),o=require("../../../lib/theme.cjs");require("../../../lib/tremorTwMerge.cjs");var r=require("../../../lib/utils.cjs");const l={[e.DeltaTypes.Increase]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor},[e.DeltaTypes.ModerateIncrease]:{bgColor:r.getColorClassNames(e.BaseColors.Emerald,o.colorPalette.background).bgColor},[e.DeltaTypes.Decrease]:{bgColor:r.getColorClassNames(e.BaseColors.Rose,o.colorPalette.background).bgColor},[e.DeltaTypes.ModerateDecrease]:{bgColor:r.getColorClassNames(e.BaseColors.Rose,o.colorPalette.background).bgColor},[e.DeltaTypes.Unchanged]:{bgColor:r.getColorClassNames(e.BaseColors.Orange,o.colorPalette.background).bgColor}};exports.colors=l; diff --git a/dist/components/vis-elements/DeltaBar/styles.d.ts b/dist/components/vis-elements/DeltaBar/styles.d.ts deleted file mode 100644 index 181eb3a7c..000000000 --- a/dist/components/vis-elements/DeltaBar/styles.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type ColorTypes = { - bgColor: string; -}; -export declare const colors: { - [key: string]: ColorTypes; -}; diff --git a/dist/components/vis-elements/DeltaBar/styles.js b/dist/components/vis-elements/DeltaBar/styles.js deleted file mode 100644 index 769be43fa..000000000 --- a/dist/components/vis-elements/DeltaBar/styles.js +++ /dev/null @@ -1 +0,0 @@ -import{DeltaTypes as o,BaseColors as r}from"../../../lib/constants.js";import{colorPalette as e}from"../../../lib/theme.js";import"../../../lib/tremorTwMerge.js";import{getColorClassNames as b}from"../../../lib/utils.js";const g={[o.Increase]:{bgColor:b(r.Emerald,e.background).bgColor},[o.ModerateIncrease]:{bgColor:b(r.Emerald,e.background).bgColor},[o.Decrease]:{bgColor:b(r.Rose,e.background).bgColor},[o.ModerateDecrease]:{bgColor:b(r.Rose,e.background).bgColor},[o.Unchanged]:{bgColor:b(r.Orange,e.background).bgColor}};export{g as colors}; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.cjs b/dist/components/vis-elements/MarkerBar/MarkerBar.cjs deleted file mode 100644 index 0352b6810..000000000 --- a/dist/components/vis-elements/MarkerBar/MarkerBar.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(r);const i=o.makeClassName("MarkerBar"),u=n.default.forwardRef(((r,s)=>{const{value:u,minValue:m,maxValue:d,markerTooltip:c,rangeTooltip:f,showAnimation:g=!1,color:b,className:p}=r,k=e.__rest(r,["value","minValue","maxValue","markerTooltip","rangeTooltip","showAnimation","color","className"]),{tooltipProps:v,getReferenceProps:T}=t.useTooltip(),{tooltipProps:w,getReferenceProps:j}=t.useTooltip();return n.default.createElement("div",Object.assign({ref:s,className:l.tremorTwMerge(i("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",p)},k),void 0!==m&&void 0!==d?n.default.createElement(n.default.Fragment,null,n.default.createElement(t.default,Object.assign({text:f},w)),n.default.createElement("div",Object.assign({ref:w.refs.setReference,className:l.tremorTwMerge(i("rangeBar"),"absolute h-full rounded-tremor-full","bg-tremor-content-subtle","dark:bg-dark-tremor-content-subtle"),style:{left:`${m}%`,width:d-m+"%",transition:g?"all 1s":""}},j))):null,n.default.createElement(t.default,Object.assign({text:c},v)),n.default.createElement("div",Object.assign({ref:v.refs.setReference,className:l.tremorTwMerge(i("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${u}%`,transition:g?"all 1s":""}},T),n.default.createElement("div",{className:l.tremorTwMerge(i("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",b?o.getColorClassNames(b,a.colorPalette.background).bgColor:"dark:bg-dark-tremor-brand bg-tremor-brand")})))}));u.displayName="MarkerBar",module.exports=u; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts b/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts deleted file mode 100644 index 4fcd91332..000000000 --- a/dist/components/vis-elements/MarkerBar/MarkerBar.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib"; -export interface MarkerBarProps extends React.HTMLAttributes { - value: number; - minValue?: number; - maxValue?: number; - markerTooltip?: string; - rangeTooltip?: string; - showAnimation?: boolean; - color?: Color; -} -declare const MarkerBar: React.ForwardRefExoticComponent>; -export default MarkerBar; diff --git a/dist/components/vis-elements/MarkerBar/MarkerBar.js b/dist/components/vis-elements/MarkerBar/MarkerBar.js deleted file mode 100644 index 6cd0bf397..000000000 --- a/dist/components/vis-elements/MarkerBar/MarkerBar.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as l}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as n,makeClassName as s}from"../../../lib/utils.js";const m=s("MarkerBar"),i=r.forwardRef(((s,i)=>{const{value:c,minValue:d,maxValue:u,markerTooltip:b,rangeTooltip:f,showAnimation:g=!1,color:p,className:k}=s,v=e(s,["value","minValue","maxValue","markerTooltip","rangeTooltip","showAnimation","color","className"]),{tooltipProps:j,getReferenceProps:h}=a(),{tooltipProps:w,getReferenceProps:x}=a();return r.createElement("div",Object.assign({ref:i,className:l(m("root"),"relative flex items-center w-full rounded-tremor-full h-2","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle",k)},v),void 0!==d&&void 0!==u?r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:f},w)),r.createElement("div",Object.assign({ref:w.refs.setReference,className:l(m("rangeBar"),"absolute h-full rounded-tremor-full","bg-tremor-content-subtle","dark:bg-dark-tremor-content-subtle"),style:{left:`${d}%`,width:u-d+"%",transition:g?"all 1s":""}},x))):null,r.createElement(t,Object.assign({text:b},j)),r.createElement("div",Object.assign({ref:j.refs.setReference,className:l(m("markerWrapper"),"absolute right-1/2 -translate-x-1/2 w-5"),style:{left:`${c}%`,transition:g?"all 1s":""}},h),r.createElement("div",{className:l(m("marker"),"ring-2 mx-auto rounded-tremor-full h-4 w-1","ring-tremor-brand-inverted","dark:ring-dark-tremor-brand-inverted",p?n(p,o.background).bgColor:"dark:bg-dark-tremor-brand bg-tremor-brand")})))}));i.displayName="MarkerBar";export{i as default}; diff --git a/dist/components/vis-elements/MarkerBar/index.d.ts b/dist/components/vis-elements/MarkerBar/index.d.ts deleted file mode 100644 index f74b2f487..000000000 --- a/dist/components/vis-elements/MarkerBar/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as MarkerBar } from "./MarkerBar"; -export type { MarkerBarProps } from "./MarkerBar"; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.cjs b/dist/components/vis-elements/ProgressBar/ProgressBar.cjs deleted file mode 100644 index eb8f2533c..000000000 --- a/dist/components/vis-elements/ProgressBar/ProgressBar.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";var e=require("tslib"),r=require("react"),t=require("../../util-elements/Tooltip/Tooltip.cjs"),a=require("../../../lib/theme.cjs"),l=require("../../../lib/tremorTwMerge.cjs"),o=require("../../../lib/utils.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=s(r);const n=o.makeClassName("ProgressBar"),i=m.default.forwardRef(((r,s)=>{const{value:i,label:c,color:u,tooltip:d,showAnimation:f=!1,className:g}=r,b=e.__rest(r,["value","label","color","tooltip","showAnimation","className"]),{tooltipProps:p,getReferenceProps:w}=t.useTooltip();return m.default.createElement(m.default.Fragment,null,m.default.createElement(t.default,Object.assign({text:d},p)),m.default.createElement("div",Object.assign({ref:s,className:l.tremorTwMerge(n("root"),"flex items-center w-full",g)},b),m.default.createElement("div",Object.assign({ref:p.refs.setReference,className:l.tremorTwMerge(n("progressBarWrapper"),"relative flex items-center w-full rounded-tremor-full bg-opacity-20 h-2",u?o.getColorClassNames(u,a.colorPalette.background).bgColor:"bg-tremor-brand-muted/50 dark:bg-dark-tremor-brand-muted")},w),m.default.createElement("div",{className:l.tremorTwMerge(n("progressBar"),"flex-col h-full rounded-tremor-full",u?o.getColorClassNames(u,a.colorPalette.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand"),style:{width:`${i}%`,transition:f?"all 1s":""}})),c?m.default.createElement("div",{className:l.tremorTwMerge(n("labelWrapper"),"w-16 truncate text-right ml-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},m.default.createElement("p",{className:l.tremorTwMerge(n("label"),"shrink-0 whitespace-nowrap truncate text-tremor-default")},c)):null))}));i.displayName="ProgressBar",module.exports=i; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts b/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts deleted file mode 100644 index b0bbe8f29..000000000 --- a/dist/components/vis-elements/ProgressBar/ProgressBar.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib/inputTypes"; -export interface ProgressBarProps extends React.HTMLAttributes { - value: number; - label?: string; - tooltip?: string; - showAnimation?: boolean; - color?: Color; -} -declare const ProgressBar: React.ForwardRefExoticComponent>; -export default ProgressBar; diff --git a/dist/components/vis-elements/ProgressBar/ProgressBar.js b/dist/components/vis-elements/ProgressBar/ProgressBar.js deleted file mode 100644 index 5ab3f7b30..000000000 --- a/dist/components/vis-elements/ProgressBar/ProgressBar.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import r from"react";import t,{useTooltip as a}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as l}from"../../../lib/theme.js";import{tremorTwMerge as o}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as s,makeClassName as m}from"../../../lib/utils.js";const n=m("ProgressBar"),i=r.forwardRef(((m,i)=>{const{value:c,label:d,color:p,tooltip:b,showAnimation:f=!1,className:u}=m,g=e(m,["value","label","color","tooltip","showAnimation","className"]),{tooltipProps:h,getReferenceProps:w}=a();return r.createElement(r.Fragment,null,r.createElement(t,Object.assign({text:b},h)),r.createElement("div",Object.assign({ref:i,className:o(n("root"),"flex items-center w-full",u)},g),r.createElement("div",Object.assign({ref:h.refs.setReference,className:o(n("progressBarWrapper"),"relative flex items-center w-full rounded-tremor-full bg-opacity-20 h-2",p?s(p,l.background).bgColor:"bg-tremor-brand-muted/50 dark:bg-dark-tremor-brand-muted")},w),r.createElement("div",{className:o(n("progressBar"),"flex-col h-full rounded-tremor-full",p?s(p,l.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand"),style:{width:`${c}%`,transition:f?"all 1s":""}})),d?r.createElement("div",{className:o(n("labelWrapper"),"w-16 truncate text-right ml-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},r.createElement("p",{className:o(n("label"),"shrink-0 whitespace-nowrap truncate text-tremor-default")},d)):null))}));i.displayName="ProgressBar";export{i as default}; diff --git a/dist/components/vis-elements/ProgressBar/index.d.ts b/dist/components/vis-elements/ProgressBar/index.d.ts deleted file mode 100644 index 96162c4a3..000000000 --- a/dist/components/vis-elements/ProgressBar/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ProgressBar } from "./ProgressBar"; -export type { ProgressBarProps } from "./ProgressBar"; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs b/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs deleted file mode 100644 index 7dec3e228..000000000 --- a/dist/components/vis-elements/ProgressCircle/ProgressCircle.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("tslib"),r=require("../../util-elements/Tooltip/Tooltip.cjs"),t=require("../../../lib/theme.cjs"),s=require("../../../lib/tremorTwMerge.cjs"),a=require("../../../lib/utils.cjs");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("react"));const i=a.makeClassName("ProgressBar"),n={xs:{radius:15,strokeWidth:3},sm:{radius:19,strokeWidth:4},md:{radius:32,strokeWidth:6},lg:{radius:52,strokeWidth:8},xl:{radius:80,strokeWidth:10}};const c=l.default.forwardRef(((o,c)=>{const{value:d,size:u="md",className:m,showAnimation:f=!0,color:k,tooltip:h,radius:g,strokeWidth:p,children:b}=o,N=e.__rest(o,["value","size","className","showAnimation","color","tooltip","radius","strokeWidth","children"]),v=void 0===(w=d)?0:w>100?100:w;var w;const x=null!=g?g:n[u].radius,W=null!=p?p:n[u].strokeWidth,j=x-W/2,y=2*j*Math.PI,C=y-v/100*y,{tooltipProps:T,getReferenceProps:E}=r.useTooltip();return l.default.createElement(l.default.Fragment,null,l.default.createElement(r.default,Object.assign({text:h},T)),l.default.createElement("div",Object.assign({ref:c,className:s.tremorTwMerge(i("root"),"flex flex-col items-center justify-center",m)},N),l.default.createElement("svg",Object.assign({ref:T.refs.setReference,width:2*x,height:2*x,viewBox:`0 0 ${2*x} ${2*x}`,className:"transform -rotate-90"},E),l.default.createElement("circle",{r:j,cx:x,cy:x,strokeWidth:W,fill:"transparent",stroke:"",strokeLinecap:"round",className:s.tremorTwMerge("transition-colors ease-linear",k?`${a.getColorClassNames(k,t.colorPalette.background).strokeColor} opacity-20 dark:opacity-25`:"stroke-tremor-brand-muted/50 dark:stroke-dark-tremor-brand-muted")}),v>=0?l.default.createElement("circle",{r:j,cx:x,cy:x,strokeWidth:W,strokeDasharray:y+" "+y,strokeDashoffset:C,fill:"transparent",stroke:"",strokeLinecap:"round",className:s.tremorTwMerge("transition-colors ease-linear",k?a.getColorClassNames(k,t.colorPalette.background).strokeColor:"stroke-tremor-brand dark:stroke-dark-tremor-brand",f?"transition-all duration-300 ease-in-out":"")}):null),l.default.createElement("div",{className:s.tremorTwMerge("absolute flex")},b)))}));c.displayName="ProgressCircle",module.exports=c; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts b/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts deleted file mode 100644 index 3fd551a36..000000000 --- a/dist/components/vis-elements/ProgressCircle/ProgressCircle.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Color } from "lib"; -import React from "react"; -export type Size = "xs" | "sm" | "md" | "lg" | "xl"; -export interface ProgressCircleProps extends React.HTMLAttributes { - value?: number; - size?: Size; - color?: Color; - showAnimation?: boolean; - tooltip?: string; - radius?: number; - strokeWidth?: number; - children?: React.ReactNode; -} -declare const ProgressCircle: React.ForwardRefExoticComponent>; -export default ProgressCircle; diff --git a/dist/components/vis-elements/ProgressCircle/ProgressCircle.js b/dist/components/vis-elements/ProgressCircle/ProgressCircle.js deleted file mode 100644 index 7cd0e907e..000000000 --- a/dist/components/vis-elements/ProgressCircle/ProgressCircle.js +++ /dev/null @@ -1 +0,0 @@ -import{__rest as e}from"tslib";import r,{useTooltip as t}from"../../util-elements/Tooltip/Tooltip.js";import{colorPalette as o}from"../../../lib/theme.js";import{tremorTwMerge as s}from"../../../lib/tremorTwMerge.js";import{getColorClassNames as a,makeClassName as i}from"../../../lib/utils.js";import l from"react";const n=i("ProgressBar"),c={xs:{radius:15,strokeWidth:3},sm:{radius:19,strokeWidth:4},md:{radius:32,strokeWidth:6},lg:{radius:52,strokeWidth:8},xl:{radius:80,strokeWidth:10}};const d=l.forwardRef(((i,d)=>{const{value:m,size:k="md",className:u,showAnimation:f=!0,color:h,tooltip:p,radius:b,strokeWidth:g,children:x}=i,W=e(i,["value","size","className","showAnimation","color","tooltip","radius","strokeWidth","children"]),j=void 0===(v=m)?0:v>100?100:v;var v;const N=null!=b?b:c[k].radius,y=null!=g?g:c[k].strokeWidth,E=N-y/2,w=2*E*Math.PI,P=w-j/100*w,{tooltipProps:C,getReferenceProps:O}=t();return l.createElement(l.Fragment,null,l.createElement(r,Object.assign({text:p},C)),l.createElement("div",Object.assign({ref:d,className:s(n("root"),"flex flex-col items-center justify-center",u)},W),l.createElement("svg",Object.assign({ref:C.refs.setReference,width:2*N,height:2*N,viewBox:`0 0 ${2*N} ${2*N}`,className:"transform -rotate-90"},O),l.createElement("circle",{r:E,cx:N,cy:N,strokeWidth:y,fill:"transparent",stroke:"",strokeLinecap:"round",className:s("transition-colors ease-linear",h?`${a(h,o.background).strokeColor} opacity-20 dark:opacity-25`:"stroke-tremor-brand-muted/50 dark:stroke-dark-tremor-brand-muted")}),j>=0?l.createElement("circle",{r:E,cx:N,cy:N,strokeWidth:y,strokeDasharray:w+" "+w,strokeDashoffset:P,fill:"transparent",stroke:"",strokeLinecap:"round",className:s("transition-colors ease-linear",h?a(h,o.background).strokeColor:"stroke-tremor-brand dark:stroke-dark-tremor-brand",f?"transition-all duration-300 ease-in-out":"")}):null),l.createElement("div",{className:s("absolute flex")},x)))}));d.displayName="ProgressCircle";export{d as default}; diff --git a/dist/components/vis-elements/ProgressCircle/index.d.ts b/dist/components/vis-elements/ProgressCircle/index.d.ts deleted file mode 100644 index 5f5fd0e44..000000000 --- a/dist/components/vis-elements/ProgressCircle/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ProgressCircle } from "./ProgressCircle"; -export type { ProgressCircleProps } from "./ProgressCircle"; diff --git a/dist/components/vis-elements/Tracker/Tracker.cjs b/dist/components/vis-elements/Tracker/Tracker.cjs deleted file mode 100644 index 95c6f33c3..000000000 --- a/dist/components/vis-elements/Tracker/Tracker.cjs +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("../../../lib/theme.cjs"),t=require("../../../lib/tremorTwMerge.cjs"),l=require("../../../lib/utils.cjs"),a=require("react"),o=require("../../util-elements/Tooltip/Tooltip.cjs");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(a);const i=l.makeClassName("Tracker"),u=c.default.forwardRef(((a,s)=>{const{color:u,tooltip:n}=a,d=e.__rest(a,["color","tooltip"]),{tooltipProps:f,getReferenceProps:m}=o.useTooltip();return c.default.createElement("div",Object.assign({ref:l.mergeRefs([s,f.refs.setReference]),className:t.tremorTwMerge(i("trackingBlock"),"w-full h-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",l.getColorClassNames(null!=u?u:"gray",r.colorPalette.background).bgColor)},d,m),c.default.createElement(o.default,Object.assign({text:n},f)))}));u.displayName="TrackerBlock";const n=c.default.forwardRef(((r,l)=>{const{data:a=[],className:o}=r,s=e.__rest(r,["data","className"]);return c.default.createElement("div",Object.assign({ref:l,className:t.tremorTwMerge(i("root"),"h-10 flex items-center space-x-0.5",o)},s),a.map(((e,r)=>{var t;return c.default.createElement(u,{key:null!==(t=e.key)&&void 0!==t?t:r,color:e.color,tooltip:e.tooltip})})))}));n.displayName="Tracker",exports.default=n,exports.makeTrackerClassName=i; diff --git a/dist/components/vis-elements/Tracker/Tracker.d.ts b/dist/components/vis-elements/Tracker/Tracker.d.ts deleted file mode 100644 index 6e9fd1003..000000000 --- a/dist/components/vis-elements/Tracker/Tracker.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react"; -import { Color } from "../../../lib/inputTypes"; -export declare const makeTrackerClassName: (className: string) => string; -export interface TrackerBlockProps { - key?: string | number; - color?: Color | string; - tooltip?: string; -} -export interface TrackerProps extends React.HTMLAttributes { - data: TrackerBlockProps[]; -} -declare const Tracker: React.ForwardRefExoticComponent>; -export default Tracker; diff --git a/dist/components/vis-elements/Tracker/Tracker.js b/dist/components/vis-elements/Tracker/Tracker.js deleted file mode 100644 index 4ce61a108..000000000 --- a/dist/components/vis-elements/Tracker/Tracker.js +++ /dev/null @@ -1,2 +0,0 @@ -'use client'; -import{__rest as e}from"tslib";import{colorPalette as r}from"../../../lib/theme.js";import{tremorTwMerge as t}from"../../../lib/tremorTwMerge.js";import{mergeRefs as o,getColorClassNames as l,makeClassName as a}from"../../../lib/utils.js";import s from"react";import c,{useTooltip as i}from"../../util-elements/Tooltip/Tooltip.js";const m=a("Tracker"),n=s.forwardRef(((a,n)=>{const{color:p,tooltip:f}=a,d=e(a,["color","tooltip"]),{tooltipProps:u,getReferenceProps:b}=i();return s.createElement("div",Object.assign({ref:o([n,u.refs.setReference]),className:t(m("trackingBlock"),"w-full h-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",l(null!=p?p:"gray",r.background).bgColor)},d,b),s.createElement(c,Object.assign({text:f},u)))}));n.displayName="TrackerBlock";const p=s.forwardRef(((r,o)=>{const{data:l=[],className:a}=r,c=e(r,["data","className"]);return s.createElement("div",Object.assign({ref:o,className:t(m("root"),"h-10 flex items-center space-x-0.5",a)},c),l.map(((e,r)=>{var t;return s.createElement(n,{key:null!==(t=e.key)&&void 0!==t?t:r,color:e.color,tooltip:e.tooltip})})))}));p.displayName="Tracker";export{p as default,m as makeTrackerClassName}; diff --git a/dist/components/vis-elements/Tracker/index.d.ts b/dist/components/vis-elements/Tracker/index.d.ts deleted file mode 100644 index 97ef3771f..000000000 --- a/dist/components/vis-elements/Tracker/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Tracker } from "./Tracker"; -export type { TrackerProps } from "./Tracker"; diff --git a/dist/components/vis-elements/index.d.ts b/dist/components/vis-elements/index.d.ts deleted file mode 100644 index 08a881ec5..000000000 --- a/dist/components/vis-elements/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./BarList"; -export * from "./CategoryBar"; -export * from "./DeltaBar"; -export * from "./MarkerBar"; -export * from "./ProgressBar"; -export * from "./ProgressCircle"; -export * from "./Tracker"; diff --git a/dist/contexts/BaseColorContext.cjs b/dist/contexts/BaseColorContext.cjs deleted file mode 100644 index 2b7c86aec..000000000 --- a/dist/contexts/BaseColorContext.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("react"),r=require("../lib/constants.cjs");require("../lib/tremorTwMerge.cjs");const t=e.createContext(r.BaseColors.Blue);module.exports=t; diff --git a/dist/contexts/BaseColorContext.d.ts b/dist/contexts/BaseColorContext.d.ts deleted file mode 100644 index 7797235b1..000000000 --- a/dist/contexts/BaseColorContext.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare const BaseColorContext: import("react").Context<"slate" | "gray" | "zinc" | "neutral" | "stone" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined>; -export default BaseColorContext; diff --git a/dist/contexts/BaseColorContext.js b/dist/contexts/BaseColorContext.js deleted file mode 100644 index c4a1dc800..000000000 --- a/dist/contexts/BaseColorContext.js +++ /dev/null @@ -1 +0,0 @@ -import{createContext as r}from"react";import{BaseColors as t}from"../lib/constants.js";import"../lib/tremorTwMerge.js";const o=r(t.Blue);export{o as default}; diff --git a/dist/contexts/IndexContext.cjs b/dist/contexts/IndexContext.cjs deleted file mode 100644 index 7792a5991..000000000 --- a/dist/contexts/IndexContext.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";const e=require("react").createContext(0);module.exports=e; diff --git a/dist/contexts/IndexContext.d.ts b/dist/contexts/IndexContext.d.ts deleted file mode 100644 index 075814450..000000000 --- a/dist/contexts/IndexContext.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare const IndexContext: import("react").Context; -export default IndexContext; diff --git a/dist/contexts/IndexContext.js b/dist/contexts/IndexContext.js deleted file mode 100644 index b6666d72d..000000000 --- a/dist/contexts/IndexContext.js +++ /dev/null @@ -1 +0,0 @@ -import{createContext as t}from"react";const o=t(0);export{o as default}; diff --git a/dist/contexts/RootStylesContext.cjs b/dist/contexts/RootStylesContext.cjs deleted file mode 100644 index 065822017..000000000 --- a/dist/contexts/RootStylesContext.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";const e=require("react").createContext(void 0);module.exports=e; diff --git a/dist/contexts/RootStylesContext.d.ts b/dist/contexts/RootStylesContext.d.ts deleted file mode 100644 index 4871da86f..000000000 --- a/dist/contexts/RootStylesContext.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare const RootStylesContext: import("react").Context; -export default RootStylesContext; diff --git a/dist/contexts/RootStylesContext.js b/dist/contexts/RootStylesContext.js deleted file mode 100644 index 775c7c326..000000000 --- a/dist/contexts/RootStylesContext.js +++ /dev/null @@ -1 +0,0 @@ -import{createContext as o}from"react";const t=o(void 0);export{t as default}; diff --git a/dist/contexts/SelectedValueContext.cjs b/dist/contexts/SelectedValueContext.cjs deleted file mode 100644 index fa366699d..000000000 --- a/dist/contexts/SelectedValueContext.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";const e=require("react").createContext({selectedValue:void 0,handleValueChange:void 0});module.exports=e; diff --git a/dist/contexts/SelectedValueContext.d.ts b/dist/contexts/SelectedValueContext.d.ts deleted file mode 100644 index e930debf0..000000000 --- a/dist/contexts/SelectedValueContext.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -export interface SelectedValueContextValue { - selectedValue: any; - handleValueChange?: (value: any) => void; -} -declare const SelectedValueContext: import("react").Context; -export default SelectedValueContext; diff --git a/dist/contexts/SelectedValueContext.js b/dist/contexts/SelectedValueContext.js deleted file mode 100644 index b25807acf..000000000 --- a/dist/contexts/SelectedValueContext.js +++ /dev/null @@ -1 +0,0 @@ -import{createContext as e}from"react";const a=e({selectedValue:void 0,handleValueChange:void 0});export{a as default}; diff --git a/dist/contexts/index.d.ts b/dist/contexts/index.d.ts deleted file mode 100644 index 55a639eae..000000000 --- a/dist/contexts/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { default as BaseColorContext } from "./BaseColorContext"; -export { default as IndexContext } from "./IndexContext"; -export { default as RootStylesContext } from "./RootStylesContext"; -export { default as SelectedValueContext } from "./SelectedValueContext"; diff --git a/dist/hooks/index.d.ts b/dist/hooks/index.d.ts deleted file mode 100644 index 98e2bb4d2..000000000 --- a/dist/hooks/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as useInternalState } from "./useInternalState"; -export { default as useOnWindowResize } from "./useOnWindowResize"; diff --git a/dist/hooks/useInternalState.cjs b/dist/hooks/useInternalState.cjs deleted file mode 100644 index a985ce745..000000000 --- a/dist/hooks/useInternalState.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("react");module.exports=(r,t)=>{const s=void 0!==t,[u,o]=e.useState(r);return[s?t:u,e=>{s||o(e)}]}; diff --git a/dist/hooks/useInternalState.d.ts b/dist/hooks/useInternalState.d.ts deleted file mode 100644 index 00e1b6b60..000000000 --- a/dist/hooks/useInternalState.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare const useInternalState: (defaultValueProp: T, valueProp: T) => [T, import("react").Dispatch>]; -export default useInternalState; diff --git a/dist/hooks/useInternalState.js b/dist/hooks/useInternalState.js deleted file mode 100644 index 092166aaf..000000000 --- a/dist/hooks/useInternalState.js +++ /dev/null @@ -1 +0,0 @@ -import{useState as t}from"react";const o=(o,r)=>{const e=void 0!==r,[a,c]=t(o);return[e?r:a,t=>{e||c(t)}]};export{o as default}; diff --git a/dist/hooks/useOnWindowResize.cjs b/dist/hooks/useOnWindowResize.cjs deleted file mode 100644 index b49de5e9b..000000000 --- a/dist/hooks/useOnWindowResize.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("react");module.exports=(t,r)=>{const[n,i]=e.useState(r);e.useEffect((()=>{const e=()=>{i(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t,n])}; diff --git a/dist/hooks/useOnWindowResize.d.ts b/dist/hooks/useOnWindowResize.d.ts deleted file mode 100644 index a9b277247..000000000 --- a/dist/hooks/useOnWindowResize.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const useOnWindowResize: (handler: { - (): void; -}, initialWindowSize?: number) => void; -export default useOnWindowResize; diff --git a/dist/hooks/useOnWindowResize.js b/dist/hooks/useOnWindowResize.js deleted file mode 100644 index a7b81d3bf..000000000 --- a/dist/hooks/useOnWindowResize.js +++ /dev/null @@ -1 +0,0 @@ -import{useState as e,useEffect as n}from"react";const t=(t,r)=>{const[i,o]=e(r);n((()=>{const e=()=>{o(window.innerWidth),t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t,i])};export{t as default}; diff --git a/dist/index.cjs b/dist/index.cjs deleted file mode 100644 index ce4f8df61..000000000 --- a/dist/index.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./components/chart-elements/AreaChart/AreaChart.cjs"),t=require("./components/chart-elements/BarChart/BarChart.cjs"),r=require("./components/chart-elements/DonutChart/DonutChart.cjs"),s=require("./components/chart-elements/LineChart/LineChart.cjs"),o=require("./components/chart-elements/ScatterChart/ScatterChart.cjs"),n=require("./components/icon-elements/Badge/Badge.cjs"),c=require("./components/icon-elements/BadgeDelta/BadgeDelta.cjs"),a=require("./components/icon-elements/Icon/Icon.cjs"),l=require("./components/input-elements/Button/Button.cjs"),i=require("./components/input-elements/DatePicker/DatePicker.cjs"),p=require("./components/input-elements/DateRangePicker/DateRangePicker.cjs"),m=require("./components/input-elements/DateRangePicker/DateRangePickerItem.cjs"),u=require("./components/input-elements/MultiSelect/MultiSelect.cjs"),x=require("./components/input-elements/MultiSelect/MultiSelectItem.cjs"),j=require("./components/input-elements/NumberInput/NumberInput.cjs"),q=require("./components/input-elements/SearchSelect/SearchSelect.cjs"),T=require("./components/input-elements/SearchSelect/SearchSelectItem.cjs"),d=require("./components/input-elements/Select/Select.cjs"),b=require("./components/input-elements/Select/SelectItem.cjs"),C=require("./components/input-elements/Switch/Switch.cjs"),S=require("./components/input-elements/Tabs/Tab.cjs"),B=require("./components/input-elements/Tabs/TabGroup.cjs"),h=require("./components/input-elements/Tabs/TabList.cjs"),g=require("./components/input-elements/Tabs/TabPanel.cjs"),k=require("./components/input-elements/Tabs/TabPanels.cjs"),D=require("./components/input-elements/Textarea/Textarea.cjs"),I=require("./components/input-elements/TextInput/TextInput.cjs"),L=require("./components/layout-elements/Accordion/Accordion.cjs"),P=require("./components/layout-elements/Accordion/AccordionBody.cjs"),y=require("./components/layout-elements/Accordion/AccordionHeader.cjs"),A=require("./components/layout-elements/Accordion/AccordionList.cjs"),M=require("./components/layout-elements/Card/Card.cjs"),v=require("./components/layout-elements/Divider/Divider.cjs"),R=require("./components/layout-elements/Flex/Flex.cjs"),F=require("./components/layout-elements/Grid/Col.cjs"),f=require("./components/layout-elements/Grid/Grid.cjs"),G=require("./components/layout-elements/Dialog/Dialog.cjs"),H=require("./components/layout-elements/Dialog/DialogPanel.cjs"),w=require("./components/list-elements/List/List.cjs"),N=require("./components/list-elements/List/ListItem.cjs"),_=require("./components/list-elements/Table/Table.cjs"),O=require("./components/list-elements/Table/TableBody.cjs"),z=require("./components/list-elements/Table/TableCell.cjs"),E=require("./components/list-elements/Table/TableFoot.cjs"),J=require("./components/list-elements/Table/TableFooterCell.cjs"),K=require("./components/list-elements/Table/TableHead.cjs"),Q=require("./components/list-elements/Table/TableHeaderCell.cjs"),U=require("./components/list-elements/Table/TableRow.cjs"),V=require("./components/spark-elements/SparkBarChart/SparkBarChart.cjs"),W=require("./components/spark-elements/SparkLineChart/SparkLineChart.cjs"),X=require("./components/spark-elements/SparkAreaChart/SparkAreaChart.cjs"),Y=require("./components/text-elements/Bold/Bold.cjs"),Z=require("./components/text-elements/Callout/Callout.cjs"),$=require("./components/text-elements/Italic/Italic.cjs"),ee=require("./components/text-elements/Legend/Legend.cjs"),te=require("./components/text-elements/Metric/Metric.cjs"),re=require("./components/text-elements/Subtitle/Subtitle.cjs"),se=require("./components/text-elements/Text/Text.cjs"),oe=require("./components/text-elements/Title/Title.cjs"),ne=require("./components/vis-elements/BarList/BarList.cjs"),ce=require("./components/vis-elements/CategoryBar/CategoryBar.cjs"),ae=require("./components/vis-elements/DeltaBar/DeltaBar.cjs"),le=require("./components/vis-elements/MarkerBar/MarkerBar.cjs"),ie=require("./components/vis-elements/ProgressBar/ProgressBar.cjs"),pe=require("./components/vis-elements/ProgressCircle/ProgressCircle.cjs"),me=require("./components/vis-elements/Tracker/Tracker.cjs"),ue=require("./lib/inputTypes.cjs");exports.AreaChart=e,exports.BarChart=t,exports.DonutChart=r,exports.LineChart=s,exports.ScatterChart=o,exports.Badge=n,exports.BadgeDelta=c,exports.Icon=a.default,exports.Button=l.default,exports.DatePicker=i,exports.DateRangePicker=p,exports.DateRangePickerItem=m,exports.MultiSelect=u,exports.MultiSelectItem=x,exports.NumberInput=j,exports.SearchSelect=q,exports.SearchSelectItem=T,exports.Select=d,exports.SelectItem=b,exports.Switch=C,exports.Tab=S,exports.TabGroup=B,exports.TabList=h.default,exports.TabPanel=g,exports.TabPanels=k,exports.Textarea=D,exports.TextInput=I,exports.Accordion=L.default,exports.AccordionBody=P,exports.AccordionHeader=y,exports.AccordionList=A,exports.Card=M,exports.Divider=v,exports.Flex=R,exports.Col=F,exports.Grid=f,exports.Dialog=G,exports.DialogPanel=H,exports.List=w,exports.ListItem=N,exports.Table=_,exports.TableBody=O,exports.TableCell=z,exports.TableFoot=E,exports.TableFooterCell=J,exports.TableHead=K,exports.TableHeaderCell=Q,exports.TableRow=U,exports.SparkBarChart=V,exports.SparkLineChart=W,exports.SparkAreaChart=X,exports.Bold=Y,exports.Callout=Z,exports.Italic=$,exports.Legend=ee,exports.Metric=te,exports.Subtitle=re,exports.Text=se,exports.Title=oe,exports.BarList=ne,exports.CategoryBar=ce,exports.DeltaBar=ae,exports.MarkerBar=le,exports.ProgressBar=ie,exports.ProgressCircle=pe,exports.Tracker=me.default,exports.getIsBaseColor=ue.getIsBaseColor; diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 49e00b868..000000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,660 +0,0 @@ -/// -import React$1, { ReactNode } from 'react'; -import { Payload, NameType } from 'recharts/types/component/DefaultTooltipContent'; -import { EventProps as EventProps$1 } from 'components/chart-elements/common'; -import { CustomTooltipProps as CustomTooltipProps$1 } from 'components/chart-elements/common/CustomTooltipProps'; -import { Color as Color$1, Size as Size$2, DeltaType as DeltaType$1, HorizontalPosition as HorizontalPosition$1, VerticalPosition as VerticalPosition$1, ValueFormatter as ValueFormatter$1 } from 'lib'; -import { enUS } from 'date-fns/locale'; -import BaseAnimationTimingProps$1 from 'components/chart-elements/common/BaseAnimationTimingProps'; - -type ValueFormatter = { - (value: number): string; -}; -type CurveType = "linear" | "natural" | "monotone" | "step"; -type Interval = "preserveStartEnd" | "equidistantPreserveStart"; -type IntervalType = "preserveStartEnd" | Interval; -declare const iconVariantValues: readonly ["simple", "light", "shadow", "solid", "outlined"]; -type IconVariant = (typeof iconVariantValues)[number]; -type HorizontalPosition = "left" | "right"; -type VerticalPosition = "top" | "bottom"; -type ButtonVariant = "primary" | "secondary" | "light"; -declare const deltaTypeValues: readonly ["increase", "moderateIncrease", "decrease", "moderateDecrease", "unchanged"]; -type DeltaType = (typeof deltaTypeValues)[number]; -declare const sizeValues: readonly ["xs", "sm", "md", "lg", "xl"]; -type Size$1 = (typeof sizeValues)[number]; -declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"]; -type Color = (typeof colorValues)[number]; -type CustomColor = Color | string; -declare const getIsBaseColor: (color: Color | string) => boolean; -declare const justifyContentValues: readonly ["start", "end", "center", "between", "around", "evenly"]; -type JustifyContent = (typeof justifyContentValues)[number]; -declare const alignItemsValues: readonly ["start", "end", "center", "baseline", "stretch"]; -type AlignItems = (typeof alignItemsValues)[number]; -type FlexDirection = "row" | "col" | "row-reverse" | "col-reverse"; - -interface BaseAnimationTimingProps { - animationDuration?: number; - showAnimation?: boolean; -} - -type CustomTooltipProps = { - payload: Payload[] | undefined; - active: boolean | undefined; - label: NameType | undefined; -}; - -type FixedProps = { - eventType: "dot" | "category" | "bar" | "slice" | "bubble"; - categoryClicked: string; -}; -type BaseEventProps = FixedProps & { - [key: string]: number | string; -}; -type EventProps = BaseEventProps | null | undefined; -interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { - data: any[]; - categories: string[]; - index: string; - colors?: (Color | string)[]; - valueFormatter?: ValueFormatter; - startEndOnly?: boolean; - showXAxis?: boolean; - showYAxis?: boolean; - yAxisWidth?: number; - intervalType?: IntervalType; - showTooltip?: boolean; - showLegend?: boolean; - showGridLines?: boolean; - autoMinValue?: boolean; - minValue?: number; - maxValue?: number; - allowDecimals?: boolean; - noDataText?: string; - onValueChange?: (value: EventProps) => void; - enableLegendSlider?: boolean; - customTooltip?: React.ComponentType; - rotateLabelX?: { - angle: number; - verticalShift?: number; - xAxisHeight?: number; - }; - tickGap?: number; -} - -interface AreaChartProps extends BaseChartProps { - stack?: boolean; - curveType?: CurveType; - connectNulls?: boolean; - showGradient?: boolean; -} -declare const AreaChart$1: React$1.ForwardRefExoticComponent>; - -interface BarChartProps extends BaseChartProps { - layout?: "vertical" | "horizontal"; - stack?: boolean; - relative?: boolean; -} -declare const BarChart: React$1.ForwardRefExoticComponent>; - -type DonutChartVariant = "donut" | "pie"; -interface DonutChartProps extends BaseAnimationTimingProps { - data: any[]; - category?: string; - index?: string; - colors?: (Color | string)[]; - variant?: DonutChartVariant; - valueFormatter?: ValueFormatter; - label?: string; - showLabel?: boolean; - showAnimation?: boolean; - showTooltip?: boolean; - noDataText?: string; - className?: string; - onValueChange?: (value: EventProps$1) => void; - customTooltip?: React$1.ComponentType; -} -declare const DonutChart: React$1.ForwardRefExoticComponent>; - -interface LineChartProps extends BaseChartProps { - curveType?: CurveType; - connectNulls?: boolean; -} -declare const LineChart: React$1.ForwardRefExoticComponent>; - -type ScatterChartValueFormatter = { - x?: ValueFormatter; - y?: ValueFormatter; - size?: ValueFormatter; -}; -interface ScatterChartProps extends BaseAnimationTimingProps, React$1.HTMLAttributes { - data: any[]; - x: string; - y: string; - category: string; - size?: string; - valueFormatter?: ScatterChartValueFormatter; - sizeRange?: number[]; - colors?: (Color | string)[]; - showOpacity?: boolean; - startEndOnly?: boolean; - showXAxis?: boolean; - showYAxis?: boolean; - yAxisWidth?: number; - intervalType?: IntervalType; - showTooltip?: boolean; - showLegend?: boolean; - showGridLines?: boolean; - autoMinXValue?: boolean; - minXValue?: number; - maxXValue?: number; - autoMinYValue?: boolean; - minYValue?: number; - maxYValue?: number; - allowDecimals?: boolean; - noDataText?: string; - enableLegendSlider?: boolean; - onValueChange?: (value: EventProps$1) => void; - customTooltip?: React$1.ComponentType; - rotateLabelX?: { - angle: number; - verticalShift: number; - xAxisHeight: number; - }; - tickGap?: number; -} -declare const ScatterChart: React$1.ForwardRefExoticComponent>; - -interface BadgeProps extends React$1.HTMLAttributes { - color?: Color$1; - size?: Size$2; - icon?: React$1.ElementType; - tooltip?: string; -} -declare const Badge: React$1.ForwardRefExoticComponent>; - -interface BadgeDeltaProps extends React$1.HTMLAttributes { - deltaType?: DeltaType$1; - isIncreasePositive?: boolean; - size?: Size$2; - tooltip?: string; -} -declare const BadgeDelta: React$1.ForwardRefExoticComponent>; - -interface IconProps extends React$1.HTMLAttributes { - icon: React$1.ElementType; - variant?: IconVariant; - tooltip?: string; - size?: Size$1; - color?: Color; -} -declare const Icon: React$1.ForwardRefExoticComponent>; - -interface ButtonProps extends React$1.ButtonHTMLAttributes { - icon?: React$1.ElementType; - iconPosition?: HorizontalPosition; - size?: Size$1; - color?: Color; - variant?: ButtonVariant; - disabled?: boolean; - loading?: boolean; - loadingText?: string; - tooltip?: string; -} -declare const Button: React$1.ForwardRefExoticComponent>; - -type Locale$1 = typeof enUS; -type DatePickerValue = Date | undefined; -interface DatePickerProps extends Omit, "value" | "defaultValue"> { - value?: Date; - defaultValue?: Date; - onValueChange?: (value: DatePickerValue) => void; - minDate?: Date; - maxDate?: Date; - placeholder?: string; - disabled?: boolean; - color?: Color; - locale?: Locale$1; - enableClear?: boolean; - displayFormat?: string; - enableYearNavigation?: boolean; - weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; - disabledDates?: Date[]; - children?: React$1.ReactElement[] | React$1.ReactElement; -} -declare const DatePicker: React$1.ForwardRefExoticComponent>; - -type Locale = typeof enUS; -type DateRangePickerValue = { - from?: Date; - to?: Date; - selectValue?: string; -}; -interface DateRangePickerProps extends Omit, "value" | "defaultValue"> { - value?: DateRangePickerValue; - defaultValue?: DateRangePickerValue; - onValueChange?: (value: DateRangePickerValue) => void; - enableSelect?: boolean; - minDate?: Date; - maxDate?: Date; - placeholder?: string; - selectPlaceholder?: string; - disabled?: boolean; - color?: Color; - locale?: Locale; - enableClear?: boolean; - displayFormat?: string; - enableYearNavigation?: boolean; - weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; - disabledDates?: Date[]; - children?: React$1.ReactElement[] | React$1.ReactElement; -} -declare const DateRangePicker: React$1.ForwardRefExoticComponent>; - -interface DateRangePickerItemProps extends React$1.HTMLAttributes { - value: string; - from: Date; - to?: Date; -} -declare const DateRangePickerItem: React$1.ForwardRefExoticComponent>; - -interface MultiSelectProps extends React$1.HTMLAttributes { - defaultValue?: string[]; - name?: string; - value?: string[]; - onValueChange?: (value: string[]) => void; - placeholder?: string; - placeholderSearch?: string; - disabled?: boolean; - icon?: React$1.ElementType | React$1.JSXElementConstructor; - required?: boolean; - error?: boolean; - errorMessage?: string; - children: React$1.ReactNode; -} -declare const MultiSelect: React$1.ForwardRefExoticComponent>; - -interface MultiSelectItemProps extends React$1.HTMLAttributes { - value: string; -} -declare const MultiSelectItem: React$1.ForwardRefExoticComponent>; - -interface BaseInputProps extends React$1.InputHTMLAttributes { - type?: "text" | "password" | "email" | "url" | "number"; - defaultValue?: string | number; - value?: string | number; - icon?: React$1.ElementType | React$1.JSXElementConstructor; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - stepper?: ReactNode; - onValueChange?: (value: any) => void; - makeInputClassName: (className: string) => string; -} - -interface NumberInputProps extends Omit { - step?: string | number; - enableStepper?: boolean; - onSubmit?: (value: number) => void; - onValueChange?: (value: number) => void; -} -declare const NumberInput: React$1.ForwardRefExoticComponent>; - -interface SearchSelectProps extends React$1.HTMLAttributes { - defaultValue?: string; - name?: string; - searchValue?: string; - onSearchValueChange?: (value: string) => void; - value?: string; - onValueChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - icon?: React$1.ElementType | React$1.JSXElementConstructor; - required?: boolean; - error?: boolean; - errorMessage?: string; - enableClear?: boolean; - children: React$1.ReactNode; -} -declare const SearchSelect: React$1.ForwardRefExoticComponent>; - -interface SearchSelectItemProps extends React$1.HTMLAttributes { - value: string; - icon?: React$1.ElementType; -} -declare const SearchSelectItem: React$1.ForwardRefExoticComponent>; - -interface SelectProps extends React$1.HTMLAttributes { - value?: string; - name?: string; - defaultValue?: string; - onValueChange?: (value: string) => void; - placeholder?: string; - disabled?: boolean; - icon?: React$1.JSXElementConstructor; - enableClear?: boolean; - required?: boolean; - error?: boolean; - errorMessage?: string; - children: React$1.ReactNode; -} -declare const Select: React$1.ForwardRefExoticComponent>; - -interface SelectItemProps extends React$1.HTMLAttributes { - value: string; - icon?: React$1.ElementType; -} -declare const SelectItem: React$1.ForwardRefExoticComponent>; - -interface SwitchProps extends Omit, "onChange"> { - checked?: boolean; - defaultChecked?: boolean; - onChange?: (value: boolean) => void; - color?: Color$1; - name?: string; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - required?: boolean; - id?: string; - tooltip?: string; -} -declare const Switch: React$1.ForwardRefExoticComponent>; - -interface TabProps extends React$1.ButtonHTMLAttributes { - icon?: React$1.ElementType; -} -declare const Tab: React$1.ForwardRefExoticComponent>; - -interface TabGroupProps extends React$1.HTMLAttributes { - defaultIndex?: number; - index?: number; - onIndexChange?: (index: number) => void; - children: React$1.ReactElement[] | React$1.ReactElement; -} -declare const TabGroup: React$1.ForwardRefExoticComponent>; - -type TabVariant = "line" | "solid"; -interface TabListProps extends React$1.HTMLAttributes { - color?: Color$1; - variant?: TabVariant; - children: React$1.ReactElement[] | React$1.ReactElement; -} -declare const TabList: React$1.ForwardRefExoticComponent>; - -declare const TabPanel: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TabPanels: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface TextareaProps extends React$1.TextareaHTMLAttributes { - defaultValue?: string | number; - value?: string | number; - error?: boolean; - errorMessage?: string; - disabled?: boolean; - onValueChange?: (value: any) => void; -} -declare const Textarea: React$1.ForwardRefExoticComponent>; - -type TextInputProps = Omit & { - type?: "text" | "password" | "email" | "url"; - defaultValue?: string; - value?: string; - onValueChange?: (value: string) => void; - icon?: React$1.ElementType | React$1.JSXElementConstructor; - error?: boolean; - errorMessage?: string; - disabled?: boolean; -}; -declare const TextInput: React$1.ForwardRefExoticComponent & { - type?: "text" | "url" | "email" | "password" | undefined; - defaultValue?: string | undefined; - value?: string | undefined; - onValueChange?: ((value: string) => void) | undefined; - icon?: React$1.JSXElementConstructor | React$1.ElementType | undefined; - error?: boolean | undefined; - errorMessage?: string | undefined; - disabled?: boolean | undefined; -} & React$1.RefAttributes>; - -interface AccordionProps extends React$1.HTMLAttributes { - defaultOpen?: boolean; -} -declare const Accordion: React$1.ForwardRefExoticComponent>; - -declare const AccordionBody: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const AccordionHeader: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface AccordionListProps extends React$1.HTMLAttributes { - children: React$1.ReactElement[] | React$1.ReactElement; -} -declare const AccordionList: React$1.ForwardRefExoticComponent>; - -interface CardProps extends React$1.HTMLAttributes { - decoration?: HorizontalPosition$1 | VerticalPosition$1 | ""; - decorationColor?: Color$1; -} -declare const Card: React$1.ForwardRefExoticComponent>; - -declare const Divider: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface FlexProps extends React$1.HTMLAttributes { - flexDirection?: FlexDirection; - justifyContent?: JustifyContent; - alignItems?: AlignItems; - children: React$1.ReactNode; -} -declare const Flex: React$1.ForwardRefExoticComponent>; - -interface ColProps extends React$1.HTMLAttributes { - numColSpan?: number; - numColSpanSm?: number; - numColSpanMd?: number; - numColSpanLg?: number; -} -declare const Col: React$1.ForwardRefExoticComponent>; - -interface GridProps extends React$1.HTMLAttributes { - numItems?: number; - numItemsSm?: number; - numItemsMd?: number; - numItemsLg?: number; - children: React$1.ReactNode; -} -declare const Grid: React$1.ForwardRefExoticComponent>; - -type Without = { - [P in Exclude]?: never; -}; -type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; -type DialogProps = React$1.HTMLAttributes & { - open: boolean; - onClose: (val: boolean) => void; - role?: "dialog" | "alertdialog"; -} & XOR<{ - unmount?: boolean; -}, { - static?: boolean; -}>; -declare const Dialog: React$1.ForwardRefExoticComponent>; - -type DialogPanelProps = React$1.HTMLAttributes; -declare const DialogPanel: React$1.ForwardRefExoticComponent>; - -declare const List: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const ListItem: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const Table: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableBody: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableFoot: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableFooterCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableHead: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableHeaderCell: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -declare const TableRow: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface BaseSparkChartProps extends BaseAnimationTimingProps$1, React.HTMLAttributes { - data: any[]; - categories: string[]; - index: string; - colors?: (Color | string)[]; - noDataText?: string; - autoMinValue?: boolean; - minValue?: number; - maxValue?: number; -} - -interface SparkBarChartProps extends BaseSparkChartProps { - stack?: boolean; - relative?: boolean; -} -declare const SparkBarChart: React$1.ForwardRefExoticComponent>; - -interface SparkLineChartProps extends BaseSparkChartProps { - curveType?: CurveType; - connectNulls?: boolean; -} -declare const SparkLineChart: React$1.ForwardRefExoticComponent>; - -interface SparkAreaChartProps extends BaseSparkChartProps { - stack?: boolean; - curveType?: CurveType; - connectNulls?: boolean; - showGradient?: boolean; -} -declare const AreaChart: React$1.ForwardRefExoticComponent>; - -declare const Bold: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface CalloutProps extends React$1.HTMLAttributes { - title: string; - icon?: React$1.ElementType; - color?: Color$1; -} -declare const Callout: React$1.ForwardRefExoticComponent>; - -declare const Italic: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; - -interface LegendProps extends React$1.OlHTMLAttributes { - categories: string[]; - colors?: (Color$1 | string)[]; - onClickLegendItem?: (category: string, color: Color$1 | string) => void; - activeLegend?: string; - enableLegendSlider?: boolean; -} -declare const Legend: React$1.ForwardRefExoticComponent>; - -interface MetricProps extends React$1.HTMLAttributes { - color?: Color; -} -declare const Metric: React$1.ForwardRefExoticComponent>; - -interface SubtitleProps extends React$1.HTMLAttributes { - color?: Color; -} -declare const Subtitle: React$1.ForwardRefExoticComponent>; - -interface TextProps extends React$1.HTMLAttributes { - color?: Color; -} -declare const Text: React$1.ForwardRefExoticComponent>; - -interface TitleProps extends React$1.HTMLAttributes { - color?: Color; -} -declare const Title: React$1.ForwardRefExoticComponent>; - -type Bar = T & { - key?: string; - value: number; - name: string; - icon?: React$1.JSXElementConstructor; - href?: string; - target?: string; - color?: Color$1; -}; -interface BarListProps extends React$1.HTMLAttributes { - data: Bar[]; - valueFormatter?: ValueFormatter$1; - color?: Color$1; - showAnimation?: boolean; - onValueChange?: (payload: Bar) => void; -} -declare function BarListInner(props: BarListProps, ref: React$1.ForwardedRef): React$1.JSX.Element; -declare namespace BarListInner { - var displayName: string; -} -declare const BarList: (p: BarListProps & { - ref?: React$1.ForwardedRef | undefined; -}) => ReturnType; - -interface CategoryBarProps extends React$1.HTMLAttributes { - values: number[]; - colors?: Color[]; - markerValue?: number; - showLabels?: boolean; - tooltip?: string; - showAnimation?: boolean; -} -declare const CategoryBar: React$1.ForwardRefExoticComponent>; - -interface DeltaBarProps extends React$1.HTMLAttributes { - value: number; - isIncreasePositive?: boolean; - tooltip?: string; - showAnimation?: boolean; -} -declare const DeltaBar: React$1.ForwardRefExoticComponent>; - -interface MarkerBarProps extends React$1.HTMLAttributes { - value: number; - minValue?: number; - maxValue?: number; - markerTooltip?: string; - rangeTooltip?: string; - showAnimation?: boolean; - color?: Color; -} -declare const MarkerBar: React$1.ForwardRefExoticComponent>; - -interface ProgressBarProps extends React$1.HTMLAttributes { - value: number; - label?: string; - tooltip?: string; - showAnimation?: boolean; - color?: Color; -} -declare const ProgressBar: React$1.ForwardRefExoticComponent>; - -type Size = "xs" | "sm" | "md" | "lg" | "xl"; -interface ProgressCircleProps extends React$1.HTMLAttributes { - value?: number; - size?: Size; - color?: Color$1; - showAnimation?: boolean; - tooltip?: string; - radius?: number; - strokeWidth?: number; - children?: React$1.ReactNode; -} -declare const ProgressCircle: React$1.ForwardRefExoticComponent>; - -interface TrackerBlockProps { - key?: string | number; - color?: Color | string; - tooltip?: string; -} -interface TrackerProps extends React$1.HTMLAttributes { - data: TrackerBlockProps[]; -} -declare const Tracker: React$1.ForwardRefExoticComponent>; - -export { Accordion, AccordionBody, AccordionHeader, AccordionList, AccordionListProps, AccordionProps, AlignItems, AreaChart$1 as AreaChart, AreaChartProps, Badge, BadgeDelta, BadgeDeltaProps, BadgeProps, BarChart, BarChartProps, BarList, BarListProps, Bold, Button, ButtonProps, ButtonVariant, Callout, CalloutProps, Card, CardProps, CategoryBar, CategoryBarProps, Col, ColProps, Color, CurveType, CustomColor, CustomTooltipProps, DatePicker, DatePickerProps, DatePickerValue, DateRangePicker, DateRangePickerItem, DateRangePickerItemProps, DateRangePickerProps, DateRangePickerValue, DeltaBar, DeltaBarProps, DeltaType, Dialog, DialogPanel, DialogPanelProps, DialogProps, Divider, DonutChart, DonutChartProps, EventProps, Flex, FlexDirection, FlexProps, Grid, GridProps, HorizontalPosition, Icon, IconProps, IconVariant, Interval, IntervalType, Italic, JustifyContent, Legend, LegendProps, LineChart, LineChartProps, List, ListItem, MarkerBar, MarkerBarProps, Metric, MetricProps, MultiSelect, MultiSelectItem, MultiSelectItemProps, MultiSelectProps, NumberInput, NumberInputProps, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ScatterChart, ScatterChartProps, SearchSelect, SearchSelectItem, SearchSelectItemProps, SearchSelectProps, Select, SelectItem, SelectItemProps, SelectProps, Size$1 as Size, AreaChart as SparkAreaChart, SparkAreaChartProps, SparkBarChart, SparkBarChartProps, SparkLineChart, SparkLineChartProps, Subtitle, SubtitleProps, Switch, SwitchProps, Tab, TabGroup, TabGroupProps, TabList, TabListProps, TabPanel, TabPanels, TabProps, Table, TableBody, TableCell, TableFoot, TableFooterCell, TableHead, TableHeaderCell, TableRow, Text, TextInput, TextInputProps, TextProps, Textarea, TextareaProps, Title, TitleProps, Tracker, TrackerProps, ValueFormatter, VerticalPosition, getIsBaseColor }; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d63c99e91..000000000 --- a/dist/index.js +++ /dev/null @@ -1 +0,0 @@ -export{default as AreaChart}from"./components/chart-elements/AreaChart/AreaChart.js";export{default as BarChart}from"./components/chart-elements/BarChart/BarChart.js";export{default as DonutChart}from"./components/chart-elements/DonutChart/DonutChart.js";export{default as LineChart}from"./components/chart-elements/LineChart/LineChart.js";export{default as ScatterChart}from"./components/chart-elements/ScatterChart/ScatterChart.js";export{default as Badge}from"./components/icon-elements/Badge/Badge.js";export{default as BadgeDelta}from"./components/icon-elements/BadgeDelta/BadgeDelta.js";export{default as Icon}from"./components/icon-elements/Icon/Icon.js";export{default as Button}from"./components/input-elements/Button/Button.js";export{default as DatePicker}from"./components/input-elements/DatePicker/DatePicker.js";export{default as DateRangePicker}from"./components/input-elements/DateRangePicker/DateRangePicker.js";export{default as DateRangePickerItem}from"./components/input-elements/DateRangePicker/DateRangePickerItem.js";export{default as MultiSelect}from"./components/input-elements/MultiSelect/MultiSelect.js";export{default as MultiSelectItem}from"./components/input-elements/MultiSelect/MultiSelectItem.js";export{default as NumberInput}from"./components/input-elements/NumberInput/NumberInput.js";export{default as SearchSelect}from"./components/input-elements/SearchSelect/SearchSelect.js";export{default as SearchSelectItem}from"./components/input-elements/SearchSelect/SearchSelectItem.js";export{default as Select}from"./components/input-elements/Select/Select.js";export{default as SelectItem}from"./components/input-elements/Select/SelectItem.js";export{default as Switch}from"./components/input-elements/Switch/Switch.js";export{default as Tab}from"./components/input-elements/Tabs/Tab.js";export{default as TabGroup}from"./components/input-elements/Tabs/TabGroup.js";export{default as TabList}from"./components/input-elements/Tabs/TabList.js";export{default as TabPanel}from"./components/input-elements/Tabs/TabPanel.js";export{default as TabPanels}from"./components/input-elements/Tabs/TabPanels.js";export{default as Textarea}from"./components/input-elements/Textarea/Textarea.js";export{default as TextInput}from"./components/input-elements/TextInput/TextInput.js";export{default as Accordion}from"./components/layout-elements/Accordion/Accordion.js";export{default as AccordionBody}from"./components/layout-elements/Accordion/AccordionBody.js";export{default as AccordionHeader}from"./components/layout-elements/Accordion/AccordionHeader.js";export{default as AccordionList}from"./components/layout-elements/Accordion/AccordionList.js";export{default as Card}from"./components/layout-elements/Card/Card.js";export{default as Divider}from"./components/layout-elements/Divider/Divider.js";export{default as Flex}from"./components/layout-elements/Flex/Flex.js";export{default as Col}from"./components/layout-elements/Grid/Col.js";export{default as Grid}from"./components/layout-elements/Grid/Grid.js";export{default as Dialog}from"./components/layout-elements/Dialog/Dialog.js";export{default as DialogPanel}from"./components/layout-elements/Dialog/DialogPanel.js";export{default as List}from"./components/list-elements/List/List.js";export{default as ListItem}from"./components/list-elements/List/ListItem.js";export{default as Table}from"./components/list-elements/Table/Table.js";export{default as TableBody}from"./components/list-elements/Table/TableBody.js";export{default as TableCell}from"./components/list-elements/Table/TableCell.js";export{default as TableFoot}from"./components/list-elements/Table/TableFoot.js";export{default as TableFooterCell}from"./components/list-elements/Table/TableFooterCell.js";export{default as TableHead}from"./components/list-elements/Table/TableHead.js";export{default as TableHeaderCell}from"./components/list-elements/Table/TableHeaderCell.js";export{default as TableRow}from"./components/list-elements/Table/TableRow.js";export{default as SparkBarChart}from"./components/spark-elements/SparkBarChart/SparkBarChart.js";export{default as SparkLineChart}from"./components/spark-elements/SparkLineChart/SparkLineChart.js";export{default as SparkAreaChart}from"./components/spark-elements/SparkAreaChart/SparkAreaChart.js";export{default as Bold}from"./components/text-elements/Bold/Bold.js";export{default as Callout}from"./components/text-elements/Callout/Callout.js";export{default as Italic}from"./components/text-elements/Italic/Italic.js";export{default as Legend}from"./components/text-elements/Legend/Legend.js";export{default as Metric}from"./components/text-elements/Metric/Metric.js";export{default as Subtitle}from"./components/text-elements/Subtitle/Subtitle.js";export{default as Text}from"./components/text-elements/Text/Text.js";export{default as Title}from"./components/text-elements/Title/Title.js";export{default as BarList}from"./components/vis-elements/BarList/BarList.js";export{default as CategoryBar}from"./components/vis-elements/CategoryBar/CategoryBar.js";export{default as DeltaBar}from"./components/vis-elements/DeltaBar/DeltaBar.js";export{default as MarkerBar}from"./components/vis-elements/MarkerBar/MarkerBar.js";export{default as ProgressBar}from"./components/vis-elements/ProgressBar/ProgressBar.js";export{default as ProgressCircle}from"./components/vis-elements/ProgressCircle/ProgressCircle.js";export{default as Tracker}from"./components/vis-elements/Tracker/Tracker.js";export{getIsBaseColor}from"./lib/inputTypes.js"; diff --git a/dist/lib/constants.cjs b/dist/lib/constants.cjs deleted file mode 100644 index a1ac1cace..000000000 --- a/dist/lib/constants.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.BaseColors={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},exports.DeltaTypes={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},exports.HorizontalPositions={Left:"left",Right:"right"},exports.Sizes={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},exports.VerticalPositions={Top:"top",Bottom:"bottom"}; diff --git a/dist/lib/constants.d.ts b/dist/lib/constants.d.ts deleted file mode 100644 index cf13a1d2f..000000000 --- a/dist/lib/constants.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Color, DeltaType, HorizontalPosition, Size, VerticalPosition } from "./inputTypes"; -export declare const DeltaTypes: { - [key: string]: DeltaType; -}; -export declare const BaseColors: { - [key: string]: Color; -}; -export declare const Sizes: { - [key: string]: Size; -}; -export declare const HorizontalPositions: { - [key: string]: HorizontalPosition; -}; -export declare const VerticalPositions: { - [key: string]: VerticalPosition; -}; diff --git a/dist/lib/constants.js b/dist/lib/constants.js deleted file mode 100644 index 662ddbf96..000000000 --- a/dist/lib/constants.js +++ /dev/null @@ -1 +0,0 @@ -const e={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},a={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},r={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},n={Left:"left",Right:"right"},t={Top:"top",Bottom:"bottom"};export{a as BaseColors,e as DeltaTypes,n as HorizontalPositions,r as Sizes,t as VerticalPositions}; diff --git a/dist/lib/index.d.ts b/dist/lib/index.d.ts deleted file mode 100644 index 4bccf16dc..000000000 --- a/dist/lib/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./constants"; -export * from "./inputTypes"; -export * from "./theme"; -export * from "./tremorTwMerge"; -export * from "./utils"; diff --git a/dist/lib/inputTypes.cjs b/dist/lib/inputTypes.cjs deleted file mode 100644 index dbab92490..000000000 --- a/dist/lib/inputTypes.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"];exports.getIsBaseColor=r=>e.includes(r); diff --git a/dist/lib/inputTypes.d.ts b/dist/lib/inputTypes.d.ts deleted file mode 100644 index 56df6e4c3..000000000 --- a/dist/lib/inputTypes.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type ValueFormatter = { - (value: number): string; -}; -export type CurveType = "linear" | "natural" | "monotone" | "step"; -export type Interval = "preserveStartEnd" | "equidistantPreserveStart"; -export type IntervalType = "preserveStartEnd" | Interval; -declare const iconVariantValues: readonly ["simple", "light", "shadow", "solid", "outlined"]; -export type IconVariant = (typeof iconVariantValues)[number]; -export type HorizontalPosition = "left" | "right"; -export type VerticalPosition = "top" | "bottom"; -export type ButtonVariant = "primary" | "secondary" | "light"; -declare const deltaTypeValues: readonly ["increase", "moderateIncrease", "decrease", "moderateDecrease", "unchanged"]; -export type DeltaType = (typeof deltaTypeValues)[number]; -declare const sizeValues: readonly ["xs", "sm", "md", "lg", "xl"]; -export type Size = (typeof sizeValues)[number]; -declare const colorValues: readonly ["slate", "gray", "zinc", "neutral", "stone", "red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose"]; -export type Color = (typeof colorValues)[number]; -export type CustomColor = Color | string; -export declare const getIsBaseColor: (color: Color | string) => boolean; -declare const justifyContentValues: readonly ["start", "end", "center", "between", "around", "evenly"]; -export type JustifyContent = (typeof justifyContentValues)[number]; -declare const alignItemsValues: readonly ["start", "end", "center", "baseline", "stretch"]; -export type AlignItems = (typeof alignItemsValues)[number]; -export type FlexDirection = "row" | "col" | "row-reverse" | "col-reverse"; -export {}; diff --git a/dist/lib/inputTypes.js b/dist/lib/inputTypes.js deleted file mode 100644 index da6e0e71c..000000000 --- a/dist/lib/inputTypes.js +++ /dev/null @@ -1 +0,0 @@ -const e=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],l=l=>e.includes(l);export{l as getIsBaseColor}; diff --git a/dist/lib/theme.cjs b/dist/lib/theme.cjs deleted file mode 100644 index c2c17ca8b..000000000 --- a/dist/lib/theme.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("./constants.cjs");const e=[o.BaseColors.Blue,o.BaseColors.Cyan,o.BaseColors.Sky,o.BaseColors.Indigo,o.BaseColors.Violet,o.BaseColors.Purple,o.BaseColors.Fuchsia,o.BaseColors.Slate,o.BaseColors.Gray,o.BaseColors.Zinc,o.BaseColors.Neutral,o.BaseColors.Stone,o.BaseColors.Red,o.BaseColors.Orange,o.BaseColors.Amber,o.BaseColors.Yellow,o.BaseColors.Lime,o.BaseColors.Green,o.BaseColors.Emerald,o.BaseColors.Teal,o.BaseColors.Pink,o.BaseColors.Rose];exports.colorPalette={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},exports.themeColorRange=e; diff --git a/dist/lib/theme.d.ts b/dist/lib/theme.d.ts deleted file mode 100644 index 6146d8891..000000000 --- a/dist/lib/theme.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Color } from "./inputTypes"; -export declare const DEFAULT_COLOR: Color; -export declare const WHITE = "white"; -export declare const TRANSPARENT = "transparent"; -export declare const colorPalette: { - canvasBackground: number; - lightBackground: number; - background: number; - darkBackground: number; - darkestBackground: number; - lightBorder: number; - border: number; - darkBorder: number; - lightRing: number; - ring: number; - iconRing: number; - lightText: number; - text: number; - iconText: number; - darkText: number; - darkestText: number; - icon: number; -}; -export declare const themeColorRange: Color[]; diff --git a/dist/lib/theme.js b/dist/lib/theme.js deleted file mode 100644 index 4247dcf1d..000000000 --- a/dist/lib/theme.js +++ /dev/null @@ -1 +0,0 @@ -import{BaseColors as e}from"./constants.js";const r={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},n=[e.Blue,e.Cyan,e.Sky,e.Indigo,e.Violet,e.Purple,e.Fuchsia,e.Slate,e.Gray,e.Zinc,e.Neutral,e.Stone,e.Red,e.Orange,e.Amber,e.Yellow,e.Lime,e.Green,e.Emerald,e.Teal,e.Pink,e.Rose];export{r as colorPalette,n as themeColorRange}; diff --git a/dist/lib/tremorTwMerge.cjs b/dist/lib/tremorTwMerge.cjs deleted file mode 100644 index ab8677a4b..000000000 --- a/dist/lib/tremorTwMerge.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("tailwind-merge").extendTailwindMerge({classGroups:{boxShadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],borderRadius:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],fontSize:[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}});exports.tremorTwMerge=e; diff --git a/dist/lib/tremorTwMerge.d.ts b/dist/lib/tremorTwMerge.d.ts deleted file mode 100644 index 1482cc885..000000000 --- a/dist/lib/tremorTwMerge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const tremorTwMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string; diff --git a/dist/lib/tremorTwMerge.js b/dist/lib/tremorTwMerge.js deleted file mode 100644 index e488706e2..000000000 --- a/dist/lib/tremorTwMerge.js +++ /dev/null @@ -1 +0,0 @@ -import{extendTailwindMerge as r}from"tailwind-merge";const t=r({classGroups:{boxShadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],borderRadius:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],fontSize:[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}});export{t as tremorTwMerge}; diff --git a/dist/lib/utils.cjs b/dist/lib/utils.cjs deleted file mode 100644 index 16582cca2..000000000 --- a/dist/lib/utils.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./constants.cjs"),r=require("./inputTypes.cjs");exports.defaultValueFormatter=e=>e.toString(),exports.getColorClassNames=function(e,o){const t=r.getIsBaseColor(e);if("white"===e||"black"===e||"transparent"===e||!o||!t){const r=(e=>e.includes("#")||e.includes("--")||e.includes("rgb"))(e)?`[${e}]`:e;return{bgColor:`bg-${r}`,hoverBgColor:`hover:bg-${r}`,selectBgColor:`ui-selected:bg-${r}`,textColor:`text-${r}`,selectTextColor:`ui-selected:text-${r}`,hoverTextColor:`hover:text-${r}`,borderColor:`border-${r}`,selectBorderColor:`ui-selected:border-${r}`,hoverBorderColor:`hover:border-${r}`,ringColor:`ring-${r}`,strokeColor:`stroke-${r}`,fillColor:`fill-${r}`}}return{bgColor:`bg-${e}-${o}`,selectBgColor:`ui-selected:bg-${e}-${o}`,hoverBgColor:`hover:bg-${e}-${o}`,textColor:`text-${e}-${o}`,selectTextColor:`ui-selected:text-${e}-${o}`,hoverTextColor:`hover:text-${e}-${o}`,borderColor:`border-${e}-${o}`,selectBorderColor:`ui-selected:border-${e}-${o}`,hoverBorderColor:`hover:border-${e}-${o}`,ringColor:`ring-${e}-${o}`,strokeColor:`stroke-${e}-${o}`,fillColor:`fill-${e}-${o}`}},exports.isValueInArray=(e,r)=>{for(let o=0;o`tremor-${e}-${r}`},exports.mapInputsToDeltaType=(r,o)=>{if(o||r===e.DeltaTypes.Unchanged)return r;switch(r){case e.DeltaTypes.Increase:return e.DeltaTypes.Decrease;case e.DeltaTypes.ModerateIncrease:return e.DeltaTypes.ModerateDecrease;case e.DeltaTypes.Decrease:return e.DeltaTypes.Increase;case e.DeltaTypes.ModerateDecrease:return e.DeltaTypes.ModerateIncrease}return""},exports.mergeRefs=function(e){return r=>{e.forEach((e=>{"function"==typeof e?e(r):null!=e&&(e.current=r)}))}},exports.sumNumericArray=e=>e.reduce(((e,r)=>e+r),0); diff --git a/dist/lib/utils.d.ts b/dist/lib/utils.d.ts deleted file mode 100644 index ccaf08d09..000000000 --- a/dist/lib/utils.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -import { Color, ValueFormatter } from "./inputTypes"; -export declare const mapInputsToDeltaType: (deltaType: string, isIncreasePositive: boolean) => string; -export declare const defaultValueFormatter: ValueFormatter; -export declare const currencyValueFormatter: ValueFormatter; -export declare const sumNumericArray: (arr: number[]) => number; -export declare const isValueInArray: (value: any, array: any[]) => boolean; -export declare function mergeRefs(refs: Array | React.LegacyRef>): React.RefCallback; -export declare function makeClassName(componentName: string): (className: string) => string; -interface ColorClassNames { - bgColor: string; - hoverBgColor: string; - selectBgColor: string; - textColor: string; - selectTextColor: string; - hoverTextColor: string; - borderColor: string; - selectBorderColor: string; - hoverBorderColor: string; - ringColor: string; - strokeColor: string; - fillColor: string; -} -export declare function getColorClassNames(color: Color | string, shade?: number): ColorClassNames; -export {}; diff --git a/dist/lib/utils.js b/dist/lib/utils.js deleted file mode 100644 index 24c4e58da..000000000 --- a/dist/lib/utils.js +++ /dev/null @@ -1 +0,0 @@ -import{DeltaTypes as e}from"./constants.js";import{getIsBaseColor as r}from"./inputTypes.js";const o=(r,o)=>{if(o||r===e.Unchanged)return r;switch(r){case e.Increase:return e.Decrease;case e.ModerateIncrease:return e.ModerateDecrease;case e.Decrease:return e.Increase;case e.ModerateDecrease:return e.ModerateIncrease}return""},t=e=>e.toString(),l=e=>e.reduce(((e,r)=>e+r),0),n=(e,r)=>{for(let o=0;o{e.forEach((e=>{"function"==typeof e?e(r):null!=e&&(e.current=r)}))}}function s(e){return r=>`tremor-${e}-${r}`}function $(e,o){const t=r(e);if("white"===e||"black"===e||"transparent"===e||!o||!t){const r=(e=>e.includes("#")||e.includes("--")||e.includes("rgb"))(e)?`[${e}]`:e;return{bgColor:`bg-${r}`,hoverBgColor:`hover:bg-${r}`,selectBgColor:`ui-selected:bg-${r}`,textColor:`text-${r}`,selectTextColor:`ui-selected:text-${r}`,hoverTextColor:`hover:text-${r}`,borderColor:`border-${r}`,selectBorderColor:`ui-selected:border-${r}`,hoverBorderColor:`hover:border-${r}`,ringColor:`ring-${r}`,strokeColor:`stroke-${r}`,fillColor:`fill-${r}`}}return{bgColor:`bg-${e}-${o}`,selectBgColor:`ui-selected:bg-${e}-${o}`,hoverBgColor:`hover:bg-${e}-${o}`,textColor:`text-${e}-${o}`,selectTextColor:`ui-selected:text-${e}-${o}`,hoverTextColor:`hover:text-${e}-${o}`,borderColor:`border-${e}-${o}`,selectBorderColor:`ui-selected:border-${e}-${o}`,hoverBorderColor:`hover:border-${e}-${o}`,ringColor:`ring-${e}-${o}`,strokeColor:`stroke-${e}-${o}`,fillColor:`fill-${e}-${o}`}}export{t as defaultValueFormatter,$ as getColorClassNames,n as isValueInArray,s as makeClassName,o as mapInputsToDeltaType,c as mergeRefs,l as sumNumericArray}; diff --git a/package.json b/package.json index 00e06a5e1..57b242f4a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/Upsolve-Labs/tremor2axis" + "url": "git+https://github.com/Upsolve-Labs/tremor2axis.git" }, "author": "tremor", "license": "Apache 2.0", @@ -114,7 +114,7 @@ "types": "dist/index.d.ts", "publishConfig": { "access": "public", - "registry": "https://npm.pkg.github.com/" + "registry": "https://registry.npmjs.org" }, "release": { "branches": [ From 4eb824fbb3a0b02ffe19fca8e1bebda408374e34 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Thu, 25 Apr 2024 02:12:23 -0400 Subject: [PATCH 16/48] idk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 57b242f4a..eb6d01fd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@upsolve-labs/tremor2axis", - "version": "0.0.3", + "name": "tremor2axis", + "version": "0.0.4", "type": "commonjs", "description": "The React library to build dashboards faster.", "scripts": { From 69bd016e6542bb21c76ed9de2c79f459856a20c4 Mon Sep 17 00:00:00 2001 From: jamesyoungGHusername Date: Thu, 25 Apr 2024 14:52:33 +0800 Subject: [PATCH 17/48] swaps type back to module --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb6d01fd8..258183a9d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tremor2axis", "version": "0.0.4", - "type": "commonjs", + "type": "module", "description": "The React library to build dashboards faster.", "scripts": { "prebuild": "rm -rf dist", From 52556567bd8061314b8e36d7479a2c6ddcf0c8f3 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Thu, 4 Jul 2024 19:25:44 -0400 Subject: [PATCH 18/48] Added lables to charts --- .../chart-elements/AreaChart/AreaChart.tsx | 16 ++++++++++++++++ .../chart-elements/BarChart/BarChart.tsx | 16 ++++++++++++++++ .../chart-elements/DonutChart/DonutChart.tsx | 4 ++++ .../chart-elements/LineChart/LineChart.tsx | 16 ++++++++++++++++ .../ScatterChart/ScatterChart.tsx | 18 ++++++++++++++++++ .../chart-elements/common/BaseChartProps.tsx | 2 ++ .../chart-elements/AreaChart.stories.tsx | 4 ++++ .../chart-elements/BarChart.stories.tsx | 4 ++++ .../chart-elements/DonutChart.stories.tsx | 8 ++++++++ .../chart-elements/LineChart.stories.tsx | 4 ++++ .../chart-elements/ScatterChart.stories.tsx | 4 ++++ 11 files changed, 96 insertions(+) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 44d3ca35e..4eabcfbfb 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -79,6 +79,7 @@ const AreaChart = React.forwardRef((props, ref) customTooltip, rotateLabelX, tickGap = 5, + dataLabelPosition, orientations, ...other } = props; @@ -418,6 +419,21 @@ const AreaChart = React.forwardRef((props, ref) return ; }} key={category} + label={ + dataLabelPosition?.[category] == null + ? undefined + : { + style: { + fontSize: "12px", + fontWeight: "300", + fill: categoryColors.get(category) ?? BaseColors.Gray, + stroke: "#000", + strokeWidth: 0.3, + }, + position: dataLabelPosition[category], + offset: 10, + } + } name={category} type={curveType} dataKey={category} diff --git a/src/components/chart-elements/BarChart/BarChart.tsx b/src/components/chart-elements/BarChart/BarChart.tsx index 186a1c1d9..4db83128b 100644 --- a/src/components/chart-elements/BarChart/BarChart.tsx +++ b/src/components/chart-elements/BarChart/BarChart.tsx @@ -94,6 +94,7 @@ const BarChart = React.forwardRef((props, ref) => rotateLabelX, barCategoryGap, tickGap = 5, + dataLabelPosition, className, ...other } = props; @@ -338,6 +339,21 @@ const BarChart = React.forwardRef((props, ref) => stackId={stack || relative ? "a" : undefined} dataKey={category} fill="" + label={ + dataLabelPosition?.[category] == null + ? undefined + : { + style: { + fontSize: "12px", + fontWeight: "300", + fill: categoryColors.get(category) ?? BaseColors.Gray, + stroke: "#000", + strokeWidth: 0.3, + }, + position: dataLabelPosition[category], + offset: 10, + } + } isAnimationActive={showAnimation} animationDuration={animationDuration} shape={(props: any) => renderShape(props, activeBar, activeLegend, layout)} diff --git a/src/components/chart-elements/DonutChart/DonutChart.tsx b/src/components/chart-elements/DonutChart/DonutChart.tsx index a3e0de11b..6b71843f4 100644 --- a/src/components/chart-elements/DonutChart/DonutChart.tsx +++ b/src/components/chart-elements/DonutChart/DonutChart.tsx @@ -18,6 +18,7 @@ import { parseData, parseLabelInput } from "./inputParser"; import type { EventProps } from "components/chart-elements/common"; import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; +import { LabelPosition } from "recharts/types/component/Label"; type DonutChartVariant = "donut" | "pie"; @@ -36,6 +37,7 @@ export interface DonutChartProps extends BaseAnimationTimingProps { className?: string; onValueChange?: (value: EventProps) => void; customTooltip?: React.ComponentType; + dataLabelPosition?: Record; } const renderInactiveShape = (props: any) => { @@ -90,6 +92,7 @@ const DonutChart = React.forwardRef((props, ref onValueChange, customTooltip, className, + dataLabelPosition, ...other } = props; const CustomTooltip = customTooltip; @@ -177,6 +180,7 @@ const DonutChart = React.forwardRef((props, ref activeIndex={activeIndex} inactiveShape={renderInactiveShape} style={{ outline: "none" }} + label={dataLabelPosition?.[category] != null} /> {/* {showTooltip ? ( ((props, ref) customTooltip, rotateLabelX, tickGap = 5, + dataLabelPosition, orientations, ...other } = props; @@ -365,6 +366,21 @@ const LineChart = React.forwardRef((props, ref) return ; }} key={category} + label={ + dataLabelPosition?.[category] == null + ? undefined + : { + style: { + fontSize: "12px", + fontWeight: "300", + fill: categoryColors.get(category) ?? BaseColors.Gray, + stroke: "#000", + strokeWidth: 0.3, + }, + position: dataLabelPosition[category], + offset: 10, + } + } name={category} type={curveType} dataKey={category} diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index a18aa0fad..482ba004b 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -36,6 +36,7 @@ import { tremorTwMerge, } from "lib"; import { Color, ValueFormatter, IntervalType } from "../../../lib/inputTypes"; +import { LabelPosition } from "recharts/types/component/Label"; export type ScatterChartValueFormatter = { x?: ValueFormatter; @@ -80,6 +81,7 @@ export interface ScatterChartProps xAxisHeight: number; }; tickGap?: number; + dataLabelPosition?: Record; } const renderShape = (props: any, activeNode: any | undefined, activeLegend: string | undefined) => { @@ -140,6 +142,7 @@ const ScatterChart = React.forwardRef((props, className, enableLegendSlider = false, tickGap = 5, + dataLabelPosition, ...other } = props; const CustomTooltip = customTooltip; @@ -328,6 +331,21 @@ const ScatterChart = React.forwardRef((props, fill={`url(#${categoryColors.get(cat)})`} fillOpacity={showOpacity ? 0.7 : 1} key={cat} + label={ + dataLabelPosition?.[category] == null + ? undefined + : { + style: { + fontSize: "12px", + fontWeight: "300", + fill: categoryColors.get(category) ?? BaseColors.Gray, + stroke: "#000", + strokeWidth: 0.3, + }, + position: dataLabelPosition[category], + offset: 10, + } + } name={cat} data={category ? data.filter((d) => d[category] === cat) : data} isAnimationActive={showAnimation} diff --git a/src/components/chart-elements/common/BaseChartProps.tsx b/src/components/chart-elements/common/BaseChartProps.tsx index c2d915f0e..64d7c6040 100644 --- a/src/components/chart-elements/common/BaseChartProps.tsx +++ b/src/components/chart-elements/common/BaseChartProps.tsx @@ -1,3 +1,4 @@ +import { LabelPosition } from "recharts/types/component/Label"; import { Color, ValueFormatter, IntervalType } from "../../../lib"; import type BaseAnimationTimingProps from "./BaseAnimationTimingProps"; import { CustomTooltipProps } from "./CustomTooltipProps"; @@ -41,6 +42,7 @@ interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes< xAxisHeight?: number; }; tickGap?: number; + dataLabelPosition?: Record; } export default BaseChartProps; diff --git a/src/stories/chart-elements/AreaChart.stories.tsx b/src/stories/chart-elements/AreaChart.stories.tsx index 30e46feb4..0248eccb9 100644 --- a/src/stories/chart-elements/AreaChart.stories.tsx +++ b/src/stories/chart-elements/AreaChart.stories.tsx @@ -113,6 +113,10 @@ export const ConnectNullsTrue: Story = { args: { data: simpleBaseChartDataWithNulls, connectNulls: true }, }; +export const ShowLabels: Story = { + args: { dataLabelPosition: { Sales: "top", "Successful Payments": "bottom" } }, +}; + export const ConnectNullsFalse: Story = { args: { data: simpleBaseChartDataWithNulls, connectNulls: false }, }; diff --git a/src/stories/chart-elements/BarChart.stories.tsx b/src/stories/chart-elements/BarChart.stories.tsx index 8dbc67a7a..14f7c6e54 100644 --- a/src/stories/chart-elements/BarChart.stories.tsx +++ b/src/stories/chart-elements/BarChart.stories.tsx @@ -175,6 +175,10 @@ export const LongIndexName: Story = { args: { data: longIndexBaseChartData }, }; +export const ShowLabels: Story = { + args: { dataLabelPosition: { Sales: "top", "Successful Payments": "top" } }, +}; + export const LongIndexNameAndPreserveStartEnd: Story = { args: { data: longIndexBaseChartData, intervalType: "preserveStartEnd" }, }; diff --git a/src/stories/chart-elements/DonutChart.stories.tsx b/src/stories/chart-elements/DonutChart.stories.tsx index 3ae2a563f..fdfc9b463 100644 --- a/src/stories/chart-elements/DonutChart.stories.tsx +++ b/src/stories/chart-elements/DonutChart.stories.tsx @@ -83,6 +83,14 @@ export const CustomColors: Story = { }, }; +export const ShowLabels: Story = { + args: { dataLabelPosition: { sales: "outside" } }, +}; + +export const ShowLabelsPie: Story = { + args: { variant: "pie", dataLabelPosition: { sales: "outside" } }, +}; + export const MoreDatapointsThanColors: Story = { args: { data: [ diff --git a/src/stories/chart-elements/LineChart.stories.tsx b/src/stories/chart-elements/LineChart.stories.tsx index df3a51e3d..0d13c816f 100644 --- a/src/stories/chart-elements/LineChart.stories.tsx +++ b/src/stories/chart-elements/LineChart.stories.tsx @@ -180,6 +180,10 @@ export const NoYAxisStartEndOnly: Story = { args: { showYAxis: false, startEndOnly: true }, }; +export const ShowLabels: Story = { + args: { dataLabelPosition: { Sales: "top", "Successful Payments": "bottom" } }, +}; + export const RotateXLabels: Story = { args: { data: longBaseChartData, diff --git a/src/stories/chart-elements/ScatterChart.stories.tsx b/src/stories/chart-elements/ScatterChart.stories.tsx index 72d923444..c0ee4b745 100644 --- a/src/stories/chart-elements/ScatterChart.stories.tsx +++ b/src/stories/chart-elements/ScatterChart.stories.tsx @@ -143,6 +143,10 @@ export const MultipleZeroValues: Story = { }, }; +export const ShowLabels: Story = { + args: { dataLabelPosition: { "Location A": "top" } }, +}; + export const RotateXLabel: Story = { args: { rotateLabelX: { angle: -45, verticalShift: 15, xAxisHeight: 50 }, From c41989a87c20decf701ea7f721b6a5336958eda8 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Fri, 5 Jul 2024 01:05:58 -0400 Subject: [PATCH 19/48] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a4df435c..215e95aec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tremor2axis", - "version": "0.0.4", + "version": "0.0.9", "type": "module", "description": "The React library to build dashboards faster.", "scripts": { From a167d6537b26b8ffc20dd849f5e46eb4c887fea2 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Fri, 12 Jul 2024 18:05:27 -0400 Subject: [PATCH 20/48] Adding more options to data labels --- .../chart-elements/AreaChart/AreaChart.tsx | 11 ++++++----- .../chart-elements/BarChart/BarChart.tsx | 11 ++++++----- .../chart-elements/DonutChart/DonutChart.tsx | 8 ++++---- .../chart-elements/LineChart/LineChart.tsx | 11 ++++++----- .../chart-elements/ScatterChart/ScatterChart.tsx | 15 ++++++++------- .../chart-elements/common/BaseChartProps.tsx | 9 ++++++++- src/stories/chart-elements/AreaChart.stories.tsx | 7 ++++++- src/stories/chart-elements/BarChart.stories.tsx | 7 ++++++- src/stories/chart-elements/DonutChart.stories.tsx | 7 +++++-- src/stories/chart-elements/LineChart.stories.tsx | 7 ++++++- .../chart-elements/ScatterChart.stories.tsx | 4 +++- 11 files changed, 64 insertions(+), 33 deletions(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 4eabcfbfb..fce4ada3e 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -79,7 +79,7 @@ const AreaChart = React.forwardRef((props, ref) customTooltip, rotateLabelX, tickGap = 5, - dataLabelPosition, + dataLabelOptions, orientations, ...other } = props; @@ -420,18 +420,19 @@ const AreaChart = React.forwardRef((props, ref) }} key={category} label={ - dataLabelPosition?.[category] == null + dataLabelOptions?.[category] == null ? undefined : { style: { - fontSize: "12px", + fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, fontWeight: "300", fill: categoryColors.get(category) ?? BaseColors.Gray, stroke: "#000", strokeWidth: 0.3, }, - position: dataLabelPosition[category], - offset: 10, + position: dataLabelOptions[category].position ?? "top", + offset: dataLabelOptions?.[category].offset ?? 10, + angle: dataLabelOptions?.[category].angle ?? 0, } } name={category} diff --git a/src/components/chart-elements/BarChart/BarChart.tsx b/src/components/chart-elements/BarChart/BarChart.tsx index 4db83128b..7155ebaf2 100644 --- a/src/components/chart-elements/BarChart/BarChart.tsx +++ b/src/components/chart-elements/BarChart/BarChart.tsx @@ -94,7 +94,7 @@ const BarChart = React.forwardRef((props, ref) => rotateLabelX, barCategoryGap, tickGap = 5, - dataLabelPosition, + dataLabelOptions, className, ...other } = props; @@ -340,18 +340,19 @@ const BarChart = React.forwardRef((props, ref) => dataKey={category} fill="" label={ - dataLabelPosition?.[category] == null + dataLabelOptions?.[category] == null ? undefined : { style: { - fontSize: "12px", + fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, fontWeight: "300", fill: categoryColors.get(category) ?? BaseColors.Gray, stroke: "#000", strokeWidth: 0.3, }, - position: dataLabelPosition[category], - offset: 10, + position: dataLabelOptions[category].position ?? "top", + offset: dataLabelOptions?.[category].offset ?? 10, + angle: dataLabelOptions?.[category].angle ?? 0, } } isAnimationActive={showAnimation} diff --git a/src/components/chart-elements/DonutChart/DonutChart.tsx b/src/components/chart-elements/DonutChart/DonutChart.tsx index 6b71843f4..43443be69 100644 --- a/src/components/chart-elements/DonutChart/DonutChart.tsx +++ b/src/components/chart-elements/DonutChart/DonutChart.tsx @@ -18,7 +18,7 @@ import { parseData, parseLabelInput } from "./inputParser"; import type { EventProps } from "components/chart-elements/common"; import { CustomTooltipProps } from "components/chart-elements/common/CustomTooltipProps"; import type BaseAnimationTimingProps from "../common/BaseAnimationTimingProps"; -import { LabelPosition } from "recharts/types/component/Label"; +import { DataLabelOptions } from "../common/BaseChartProps"; type DonutChartVariant = "donut" | "pie"; @@ -37,7 +37,7 @@ export interface DonutChartProps extends BaseAnimationTimingProps { className?: string; onValueChange?: (value: EventProps) => void; customTooltip?: React.ComponentType; - dataLabelPosition?: Record; + dataLabelOptions?: Record; } const renderInactiveShape = (props: any) => { @@ -92,7 +92,7 @@ const DonutChart = React.forwardRef((props, ref onValueChange, customTooltip, className, - dataLabelPosition, + dataLabelOptions, ...other } = props; const CustomTooltip = customTooltip; @@ -180,7 +180,7 @@ const DonutChart = React.forwardRef((props, ref activeIndex={activeIndex} inactiveShape={renderInactiveShape} style={{ outline: "none" }} - label={dataLabelPosition?.[category] != null} + label={dataLabelOptions?.[category] != null} /> {/* {showTooltip ? ( ((props, ref) customTooltip, rotateLabelX, tickGap = 5, - dataLabelPosition, + dataLabelOptions, orientations, ...other } = props; @@ -367,18 +367,19 @@ const LineChart = React.forwardRef((props, ref) }} key={category} label={ - dataLabelPosition?.[category] == null + dataLabelOptions?.[category] == null ? undefined : { style: { - fontSize: "12px", + fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, fontWeight: "300", fill: categoryColors.get(category) ?? BaseColors.Gray, stroke: "#000", strokeWidth: 0.3, }, - position: dataLabelPosition[category], - offset: 10, + position: dataLabelOptions[category].position ?? "top", + offset: dataLabelOptions?.[category].offset ?? 10, + angle: dataLabelOptions?.[category].angle ?? 0, } } name={category} diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 482ba004b..2c02e20dc 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -36,7 +36,7 @@ import { tremorTwMerge, } from "lib"; import { Color, ValueFormatter, IntervalType } from "../../../lib/inputTypes"; -import { LabelPosition } from "recharts/types/component/Label"; +import { DataLabelOptions } from "../common/BaseChartProps"; export type ScatterChartValueFormatter = { x?: ValueFormatter; @@ -81,7 +81,7 @@ export interface ScatterChartProps xAxisHeight: number; }; tickGap?: number; - dataLabelPosition?: Record; + dataLabelOptions?: Record; } const renderShape = (props: any, activeNode: any | undefined, activeLegend: string | undefined) => { @@ -142,7 +142,7 @@ const ScatterChart = React.forwardRef((props, className, enableLegendSlider = false, tickGap = 5, - dataLabelPosition, + dataLabelOptions, ...other } = props; const CustomTooltip = customTooltip; @@ -332,18 +332,19 @@ const ScatterChart = React.forwardRef((props, fillOpacity={showOpacity ? 0.7 : 1} key={cat} label={ - dataLabelPosition?.[category] == null + dataLabelOptions?.[category] == null ? undefined : { style: { - fontSize: "12px", + fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, fontWeight: "300", fill: categoryColors.get(category) ?? BaseColors.Gray, stroke: "#000", strokeWidth: 0.3, }, - position: dataLabelPosition[category], - offset: 10, + position: dataLabelOptions[category].position ?? "top", + offset: dataLabelOptions?.[category].offset ?? 10, + angle: dataLabelOptions?.[category].angle ?? 0, } } name={cat} diff --git a/src/components/chart-elements/common/BaseChartProps.tsx b/src/components/chart-elements/common/BaseChartProps.tsx index 64d7c6040..2eedb3844 100644 --- a/src/components/chart-elements/common/BaseChartProps.tsx +++ b/src/components/chart-elements/common/BaseChartProps.tsx @@ -14,6 +14,13 @@ type BaseEventProps = FixedProps & { export type EventProps = BaseEventProps | null | undefined; +export interface DataLabelOptions { + position?: LabelPosition; + offset?: number; + angle?: number; + fontSize?: number; +} + interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes { data: any[]; categories: string[]; @@ -42,7 +49,7 @@ interface BaseChartProps extends BaseAnimationTimingProps, React.HTMLAttributes< xAxisHeight?: number; }; tickGap?: number; - dataLabelPosition?: Record; + dataLabelOptions?: Record; } export default BaseChartProps; diff --git a/src/stories/chart-elements/AreaChart.stories.tsx b/src/stories/chart-elements/AreaChart.stories.tsx index 0248eccb9..6dd1234ea 100644 --- a/src/stories/chart-elements/AreaChart.stories.tsx +++ b/src/stories/chart-elements/AreaChart.stories.tsx @@ -114,7 +114,12 @@ export const ConnectNullsTrue: Story = { }; export const ShowLabels: Story = { - args: { dataLabelPosition: { Sales: "top", "Successful Payments": "bottom" } }, + args: { + dataLabelOptions: { + Sales: { position: "top", angle: -45, offset: 30, fontSize: 6 }, + "Successful Payments": { position: "bottom" }, + }, + }, }; export const ConnectNullsFalse: Story = { diff --git a/src/stories/chart-elements/BarChart.stories.tsx b/src/stories/chart-elements/BarChart.stories.tsx index 14f7c6e54..30393678b 100644 --- a/src/stories/chart-elements/BarChart.stories.tsx +++ b/src/stories/chart-elements/BarChart.stories.tsx @@ -176,7 +176,12 @@ export const LongIndexName: Story = { }; export const ShowLabels: Story = { - args: { dataLabelPosition: { Sales: "top", "Successful Payments": "top" } }, + args: { + dataLabelOptions: { + Sales: { position: "top", angle: -45, offset: 30, fontSize: 6 }, + "Successful Payments": { position: "bottom" }, + }, + }, }; export const LongIndexNameAndPreserveStartEnd: Story = { diff --git a/src/stories/chart-elements/DonutChart.stories.tsx b/src/stories/chart-elements/DonutChart.stories.tsx index fdfc9b463..90efc6d45 100644 --- a/src/stories/chart-elements/DonutChart.stories.tsx +++ b/src/stories/chart-elements/DonutChart.stories.tsx @@ -84,11 +84,14 @@ export const CustomColors: Story = { }; export const ShowLabels: Story = { - args: { dataLabelPosition: { sales: "outside" } }, + args: { dataLabelOptions: { sales: { position: "top", angle: -45, offset: 30, fontSize: 6 } } }, }; export const ShowLabelsPie: Story = { - args: { variant: "pie", dataLabelPosition: { sales: "outside" } }, + args: { + variant: "pie", + dataLabelOptions: { sales: { position: "top", angle: -45, offset: 30, fontSize: 6 } }, + }, }; export const MoreDatapointsThanColors: Story = { diff --git a/src/stories/chart-elements/LineChart.stories.tsx b/src/stories/chart-elements/LineChart.stories.tsx index 0d13c816f..d73a4fd7a 100644 --- a/src/stories/chart-elements/LineChart.stories.tsx +++ b/src/stories/chart-elements/LineChart.stories.tsx @@ -181,7 +181,12 @@ export const NoYAxisStartEndOnly: Story = { }; export const ShowLabels: Story = { - args: { dataLabelPosition: { Sales: "top", "Successful Payments": "bottom" } }, + args: { + dataLabelOptions: { + Sales: { position: "top", angle: -45, offset: 30, fontSize: 6 }, + "Successful Payments": { position: "bottom" }, + }, + }, }; export const RotateXLabels: Story = { diff --git a/src/stories/chart-elements/ScatterChart.stories.tsx b/src/stories/chart-elements/ScatterChart.stories.tsx index c0ee4b745..b77189737 100644 --- a/src/stories/chart-elements/ScatterChart.stories.tsx +++ b/src/stories/chart-elements/ScatterChart.stories.tsx @@ -144,7 +144,9 @@ export const MultipleZeroValues: Story = { }; export const ShowLabels: Story = { - args: { dataLabelPosition: { "Location A": "top" } }, + args: { + dataLabelOptions: { "Location A": { position: "top", angle: -45, offset: 30, fontSize: 6 } }, + }, }; export const RotateXLabel: Story = { From 7883f21c4249332a12ae282df739ba239a0b8e1d Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Fri, 12 Jul 2024 18:26:52 -0400 Subject: [PATCH 21/48] Rename package --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 215e95aec..4f89fb6b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "tremor2axis", - "version": "0.0.9", + "name": "@upsolve-labs/tremor", + "version": "0.1.0", "type": "module", "description": "The React library to build dashboards faster.", "scripts": { From effdf78d24afc123435ded42c040f1627a96c114 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Tue, 16 Jul 2024 02:10:19 -0400 Subject: [PATCH 22/48] Export DataLabelOptions --- src/components/chart-elements/common/index.ts | 2 +- src/components/chart-elements/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chart-elements/common/index.ts b/src/components/chart-elements/common/index.ts index 7a73db7fe..2794e52c7 100644 --- a/src/components/chart-elements/common/index.ts +++ b/src/components/chart-elements/common/index.ts @@ -1,2 +1,2 @@ -export type { EventProps } from "./BaseChartProps"; +export type { EventProps, DataLabelOptions } from "./BaseChartProps"; export type { CustomTooltipProps } from "./CustomTooltipProps"; diff --git a/src/components/chart-elements/index.ts b/src/components/chart-elements/index.ts index 2632d2800..0ff171487 100644 --- a/src/components/chart-elements/index.ts +++ b/src/components/chart-elements/index.ts @@ -1,6 +1,6 @@ export * from "./AreaChart"; export * from "./BarChart"; -export { EventProps } from "./common/BaseChartProps"; +export { EventProps, DataLabelOptions } from "./common/BaseChartProps"; export { CustomTooltipProps } from "./common/CustomTooltipProps"; export * from "./DonutChart"; export * from "./LineChart"; From d5a02543f3514ab8ec4557cd3acf4546c36fcafd Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 11:31:17 +0100 Subject: [PATCH 23/48] latest --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f89fb6b6..507a7bb11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@upsolve-labs/tremor", - "version": "0.1.0", + "version": "0.1.1", "type": "module", "description": "The React library to build dashboards faster.", "scripts": { @@ -114,7 +114,7 @@ "types": "dist/index.d.ts", "publishConfig": { "access": "public", - "registry": "https://registry.npmjs.org" + "registry": "https://npm.pkg.github.com" }, "release": { "branches": [ From b8f949ccbd066469c7ca7150a67ff2e0ce3e04d3 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 11:53:41 +0100 Subject: [PATCH 24/48] dummy --- src/components/chart-elements/AreaChart/AreaChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 19992cdaa..c962f29e6 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -269,7 +269,7 @@ const AreaChart = React.forwardRef((props, ref) style={{ textAnchor: "middle" }} angle={-90} offset={-15} - className="fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis" + className="fill-tremor-content-emphasis s text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis" > {yAxisLabel} From 2f510bb67d6cd5168759db576dfc17a0e8bb0490 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 11:53:52 +0100 Subject: [PATCH 25/48] undo --- src/components/chart-elements/AreaChart/AreaChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index c962f29e6..19992cdaa 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -269,7 +269,7 @@ const AreaChart = React.forwardRef((props, ref) style={{ textAnchor: "middle" }} angle={-90} offset={-15} - className="fill-tremor-content-emphasis s text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis" + className="fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis" > {yAxisLabel} From a6043939d10cc175419c2daebf6b4c0e7416d4ed Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 12:07:17 +0100 Subject: [PATCH 26/48] Update repo name --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c57a231c2..846b451d5 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Upsolve-Labs/tremor2axis.git" + "url": "git+https://github.com/Upsolve-Labs/tremor.git" }, "author": "tremor", "license": "Apache 2.0", @@ -147,7 +147,7 @@ [ "@semantic-release/github", { - "githubUrl": "git+ssh://git@github.com/upsolve-labs/tremor2axis.git" + "githubUrl": "git+ssh://git@github.com:Upsolve-Labs/tremor.git" } ] ] From 22f0c4296c915406c6b438b162f663f965de8be4 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 12:10:09 +0100 Subject: [PATCH 27/48] change release yaml --- .github/workflows/release.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0215685ef..39331f44a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,4 +37,13 @@ jobs: - name: publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm publish + run: npm publish --access public + # - name: node (gh registry) + # uses: actions/setup-node@v3.4.1 + # with: + # node-version: 18 + # registry-url: https://npm.pkg.github.com + # - name: publish (gh registry) + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: npm publish From 4a1de7e6eb72208eb754d40b858ecf3c638c8e57 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 12:15:19 +0100 Subject: [PATCH 28/48] Add npmrc to gh action with PAT --- .github/workflows/release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 39331f44a..4809745e1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,6 +24,9 @@ jobs: with: node-version: 18 registry-url: https://registry.npmjs.org + - name: Authenticate with GitHub package registry + run: echo "//npm.pkg.github.com:_authToken=${{ secrets.PAT }}" > + ~/.npmrc - name: install react run: npm i react - name: install dependencies @@ -35,9 +38,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release - name: publish + run: npm publish --access public env: + NODE_AUTH_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm publish --access public # - name: node (gh registry) # uses: actions/setup-node@v3.4.1 # with: From 258776eb447a55598aaf67751c7258af4e3f6641 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 13:20:53 +0100 Subject: [PATCH 29/48] Try release PAT again --- .github/workflows/release.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4809745e1..68bc5332a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,14 +18,15 @@ jobs: id-token: write # to enable use of OIDC for npm provenance steps: - name: checkout - uses: actions/checkout@v2.4.2 + uses: actions/checkout@v4 - name: node - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 registry-url: https://registry.npmjs.org - name: Authenticate with GitHub package registry - run: echo "//npm.pkg.github.com:_authToken=${{ secrets.PAT }}" > + run: + echo -e "@upsolve-labs:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${{ secrets.PAT }}" > ~/.npmrc - name: install react run: npm i react From b12a2978f5ad49a48b5953802315ca3dc2326b82 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 14:34:13 +0100 Subject: [PATCH 30/48] try release with pat again --- .github/workflows/release.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68bc5332a..39c34414d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,9 +25,7 @@ jobs: node-version: 20 registry-url: https://registry.npmjs.org - name: Authenticate with GitHub package registry - run: - echo -e "@upsolve-labs:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${{ secrets.PAT }}" > - ~/.npmrc + run: echo -e "@upsolve-labs:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${{ secrets.PAT }}" >> .npmrc - name: install react run: npm i react - name: install dependencies From 4eb0fc6fdb4c7fe80b52d1ba5ee6b5e033599504 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 14:46:31 +0100 Subject: [PATCH 31/48] fix(test) testing semantic release --- .github/workflows/release.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 39c34414d..283ac76f0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,12 +41,3 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.PAT }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: node (gh registry) - # uses: actions/setup-node@v3.4.1 - # with: - # node-version: 18 - # registry-url: https://npm.pkg.github.com - # - name: publish (gh registry) - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: npm publish From 1303d606ec77ddc61cac9fa57e4a9a169909aa40 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 14:59:48 +0100 Subject: [PATCH 32/48] fix: try again with the fix --- .github/workflows/release.yaml | 1 - src/components/chart-elements/AreaChart/AreaChart.tsx | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 283ac76f0..bc54e4614 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,7 +5,6 @@ on: branches: - main - beta - - beta-** jobs: release: diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 19992cdaa..7989d3889 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -48,6 +48,7 @@ interface ActiveDot { dataKey?: string; } +// Placeholder const AreaChart = React.forwardRef((props, ref) => { const { data = [], From 91b085c158a91589b929bf05ec8f2b3a80682131 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 15:07:56 +0100 Subject: [PATCH 33/48] fix: fix semantic release --- package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 846b451d5..2e5bb6495 100644 --- a/package.json +++ b/package.json @@ -144,12 +144,8 @@ ] } ], - [ - "@semantic-release/github", - { - "githubUrl": "git+ssh://git@github.com:Upsolve-Labs/tremor.git" - } - ] + "@semantic-release/npm", + "@semantic-release/github" ] } } From 9c782144b8fd434137ab537974a97e0676306e46 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 15:26:44 +0100 Subject: [PATCH 34/48] fix: remove publish step --- .github/workflows/release.yaml | 10 +++++----- package.json | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bc54e4614..4cf4d1fa9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,8 +35,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release - - name: publish - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.PAT }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: publish + # run: npm publish --access public + # env: + # NODE_AUTH_TOKEN: ${{ secrets.PAT }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 2e5bb6495..8c9da4a41 100644 --- a/package.json +++ b/package.json @@ -115,10 +115,6 @@ "dist" ], "types": "dist/index.d.ts", - "publishConfig": { - "access": "public", - "registry": "https://npm.pkg.github.com" - }, "release": { "branches": [ "main", From d39c27a9cfb832ee662d9dae12a37d5f6258643c Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 18:45:17 +0100 Subject: [PATCH 35/48] fix: deploy to npmjs --- .github/workflows/release.yaml | 7 ------- package.json | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4cf4d1fa9..5372ebf0c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,8 +23,6 @@ jobs: with: node-version: 20 registry-url: https://registry.npmjs.org - - name: Authenticate with GitHub package registry - run: echo -e "@upsolve-labs:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${{ secrets.PAT }}" >> .npmrc - name: install react run: npm i react - name: install dependencies @@ -35,8 +33,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release - # - name: publish - # run: npm publish --access public - # env: - # NODE_AUTH_TOKEN: ${{ secrets.PAT }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 8c9da4a41..16f0444ea 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@upsolve-labs/tremor", + "name": "upsolve-labs-tremor", "version": "0.1.1", "type": "module", "description": "The React library to build dashboards faster.", From 04bcc8ba562af75cf895a84c57e2570b90e0a2c3 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 18:52:44 +0100 Subject: [PATCH 36/48] fix: add npm token --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5372ebf0c..d175a4919 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,4 +32,5 @@ jobs: - name: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release From 50888d30e534a017436cff8c404139366ef777f5 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 19:16:28 +0100 Subject: [PATCH 37/48] fix: echo npm token --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d175a4919..d7c2a6f6b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,4 +33,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release + run: echo $NPM_TOKEN && npx semantic-release From b0d209c81c11c03d40c56f58bfc8b37edf0eceef Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Mon, 22 Jul 2024 19:20:45 +0100 Subject: [PATCH 38/48] fix: fix token in action --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d7c2a6f6b..d0d7e07a4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,5 +32,5 @@ jobs: - name: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: echo $NPM_TOKEN && npx semantic-release + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release From aef1cbfce7f0b599b089393ef095c6abfa71d093 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Wed, 24 Jul 2024 20:11:27 +0100 Subject: [PATCH 39/48] Fix: Expose show axis lines on line, bar, scatter --- src/components/chart-elements/AreaChart/AreaChart.tsx | 6 ++++-- src/components/chart-elements/BarChart/BarChart.tsx | 10 ++++++---- src/components/chart-elements/LineChart/LineChart.tsx | 8 +++++--- .../chart-elements/ScatterChart/ScatterChart.tsx | 8 ++++++-- .../chart-elements/common/BaseChartProps.tsx | 2 ++ 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 7989d3889..8ea2124e6 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -60,6 +60,8 @@ const AreaChart = React.forwardRef((props, ref) startEndOnly = false, showXAxis = true, showYAxis = true, + showXAxisLine = false, + showYAxisLine = false, yAxisWidth = 56, intervalType = "equidistantPreserveStart", showAnimation = false, @@ -195,7 +197,7 @@ const AreaChart = React.forwardRef((props, ref) )} interval={startEndOnly ? "preserveStartEnd" : intervalType} tickLine={false} - axisLine={false} + axisLine={showXAxis && showXAxisLine} minTickGap={tickGap} angle={rotateLabelX?.angle} dy={rotateLabelX?.verticalShift} @@ -246,7 +248,7 @@ const AreaChart = React.forwardRef((props, ref) ((props, ref) => showAnimation = false, showXAxis = true, showYAxis = true, + showXAxisLine = false, + showYAxisLine = false, yAxisWidth = 56, intervalType = "equidistantPreserveStart", showTooltip = true, @@ -205,7 +207,7 @@ const BarChart = React.forwardRef((props, ref) => "dark:fill-dark-tremor-content", )} tickLine={false} - axisLine={false} + axisLine={showXAxis && showXAxisLine} angle={rotateLabelX?.angle} dy={rotateLabelX?.verticalShift} height={rotateLabelX?.xAxisHeight} @@ -238,7 +240,7 @@ const BarChart = React.forwardRef((props, ref) => "dark:fill-dark-tremor-content", )} tickLine={false} - axisLine={false} + axisLine={showXAxis && showXAxisLine} tickFormatter={valueFormatter} minTickGap={tickGap} allowDecimals={allowDecimals} @@ -261,7 +263,7 @@ const BarChart = React.forwardRef((props, ref) => ((props, ref) => width={yAxisWidth} hide={!showYAxis} dataKey={index} - axisLine={false} + axisLine={showYAxis && showYAxisLine} tickLine={false} ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined} type="category" diff --git a/src/components/chart-elements/LineChart/LineChart.tsx b/src/components/chart-elements/LineChart/LineChart.tsx index 043cdcf2b..5a4487cc1 100644 --- a/src/components/chart-elements/LineChart/LineChart.tsx +++ b/src/components/chart-elements/LineChart/LineChart.tsx @@ -55,6 +55,8 @@ const LineChart = React.forwardRef((props, ref) startEndOnly = false, showXAxis = true, showYAxis = true, + showXAxisLine = false, + showYAxisLine = false, yAxisWidth = 56, intervalType = "equidistantPreserveStart", animationDuration = 900, @@ -190,7 +192,7 @@ const LineChart = React.forwardRef((props, ref) "dark:fill-dark-tremor-content", )} tickLine={false} - axisLine={false} + axisLine={showXAxis && showXAxisLine} minTickGap={tickGap} angle={rotateLabelX?.angle} dy={rotateLabelX?.verticalShift} @@ -201,7 +203,7 @@ const LineChart = React.forwardRef((props, ref) ((props, ref) ((props, startEndOnly = false, showXAxis = true, showYAxis = true, + showXAxisLine = false, + showYAxisLine = false, yAxisWidth = 56, intervalType = "equidistantPreserveStart", animationDuration = 900, @@ -252,7 +256,7 @@ const ScatterChart = React.forwardRef((props, )} tickLine={false} tickFormatter={valueFormatter.x} - axisLine={false} + axisLine={showXAxis && showXAxisLine} minTickGap={tickGap} domain={xAxisDomain as AxisDomain} allowDataOverflow={true} @@ -275,7 +279,7 @@ const ScatterChart = React.forwardRef((props, Date: Wed, 24 Jul 2024 21:16:37 +0100 Subject: [PATCH 40/48] fix: Expose show axis lines on line, bar, scatter --- src/components/chart-elements/AreaChart/AreaChart.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 8ea2124e6..320389aa0 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -48,7 +48,6 @@ interface ActiveDot { dataKey?: string; } -// Placeholder const AreaChart = React.forwardRef((props, ref) => { const { data = [], From 40d4bfc02a79f7081ca0e399b5fc54fb9ed808b3 Mon Sep 17 00:00:00 2001 From: Serguei Balanovich Date: Wed, 24 Jul 2024 21:47:45 +0100 Subject: [PATCH 41/48] fix: add stroke when axis line is on --- .../chart-elements/AreaChart/AreaChart.tsx | 9 ++++++--- src/components/chart-elements/BarChart/BarChart.tsx | 12 ++++++++---- .../chart-elements/LineChart/LineChart.tsx | 9 ++++++--- .../chart-elements/ScatterChart/ScatterChart.tsx | 6 ++++-- src/stories/chart-elements/AreaChart.stories.tsx | 9 +++++++++ 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 320389aa0..925f897ed 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -185,7 +185,8 @@ const AreaChart = React.forwardRef((props, ref) tick={{ transform: "translate(0, 6)" }} ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined} fill="" - stroke="" + stroke={showXAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -215,7 +216,8 @@ const AreaChart = React.forwardRef((props, ref) transform: `translate(${orientations[idx] === "right" ? 3 : -3}, 0)`, }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -253,7 +255,8 @@ const AreaChart = React.forwardRef((props, ref) domain={yAxisDomain as AxisDomain} tick={{ transform: "translate(-3, 0)" }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", diff --git a/src/components/chart-elements/BarChart/BarChart.tsx b/src/components/chart-elements/BarChart/BarChart.tsx index a6f0e1d1f..d44ede109 100644 --- a/src/components/chart-elements/BarChart/BarChart.tsx +++ b/src/components/chart-elements/BarChart/BarChart.tsx @@ -197,7 +197,8 @@ const BarChart = React.forwardRef((props, ref) => tick={{ transform: "translate(0, 6)" }} ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined} fill="" - stroke="" + stroke={showXAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "mt-4 text-tremor-label", @@ -230,7 +231,8 @@ const BarChart = React.forwardRef((props, ref) => tick={{ transform: "translate(-3, 0)" }} domain={yAxisDomain as AxisDomain} fill="" - stroke="" + stroke={showXAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -269,7 +271,8 @@ const BarChart = React.forwardRef((props, ref) => domain={yAxisDomain as AxisDomain} tick={{ transform: "translate(-3, 0)" }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -307,7 +310,8 @@ const BarChart = React.forwardRef((props, ref) => interval="preserveStartEnd" tick={{ transform: "translate(0, 6)" }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", diff --git a/src/components/chart-elements/LineChart/LineChart.tsx b/src/components/chart-elements/LineChart/LineChart.tsx index 5a4487cc1..651ad8dcc 100644 --- a/src/components/chart-elements/LineChart/LineChart.tsx +++ b/src/components/chart-elements/LineChart/LineChart.tsx @@ -182,7 +182,8 @@ const LineChart = React.forwardRef((props, ref) tick={{ transform: "translate(0, 6)" }} ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined} fill="" - stroke="" + stroke={showXAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -211,7 +212,8 @@ const LineChart = React.forwardRef((props, ref) transform: `translate(${orientations[idx] === "right" ? 3 : -3}, 0)`, }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -249,7 +251,8 @@ const LineChart = React.forwardRef((props, ref) domain={yAxisDomain as AxisDomain} tick={{ transform: "translate(-3, 0)" }} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 79aea1e09..238ead070 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -245,7 +245,8 @@ const ScatterChart = React.forwardRef((props, type="number" name={x} fill="" - stroke="" + stroke={showXAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", @@ -288,7 +289,8 @@ const ScatterChart = React.forwardRef((props, tick={{ transform: "translate(-3, 0)" }} tickFormatter={valueFormatter.y} fill="" - stroke="" + stroke={showYAxisLine ? "gray" : ""} + strokeOpacity={0.2} className={tremorTwMerge( // common "text-tremor-label", diff --git a/src/stories/chart-elements/AreaChart.stories.tsx b/src/stories/chart-elements/AreaChart.stories.tsx index 96d5614a7..62612701f 100644 --- a/src/stories/chart-elements/AreaChart.stories.tsx +++ b/src/stories/chart-elements/AreaChart.stories.tsx @@ -32,6 +32,15 @@ export const Default: Story = { args: {}, }; +export const ShowAxisLines: Story = { + args: { + showXAxis: true, + showXAxisLine: true, + showYAxis: true, + showYAxisLine: true, + }, +}; + export const DefaultNegativeValues: Story = { args: { data: simpleBaseChartWithNegativeValues, From 92e35081362d0466c08e042c5faaf2fb6bd1fb55 Mon Sep 17 00:00:00 2001 From: danor1 Date: Tue, 3 Sep 2024 18:39:38 +0100 Subject: [PATCH 42/48] fix: make category optional on scatterplot --- .../ScatterChart/ScatterChart.tsx | 157 ++++++++++++------ .../ScatterChart/ScatterChartTooltip.tsx | 6 +- src/lib/utils.tsx | 3 + 3 files changed, 109 insertions(+), 57 deletions(-) diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 238ead070..6767e48e6 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -51,7 +51,7 @@ export interface ScatterChartProps data: any[]; x: string; y: string; - category: string; + category?: string; size?: string; valueFormatter?: ScatterChartValueFormatter; sizeRange?: number[]; @@ -169,12 +169,21 @@ const ScatterChart = React.forwardRef((props, onValueChange?.(null); } else { setActiveNode(data.node); - setActiveLegend(data.payload[category]); - onValueChange?.({ - eventType: "bubble", - categoryClicked: data.payload[category], - ...data.payload, - }); + + // set active legends and categoryClicked state only if category is not undefined (ie there are categories to click!) + if (category) { + setActiveLegend(data.payload[category]); + onValueChange?.({ + eventType: "bubble", + categoryClicked: data.payload[category], + ...data.payload, + }); + } else { + onValueChange?.({ + eventType: "bubble", + ...data.payload, + }); + } } } @@ -193,9 +202,13 @@ const ScatterChart = React.forwardRef((props, setActiveNode(undefined); } + console.log("category: ", category); const categories = constructCategories(data, category); const categoryColors = constructCategoryColors(categories, colors); + console.log("categories: ", categories); + console.log("categoryColors: ", categoryColors); + //maybe rename getYAxisDomain to getAxisDomain const xAxisDomain = getYAxisDomain(autoMinXValue, minXValue, maxXValue); const yAxisDomain = getYAxisDomain(autoMinYValue, minYValue, maxYValue); @@ -339,8 +352,8 @@ const ScatterChart = React.forwardRef((props, label={color} valueFormatter={valueFormatter} axis={{ x: x, y: y, size: size }} - category={category} - categoryColors={categoryColors} + category={category ? category : undefined} + categoryColors={category ? categoryColors : undefined} /> ); } @@ -350,51 +363,87 @@ const ScatterChart = React.forwardRef((props, } /> {size ? : null} - {categories.map((cat) => { - return ( - d[category] === cat) : data} - isAnimationActive={showAnimation} - animationDuration={animationDuration} - shape={(props: any) => renderShape(props, activeNode, activeLegend)} - onClick={onNodeClick} - /> - ); - })} - {showLegend ? ( + {category ? ( + categories?.map((cat) => { + return ( + d[category] === cat) : data} + isAnimationActive={showAnimation} + animationDuration={animationDuration} + shape={(props: any) => renderShape(props, activeNode, activeLegend)} + onClick={onNodeClick} + /> + ); + }) + ) : ( + renderShape(props, activeNode, activeLegend)} + onClick={onNodeClick} + /> + )} + {showLegend && category ? ( ( export interface ScatterChartTooltipProps { label: string; - categoryColors: Map; + categoryColors?: Map; active: boolean | undefined; payload: any; valueFormatter: ScatterChartValueFormatter; @@ -103,8 +103,8 @@ const ScatterChartTooltip = ({ "dark:border-dark-tremor-background dark:shadow-dark-tremor-card", getColorClassNames( category - ? categoryColors.get(payload?.[0]?.payload[category]) ?? BaseColors.Blue - : BaseColors.Blue, + ? categoryColors?.get(payload?.[0]?.payload[category]) ?? BaseColors.Gray + : BaseColors.Gray, colorPalette.background, ).bgColor, )} diff --git a/src/lib/utils.tsx b/src/lib/utils.tsx index 63c5be294..a8a93940f 100644 --- a/src/lib/utils.tsx +++ b/src/lib/utils.tsx @@ -79,8 +79,11 @@ const getIsArbitraryColor = (color: Color | string) => color.includes("#") || color.includes("--") || color.includes("rgb"); export function getColorClassNames(color: Color | string, shade?: number): ColorClassNames { + console.log("color (outside if): ", color); const isBaseColor = getIsBaseColor(color); + console.log("isBaseColor: ", isBaseColor); if (color === "white" || color === "black" || color === "transparent" || !shade || !isBaseColor) { + console.log("color: ", color); const unshadedColor = !getIsArbitraryColor(color) ? color : `[${color}]`; return { bgColor: `bg-${unshadedColor} dark:bg-${unshadedColor}`, From e01a17333ee681ba98f0640ff2b844a3df3ab542 Mon Sep 17 00:00:00 2001 From: danor1 Date: Wed, 4 Sep 2024 11:21:57 +0100 Subject: [PATCH 43/48] fix: custom colours and tooltip on no category scatterchat, plus updated storybook --- .../ScatterChart/ScatterChart.tsx | 22 ++++--- .../ScatterChart/ScatterChartTooltip.tsx | 6 +- src/components/chart-elements/common/utils.ts | 6 ++ .../chart-elements/ScatterChart.stories.tsx | 60 +++++++++++++++++++ 4 files changed, 83 insertions(+), 11 deletions(-) diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 6767e48e6..7ca5548d2 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -202,12 +202,9 @@ const ScatterChart = React.forwardRef((props, setActiveNode(undefined); } - console.log("category: ", category); const categories = constructCategories(data, category); const categoryColors = constructCategoryColors(categories, colors); - console.log("categories: ", categories); - console.log("categoryColors: ", categoryColors); //maybe rename getYAxisDomain to getAxisDomain const xAxisDomain = getYAxisDomain(autoMinXValue, minXValue, maxXValue); @@ -340,7 +337,10 @@ const ScatterChart = React.forwardRef((props, ({ ...payloadItem, - color: categoryColors.get(color) ?? BaseColors.Gray, + color: + categoryColors.get(color) ?? + categoryColors.get("cat_1") ?? + BaseColors.Gray, }))} active={active} label={color} @@ -352,8 +352,8 @@ const ScatterChart = React.forwardRef((props, label={color} valueFormatter={valueFormatter} axis={{ x: x, y: y, size: size }} - category={category ? category : undefined} - categoryColors={category ? categoryColors : undefined} + category={category} + categoryColors={categoryColors} /> ); } @@ -411,9 +411,15 @@ const ScatterChart = React.forwardRef((props, ) : ( ( export interface ScatterChartTooltipProps { label: string; - categoryColors?: Map; + categoryColors: Map; active: boolean | undefined; payload: any; valueFormatter: ScatterChartValueFormatter; @@ -103,8 +103,8 @@ const ScatterChartTooltip = ({ "dark:border-dark-tremor-background dark:shadow-dark-tremor-card", getColorClassNames( category - ? categoryColors?.get(payload?.[0]?.payload[category]) ?? BaseColors.Gray - : BaseColors.Gray, + ? categoryColors.get(payload?.[0]?.payload[category]) ?? BaseColors.Blue + : categoryColors.get("cat_1") ?? BaseColors.Blue, colorPalette.background, ).bgColor, )} diff --git a/src/components/chart-elements/common/utils.ts b/src/components/chart-elements/common/utils.ts index e367cf868..0fb7b8cdf 100644 --- a/src/components/chart-elements/common/utils.ts +++ b/src/components/chart-elements/common/utils.ts @@ -5,6 +5,12 @@ export const constructCategoryColors = ( colors: (Color | string)[], ): Map => { const categoryColors = new Map(); + + // cat_1 key is a hardcoded key that allows access to a colour from a categoryless scatterchart. The colour is set to the first one passed in - default is blue if no custom colour provided. + if (categories.length === 0) { + categoryColors.set("cat_1", colors[0]); + } + categories.forEach((category, idx) => { categoryColors.set(category, colors[idx % colors.length]); }); diff --git a/src/stories/chart-elements/ScatterChart.stories.tsx b/src/stories/chart-elements/ScatterChart.stories.tsx index 64ffda912..05e132965 100644 --- a/src/stories/chart-elements/ScatterChart.stories.tsx +++ b/src/stories/chart-elements/ScatterChart.stories.tsx @@ -203,3 +203,63 @@ export const AxisLabels: Story = { yAxisLabel: "Amount (USD)", }, }; + +export const NoCategory: Story = { + args: { + x: "x", + y: "y", + size: "z", + category: undefined, + data, + className: "h-72", + }, +}; + +export const NoCategoryOtherColors: Story = { + args: { + x: "x", + y: "y", + size: "z", + category: undefined, + data, + className: "h-72", + colors: ["purple"], + }, +}; + +export const NoCategoryOtherColorsCustomTooltip: Story = { + args: { + x: "x", + y: "y", + size: "z", + category: undefined, + data, + className: "h-72", + colors: ["green"], + customTooltip: (props: CustomTooltipProps) => { + const { payload, active, label } = props; + if (!active || !payload) return null; + + return ( +
+
+
+
+

{label}

+ {payload.map((payloadItem: any, index: number) => ( +
+

+ {payloadItem.name} +

+

+ {payloadItem.value} +

+
+ ))} +
+
+
+ ); + }, + }, +}; From fc448bf6569ddb7e4652ae7f38641235cd6e796a Mon Sep 17 00:00:00 2001 From: danor1 Date: Wed, 4 Sep 2024 12:31:56 +0100 Subject: [PATCH 44/48] chore: remove console logs --- src/lib/utils.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/utils.tsx b/src/lib/utils.tsx index a8a93940f..63c5be294 100644 --- a/src/lib/utils.tsx +++ b/src/lib/utils.tsx @@ -79,11 +79,8 @@ const getIsArbitraryColor = (color: Color | string) => color.includes("#") || color.includes("--") || color.includes("rgb"); export function getColorClassNames(color: Color | string, shade?: number): ColorClassNames { - console.log("color (outside if): ", color); const isBaseColor = getIsBaseColor(color); - console.log("isBaseColor: ", isBaseColor); if (color === "white" || color === "black" || color === "transparent" || !shade || !isBaseColor) { - console.log("color: ", color); const unshadedColor = !getIsArbitraryColor(color) ? color : `[${color}]`; return { bgColor: `bg-${unshadedColor} dark:bg-${unshadedColor}`, From 38ee252590af8deed318444573a6eabff7b8dd22 Mon Sep 17 00:00:00 2001 From: danor1 Date: Thu, 5 Sep 2024 11:41:14 +0100 Subject: [PATCH 45/48] fix: custom colours --- .../chart-elements/ScatterChart.stories.tsx | 14 +++++++++++++- tailwind.config.js | 19 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/stories/chart-elements/ScatterChart.stories.tsx b/src/stories/chart-elements/ScatterChart.stories.tsx index 05e132965..3643b32fd 100644 --- a/src/stories/chart-elements/ScatterChart.stories.tsx +++ b/src/stories/chart-elements/ScatterChart.stories.tsx @@ -227,6 +227,18 @@ export const NoCategoryOtherColors: Story = { }, }; +export const CategoryCustomColors: Story = { + args: { + x: "x", + y: "y", + size: "z", + category: "location", + data, + className: "h-72", + colors: ["#32a852", "#fcba03", "orange-600", "blue-400"], + }, +}; + export const NoCategoryOtherColorsCustomTooltip: Story = { args: { x: "x", @@ -235,7 +247,7 @@ export const NoCategoryOtherColorsCustomTooltip: Story = { category: undefined, data, className: "h-72", - colors: ["green"], + colors: ["#fcba03"], customTooltip: (props: CustomTooltipProps) => { const { payload, active, label } = props; if (!active || !payload) return null; diff --git a/tailwind.config.js b/tailwind.config.js index c4925406f..7abfa87e9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -123,7 +123,24 @@ module.exports = { }, // custom colors charts - ...["[#32a852]", "[#fcba03]"].flatMap((customColor) => [ + ...[ + "[#32a852]", + "[#fcba03]", + "[#22d3ee]", + "[#f87171]", + "[#fb923c]", + "[#4ade80]", + "[#2dd4bf]", + "[#60a5fa]", + "[#c084fc]", + "[#f472b6]", + "[#facc15]", + "[#a3e635]", + "[#818cf8]", + "[#a78bfa]", + "[#e879f9]", + "[#9ca3af]", + ].flatMap((customColor) => [ `bg-${customColor}`, `border-${customColor}`, `hover:bg-${customColor}`, From 0fb98a6a50b97cdb67641e3234a16a18f69c4aef Mon Sep 17 00:00:00 2001 From: danor1 Date: Thu, 7 Nov 2024 12:23:15 +0000 Subject: [PATCH 46/48] fix: remove opacity from barlist --- src/components/vis-elements/BarList/BarList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/vis-elements/BarList/BarList.tsx b/src/components/vis-elements/BarList/BarList.tsx index ee567f72c..f90f44ecb 100644 --- a/src/components/vis-elements/BarList/BarList.tsx +++ b/src/components/vis-elements/BarList/BarList.tsx @@ -99,7 +99,7 @@ function BarListInner(props: BarListProps, ref: React.ForwardedRef
Date: Thu, 7 Nov 2024 12:34:53 +0000 Subject: [PATCH 47/48] build: updated semantic release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16f0444ea..3bf2048c0 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-preserve-directives": "^0.1.1", "rollup-plugin-typescript-paths": "^1.4.0", - "semantic-release": "^22.0.8", + "semantic-release": "^24.1.0", "storybook": "^8.2.4", "storybook-source-link": "^4.0.1", "style-loader": "^3.3.3", From 9c0dcbde2fc129a57f5265da2c920959967b3233 Mon Sep 17 00:00:00 2001 From: danor1 Date: Fri, 8 Nov 2024 12:20:15 +0000 Subject: [PATCH 48/48] revert: barlist opacity --- src/components/vis-elements/BarList/BarList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/vis-elements/BarList/BarList.tsx b/src/components/vis-elements/BarList/BarList.tsx index f90f44ecb..ee567f72c 100644 --- a/src/components/vis-elements/BarList/BarList.tsx +++ b/src/components/vis-elements/BarList/BarList.tsx @@ -99,7 +99,7 @@ function BarListInner(props: BarListProps, ref: React.ForwardedRef