@taiv/ui 1.13.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons.d.ts +7 -1
- package/dist/assets/icons.d.ts.map +1 -1
- package/dist/assets/icons.js +6 -1
- package/dist/assets/svgs/GoogleIcon.d.ts +5 -0
- package/dist/assets/svgs/GoogleIcon.d.ts.map +1 -0
- package/dist/assets/svgs/GoogleIcon.js +2 -0
- package/dist/components/Data/Cards/ChartCard/ChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/ChartCard/ChartCard.js +3 -2
- package/dist/components/Data/Cards/PieChartCard/PieChartCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/PieChartCard/PieChartCard.js +2 -1
- package/dist/components/Data/Cards/StatsCard/StatsCard.d.ts.map +1 -1
- package/dist/components/Data/Cards/StatsCard/StatsCard.js +2 -1
- package/dist/components/Data/Chart/Chart.d.ts.map +1 -1
- package/dist/components/Data/Chart/Chart.js +5 -4
- package/dist/components/Data/Chart/Chart.stories.d.ts.map +1 -1
- package/dist/components/Data/Chart/Chart.stories.js +6 -5
- package/dist/components/Data/CheckboxTable/CheckboxTable.d.ts.map +1 -1
- package/dist/components/Data/CheckboxTable/CheckboxTable.js +15 -14
- package/dist/components/Data/PieChart/PieChart.d.ts.map +1 -1
- package/dist/components/Data/PieChart/PieChart.js +4 -3
- package/dist/components/Data/PieChart/PieChart.stories.d.ts.map +1 -1
- package/dist/components/Data/PieChart/PieChart.stories.js +4 -3
- package/dist/components/Data/Progress/Progress.stories.d.ts.map +1 -1
- package/dist/components/Data/Progress/Progress.stories.js +7 -6
- package/dist/components/Data/RemovableItemList/RemovableItemList.d.ts.map +1 -1
- package/dist/components/Data/RemovableItemList/RemovableItemList.js +4 -3
- package/dist/components/Info/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Info/Badge/Badge.stories.js +5 -4
- package/dist/components/Info/Badge/sizes.d.ts.map +1 -1
- package/dist/components/Info/Badge/sizes.js +7 -6
- package/dist/components/Info/Badge/variants.d.ts.map +1 -1
- package/dist/components/Info/Badge/variants.js +3 -2
- package/dist/components/Info/InfoCard/InfoCard.d.ts.map +1 -1
- package/dist/components/Info/InfoCard/InfoCard.js +2 -1
- package/dist/components/Info/Modals/FormModal/FormModal.d.ts.map +1 -1
- package/dist/components/Info/Modals/FormModal/FormModal.js +12 -11
- package/dist/components/Info/Modals/FormModal/FormModal.stories.js +11 -11
- package/dist/components/Info/Modals/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modal/Modal.js +7 -6
- package/dist/components/Info/Modals/Modal/Modal.stories.js +1 -1
- package/dist/components/Info/Modals/Modals.stories.d.ts.map +1 -1
- package/dist/components/Info/Modals/Modals.stories.js +4 -3
- package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.d.ts.map +1 -1
- package/dist/components/Info/Notifications/NotificationProvider/NotificationProvider.js +7 -6
- package/dist/components/Info/Notifications/Notifications.stories.d.ts.map +1 -1
- package/dist/components/Info/Notifications/Notifications.stories.js +3 -2
- package/dist/components/Info/Tooltips/FormulaTooltip/FormulaTooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/FormulaTooltip/FormulaTooltip.js +2 -1
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.d.ts +4 -4
- package/dist/components/Info/Tooltips/InfoTooltip/InfoTooltip.js +4 -4
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Info/Tooltips/Tooltip/Tooltip.js +2 -1
- package/dist/components/Inputs/Buttons/Button/Button.js +2 -2
- package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/Button.stories.js +5 -4
- package/dist/components/Inputs/Buttons/Button/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/Button/sizes.js +4 -3
- package/dist/components/Inputs/Buttons/IconButton/IconButton.js +2 -2
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +7 -6
- package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/IconButton/sizes.js +4 -3
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.d.ts +35 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.js +37 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.d.ts +14 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.d.ts.map +1 -0
- package/dist/components/Inputs/Buttons/SSOButton/SSOButton.stories.js +121 -0
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.js +4 -3
- package/dist/components/Inputs/Buttons/shared/variants.d.ts +29 -29
- package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -1
- package/dist/components/Inputs/Buttons/shared/variants.js +6 -5
- package/dist/components/Inputs/Controls/Checkbox/Checkbox.stories.js +3 -3
- package/dist/components/Inputs/Controls/Radio/Radio.js +1 -1
- package/dist/components/Inputs/Controls/Radio/Radio.stories.js +3 -3
- package/dist/components/Inputs/Controls/RadioList/RadioList.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.js +3 -2
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/RadioList/RadioList.stories.js +3 -2
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.js +6 -5
- package/dist/components/Inputs/Controls/Toggle/Toggle.d.ts +4 -4
- package/dist/components/Inputs/Controls/Toggle/Toggle.js +5 -5
- package/dist/components/Inputs/Controls/Toggle/Toggle.stories.js +4 -4
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.js +5 -4
- package/dist/components/Inputs/Dates/DatePicker/DatePicker.stories.js +4 -4
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.js +6 -5
- package/dist/components/Inputs/Dropdowns/CascadingSelect/CascadingSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.js +3 -3
- package/dist/components/Inputs/Dropdowns/FontSelect/FontSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.js +7 -6
- package/dist/components/Inputs/Dropdowns/MultiSelect/MultiSelect.stories.js +5 -5
- package/dist/components/Inputs/Dropdowns/Select/Select.d.ts.map +1 -1
- package/dist/components/Inputs/Dropdowns/Select/Select.js +6 -5
- package/dist/components/Inputs/Dropdowns/Select/Select.stories.js +4 -4
- package/dist/components/Inputs/Dropdowns/shared/sizes.js +18 -18
- package/dist/components/Inputs/Sliders/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Inputs/Sliders/Slider/Slider.js +15 -14
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.d.ts.map +1 -1
- package/dist/components/Inputs/Sliders/VolumeSlider/VolumeSlider.js +5 -4
- package/dist/components/Inputs/Sliders/shared/sizes.d.ts +9 -9
- package/dist/components/Inputs/Sliders/shared/sizes.js +9 -9
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +5 -4
- package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +10 -10
- package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +8 -8
- package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +4 -3
- package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +6 -5
- package/dist/components/Inputs/TextInputs/TextArea/TextArea.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +5 -5
- package/dist/components/Inputs/TextInputs/TextInput/TextInput.stories.js +5 -5
- package/dist/components/Inputs/TextInputs/shared/sizes.d.ts +6 -6
- package/dist/components/Inputs/TextInputs/shared/sizes.js +3 -3
- package/dist/components/Layout/Box/Box.stories.d.ts.map +1 -1
- package/dist/components/Layout/Box/Box.stories.js +3 -2
- package/dist/components/Layout/Card/Card.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.js +1 -1
- package/dist/components/Layout/Card/Card.stories.d.ts.map +1 -1
- package/dist/components/Layout/Card/Card.stories.js +2 -1
- package/dist/components/Layout/Center/Center.stories.d.ts.map +1 -1
- package/dist/components/Layout/Center/Center.stories.js +2 -1
- package/dist/components/Layout/Frame/Frame.js +1 -1
- package/dist/components/Layout/Frame/Frame.stories.d.ts.map +1 -1
- package/dist/components/Layout/Frame/Frame.stories.js +3 -2
- package/dist/components/Layout/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/components/Layout/Grid/Grid.stories.js +2 -1
- package/dist/components/Layout/Group/Group.stories.d.ts.map +1 -1
- package/dist/components/Layout/Group/Group.stories.js +5 -4
- package/dist/components/Layout/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/Layout/Loader/Loader.stories.js +3 -2
- package/dist/components/Layout/SectionCard/SectionCard.js +1 -1
- package/dist/components/Layout/SectionCard/SectionCard.stories.js +2 -2
- package/dist/components/Layout/Stack/Stack.stories.d.ts.map +1 -1
- package/dist/components/Layout/Stack/Stack.stories.js +3 -2
- package/dist/components/Layout/Table/Table.stories.d.ts.map +1 -1
- package/dist/components/Layout/Table/Table.stories.js +4 -3
- package/dist/components/Layout/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.js +5 -4
- package/dist/components/Layout/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Layout/Tabs/Tabs.stories.js +6 -5
- package/dist/components/Misc/IconBadge/IconBadge.js +1 -1
- package/dist/components/Misc/Stepper/Step.d.ts +16 -0
- package/dist/components/Misc/Stepper/Step.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Step.js +7 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts +477 -0
- package/dist/components/Misc/Stepper/Step.stories.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Step.stories.js +83 -0
- package/dist/components/Misc/Stepper/Stepper.d.ts +10 -0
- package/dist/components/Misc/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Stepper.js +72 -0
- package/dist/components/Misc/Stepper/Stepper.stories.d.ts +13 -0
- package/dist/components/Misc/Stepper/Stepper.stories.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/Stepper.stories.js +126 -0
- package/dist/components/Misc/Stepper/variants.d.ts +54 -0
- package/dist/components/Misc/Stepper/variants.d.ts.map +1 -0
- package/dist/components/Misc/Stepper/variants.js +48 -0
- package/dist/components/Typography/CollapsibleText/CollapsibleText.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.js +2 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.stories.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleText/CollapsibleText.stories.js +4 -3
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.js +2 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.d.ts.map +1 -1
- package/dist/components/Typography/CollapsibleTitle/CollapsibleTitle.stories.js +4 -3
- package/dist/components/Typography/Formula/Formula.d.ts.map +1 -1
- package/dist/components/Typography/Formula/Formula.js +3 -2
- package/dist/components/Typography/Formula/Formula.stories.js +2 -2
- package/dist/components/Typography/Fraction/Fraction.d.ts.map +1 -1
- package/dist/components/Typography/Fraction/Fraction.js +2 -1
- package/dist/components/Typography/Fraction/Fraction.stories.d.ts.map +1 -1
- package/dist/components/Typography/Fraction/Fraction.stories.js +2 -1
- package/dist/components/Typography/Text/Text.stories.js +1 -1
- package/dist/components/Typography/Title/Title.stories.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/constants/breakpoints.d.ts +1 -1
- package/dist/constants/breakpoints.js +1 -1
- package/dist/constants/font.js +10 -10
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/spacing.d.ts +12 -0
- package/dist/constants/spacing.d.ts.map +1 -0
- package/dist/constants/spacing.js +11 -0
- package/dist/docs/AIGeneratedBanner.js +1 -1
- package/dist/docs/design/Colors.stories.d.ts.map +1 -1
- package/dist/docs/design/Colors.stories.js +6 -5
- package/dist/docs/design/Spacing.stories.d.ts +6 -0
- package/dist/docs/design/Spacing.stories.d.ts.map +1 -0
- package/dist/docs/design/Spacing.stories.js +24 -0
- package/dist/hooks/useConfirmationModal.d.ts.map +1 -1
- package/dist/hooks/useConfirmationModal.js +10 -9
- package/dist/hooks/useInfoModal.d.ts.map +1 -1
- package/dist/hooks/useInfoModal.js +10 -9
- package/dist/hooks/useMediaQuery.d.ts +2 -2
- package/dist/hooks/useMediaQuery.js +6 -6
- package/package.json +38 -27
package/dist/assets/icons.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
export { GoogleIcon } from './svgs/GoogleIcon';
|
|
1
2
|
export declare const actions: (string | import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>)[][];
|
|
2
3
|
export declare const controls: (string | import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>)[][];
|
|
3
4
|
export declare const feedback: (string | import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>)[][];
|
|
4
5
|
export declare const navigation: string[][];
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const ssoProviders: (string | (({ size }: {
|
|
7
|
+
size?: number;
|
|
8
|
+
}) => import("react").ReactSVGElement))[][];
|
|
9
|
+
export declare const icons: ((string | import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>)[] | (string | (({ size }: {
|
|
10
|
+
size?: number;
|
|
11
|
+
}) => import("react").ReactSVGElement))[])[];
|
|
6
12
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/assets/icons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/assets/icons.ts"],"names":[],"mappings":"AAsBE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,eAAO,MAAM,OAAO,kJAerB,CAAC;AAEF,eAAO,MAAM,QAAQ,kJAYpB,CAAC;AAEA,eAAO,MAAM,QAAQ,kJAWpB,CAAC;AAEF,eAAO,MAAM,UAAU,YAYtB,CAAC;AAEF,eAAO,MAAM,YAAY;QA/EtB,CAAC;2CAiFH,CAAC;AAEF,eAAO,MAAM,KAAK;QAnFf,CAAC;4CAmFuF,CAAC"}
|
package/dist/assets/icons.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IconArrowDown, IconArrowUp, IconCodeVariablePlus, IconCaretDownFilled, IconCaretUpFilled, IconCircleFilled, IconDeviceTv, IconEdit, IconHistory, IconPlus, IconRefresh, IconReload, IconSwitchHorizontal, IconTerminal2, IconTransfer, IconTrash, IconVolume, IconVolume2, IconVolume3, } from '@tabler/icons-react';
|
|
2
2
|
import { colors } from '../constants/colors';
|
|
3
|
+
export { GoogleIcon } from './svgs/GoogleIcon';
|
|
4
|
+
import { GoogleIcon } from './svgs/GoogleIcon';
|
|
3
5
|
export const actions = [
|
|
4
6
|
[IconPlus, 'Add'],
|
|
5
7
|
[IconTrash, 'Delete'],
|
|
@@ -54,4 +56,7 @@ export const navigation = [
|
|
|
54
56
|
['fas fa-external-link-square-alt', 'Open External Link'],
|
|
55
57
|
['fas fa-sign-out-alt', 'Sign Out'],
|
|
56
58
|
];
|
|
57
|
-
export const
|
|
59
|
+
export const ssoProviders = [
|
|
60
|
+
[GoogleIcon, 'Google'],
|
|
61
|
+
];
|
|
62
|
+
export const icons = [...actions, ...controls, ...feedback, ...navigation, ...ssoProviders];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleIcon.d.ts","sourceRoot":"","sources":["../../../src/assets/svgs/GoogleIcon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,UAAU,GAAI,UAAe;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,0BAMxD,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const GoogleIcon = ({ size = 18 }) => React.createElement('svg', { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', width: size, height: size }, React.createElement('path', { fill: '#4285F4', d: 'M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z' }), React.createElement('path', { fill: '#34A853', d: 'M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z' }), React.createElement('path', { fill: '#FBBC05', d: 'M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z' }), React.createElement('path', { fill: '#EA4335', d: 'M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z' }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/ChartCard/ChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAS,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/ChartCard/ChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAS,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQtD,MAAM,WAAW,cAAe,SAAQ,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkB9C,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { Title } from '../../../Typography/Title/Title';
|
|
|
6
6
|
import { Text } from '../../../Typography/Text/Text';
|
|
7
7
|
import { InfoTooltip } from '../../../Info/Tooltips/InfoTooltip/InfoTooltip';
|
|
8
8
|
import { Group } from '@mantine/core';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import { spacing } from '../../../../constants/spacing';
|
|
10
|
+
export const ChartCard = ({ title, subtitle, series, yAxisFormat, xAxisFormat, showLegend, loading, height = '300px', tooltip, ...cardProps }) => {
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(Card, { ...cardProps, h: height, children: _jsxs(Stack, { gap: spacing.xl, h: "100%", w: "100%", children: [_jsxs(Stack, { gap: spacing.xs, children: [_jsxs(Group, { position: "apart", children: [_jsx(Title, { variant: "cardHeader", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip, maxWidth: "600px" })] }), subtitle && _jsx(Text, { variant: "label", children: subtitle })] }), _jsx(Chart, { series: series, yAxisFormat: yAxisFormat, xAxisFormat: xAxisFormat, showLegend: showLegend, loading: loading })] }) }), _jsx("style", { children: `.recharts-surface { outline: none; }` })] }));
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChartCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/PieChartCard/PieChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAY,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"PieChartCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/PieChartCard/PieChartCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAY,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQlE,MAAM,WAAW,iBAAkB,SAAQ,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyCpD,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { Title } from '../../../Typography/Title/Title';
|
|
|
6
6
|
import { Text } from '../../../Typography/Text/Text';
|
|
7
7
|
import { InfoTooltip } from '../../../Info/Tooltips/InfoTooltip/InfoTooltip';
|
|
8
8
|
import { Group } from '@mantine/core';
|
|
9
|
+
import { spacing } from '../../../../constants/spacing';
|
|
9
10
|
export const PieChartCard = ({ title, subtitle, data, tooltip, height = '100%', showLegend, innerRadius, outerRadius, paddingAngle, format = 'percentage', loading, centerContent, ...cardProps }) => {
|
|
10
|
-
return (_jsxs(_Fragment, { children: [_jsx(Card, { ...cardProps, h: height, children: _jsxs(Stack, { gap: "
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(Card, { ...cardProps, h: height, children: _jsxs(Stack, { gap: "0px", h: "100%", w: "100%", children: [_jsxs(Stack, { gap: spacing.xs, children: [_jsxs(Group, { children: [_jsx(Title, { variant: "cardHeader", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip, maxWidth: "600px" })] }), subtitle && _jsx(Text, { variant: "label", children: subtitle })] }), _jsx(PieChart, { data: data, showLegend: showLegend, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, format: format, loading: loading, centerContent: centerContent })] }) }), _jsx("style", { children: `.recharts-surface { outline: none; }` })] }));
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/StatsCard/StatsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAO5D,OAAO,EAAE,UAAU,EAAoB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"StatsCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/Data/Cards/StatsCard/StatsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAO5D,OAAO,EAAE,UAAU,EAAoB,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGrD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,OAAO,UAAU,CAAC;IACpC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,SAAS,GAAI,mHAAgJ,cAAc,4CA4DvL,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { Stack } from '../../../Layout/Stack/Stack';
|
|
|
8
8
|
import { IconBadge } from '../../../Misc/IconBadge/IconBadge';
|
|
9
9
|
import { success, neutral } from '../../../../constants/colors';
|
|
10
10
|
import { formats } from '../../../../constants/data';
|
|
11
|
+
import { spacing } from '../../../../constants/spacing';
|
|
11
12
|
export const StatsCard = ({ value, format = 'decimal', isDelta = false, title, description, increaseDescription, icon: Icon, iconColor = 'blue', tooltip, ...cardProps }) => {
|
|
12
13
|
const getDelta = () => {
|
|
13
14
|
const currentDirection = isDelta ? (value > 0 ? 'positive' : value < 0 ? 'negative' : null) : null;
|
|
@@ -34,5 +35,5 @@ export const StatsCard = ({ value, format = 'decimal', isDelta = false, title, d
|
|
|
34
35
|
result = `${config.prefix}${result}${config.suffix}`;
|
|
35
36
|
return result;
|
|
36
37
|
};
|
|
37
|
-
return (_jsx(Card, { bg: neutral[25], animate: true, ...cardProps, children: _jsxs(Stack, { gap:
|
|
38
|
+
return (_jsx(Card, { bg: neutral[25], animate: true, ...cardProps, children: _jsxs(Stack, { gap: spacing.lg, children: [_jsxs(Stack, { gap: spacing.xxs, children: [_jsxs(Group, { position: "apart", children: [_jsx(Title, { size: "3xl", weight: "bold", children: formatValue() }), Icon && _jsx(IconBadge, { icon: Icon, color: iconColor })] }), _jsxs(Group, { gap: spacing.sm, children: [_jsx(Title, { variant: "cardHeader", color: "#6D6D6D", weight: "medium", children: title }), tooltip && _jsx(InfoTooltip, { text: tooltip, maxWidth: "600px" })] })] }), _jsxs(Stack, { gap: "0", children: [description && _jsx(Text, { variant: "label", children: description }), delta.showIncrementalText && increaseDescription && (_jsx(Text, { variant: "label", color: delta.color, children: increaseDescription }))] })] }) }));
|
|
38
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKlD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,KAAK,WAAW,GAAG,MAAM,OAAO,OAAO,CAAC;AAExC,UAAU,UAAU;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAwLtC,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { Area, Bar, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContai
|
|
|
8
8
|
import { getChartFormatter } from '../../../utils/charts';
|
|
9
9
|
import { fontStyle } from '../../../constants/font';
|
|
10
10
|
import { primary, neutral } from '../../../constants/colors';
|
|
11
|
+
import { spacing } from '../../../constants/spacing';
|
|
11
12
|
import { createStyles } from '@mantine/core';
|
|
12
13
|
export const Chart = ({ series, yAxisFormat = 'decimal', xAxisFormat = 'string', showLegend = true, loading = false, height = '100%' }) => {
|
|
13
14
|
const parseFormat = (format) => {
|
|
@@ -42,16 +43,16 @@ export const Chart = ({ series, yAxisFormat = 'decimal', xAxisFormat = 'string',
|
|
|
42
43
|
if (active && payload && payload.length) {
|
|
43
44
|
return (_jsx(Box, { sx: {
|
|
44
45
|
backgroundColor: 'white',
|
|
45
|
-
padding: '
|
|
46
|
+
padding: '10px',
|
|
46
47
|
border: `1px solid ${neutral[100]}`,
|
|
47
48
|
borderRadius: '8px',
|
|
48
49
|
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
49
|
-
}, children: _jsxs(Stack, { gap:
|
|
50
|
+
}, children: _jsxs(Stack, { gap: spacing.xxs, children: [_jsx(Text, { weight: "semibold", color: neutral[300], children: formatXAxisValue(label) }), payload.map((entry) => (_jsxs(Group, { gap: spacing.xs, children: [_jsx("div", { style: {
|
|
50
51
|
width: '8px',
|
|
51
52
|
height: '8px',
|
|
52
53
|
borderRadius: '50%',
|
|
53
54
|
backgroundColor: entry.color,
|
|
54
|
-
} }), _jsxs(Group, { gap:
|
|
55
|
+
} }), _jsxs(Group, { gap: spacing.xxs, children: [_jsxs(Text, { variant: "label", color: neutral[300], children: [entry.name, ":"] }), _jsx(Text, { variant: "label", children: formatYAxisValue(entry.value) })] })] }, entry.name)))] }) }));
|
|
55
56
|
}
|
|
56
57
|
return null;
|
|
57
58
|
};
|
|
@@ -88,5 +89,5 @@ export const Chart = ({ series, yAxisFormat = 'decimal', xAxisFormat = 'string',
|
|
|
88
89
|
else {
|
|
89
90
|
return _jsx(Line, { type: "monotone", dataKey: s.name, stroke: s.color || primary[200], strokeWidth: 2, dot: false, style: { outline: 'none' } }, s.name);
|
|
90
91
|
}
|
|
91
|
-
}), _jsx(Tooltip, { content: getTooltip, cursor: series.some((s) => s.type === 'bar') ? false : true }), showLegend && (_jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '
|
|
92
|
+
}), _jsx(Tooltip, { content: getTooltip, cursor: series.some((s) => s.type === 'bar') ? false : true }), showLegend && (_jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '6px' }, formatter: (value) => (_jsx(Text, { variant: "label", sx: { color: neutral[300], display: 'inline', whiteSpace: 'nowrap' }, children: value })) }))] }) }) }) })) }));
|
|
92
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Chart/Chart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA8D1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA0D1B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAmBhC,CAAC;AAgBF,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC;AAgBF,eAAO,MAAM,mBAAmB,EAAE,KAuCjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { formats } from "../../../constants/data";
|
|
3
3
|
import { primary, success, warning } from "../../../constants/colors";
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
4
5
|
import { Box } from "../../Layout/Box/Box";
|
|
5
6
|
import { Group } from "../../Layout/Group/Group";
|
|
6
7
|
import { Stack } from "../../Layout/Stack/Stack";
|
|
@@ -126,7 +127,7 @@ export const Default = {
|
|
|
126
127
|
render: (args) => (_jsx(Box, { w: "100%", maw: 720, h: 360, children: _jsx(Chart, { ...args }) })),
|
|
127
128
|
};
|
|
128
129
|
export const SeriesTypes = {
|
|
129
|
-
render: () => (_jsxs(Stack, { gap:
|
|
130
|
+
render: () => (_jsxs(Stack, { gap: spacing.xl, children: [_jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: "integer" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleAreaSeries, height: "100%", yAxisFormat: "currency" }) }), _jsx(Box, { w: "100%", h: 280, children: _jsx(Chart, { series: sampleBarSeries, height: "100%", yAxisFormat: "integer" }) })] })),
|
|
130
131
|
};
|
|
131
132
|
export const MultiSeries = {
|
|
132
133
|
render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMultiSeries, height: "100%", yAxisFormat: "decimal" }) })),
|
|
@@ -135,10 +136,10 @@ export const MixedBarAndLine = {
|
|
|
135
136
|
render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(Chart, { series: sampleMixedSeries, height: "100%", yAxisFormat: "integer" }) })),
|
|
136
137
|
};
|
|
137
138
|
export const YAxisFormats = {
|
|
138
|
-
render: () => (_jsx(Group, { align: "flex-start", gap:
|
|
139
|
+
render: () => (_jsx(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: ["integer", "decimal", "currency", "percentage", "multiple"].map((fmt) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: fmt, showLegend: false }) }, fmt))) })),
|
|
139
140
|
};
|
|
140
141
|
export const YAxisDecimalPlaces = {
|
|
141
|
-
render: () => (_jsx(Group, { align: "flex-start", gap:
|
|
142
|
+
render: () => (_jsx(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: [1, 2, 3].map((dp) => (_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: sampleLineSeries, height: "100%", yAxisFormat: { format: "decimal", options: { decimalPlaces: dp } }, showLegend: false }) }, dp))) })),
|
|
142
143
|
};
|
|
143
144
|
const largeValueSeries = [
|
|
144
145
|
{
|
|
@@ -154,7 +155,7 @@ const largeValueSeries = [
|
|
|
154
155
|
},
|
|
155
156
|
];
|
|
156
157
|
export const YAxisTruncation = {
|
|
157
|
-
render: () => (_jsxs(Group, { align: "flex-start", gap:
|
|
158
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
|
|
158
159
|
format: "decimal",
|
|
159
160
|
options: { truncateAt: "thousand" },
|
|
160
161
|
}, showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: largeValueSeries, height: "100%", yAxisFormat: {
|
|
@@ -176,7 +177,7 @@ const numericKeySeries = [
|
|
|
176
177
|
},
|
|
177
178
|
];
|
|
178
179
|
export const XAxisNumericFormats = {
|
|
179
|
-
render: () => (_jsxs(Group, { align: "flex-start", gap:
|
|
180
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: "integer", yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: { format: "currency", options: { decimalPlaces: 0 } }, yAxisFormat: "integer", showLegend: false }) }), _jsx(Box, { w: 280, h: 220, children: _jsx(Chart, { series: numericKeySeries, height: "100%", xAxisFormat: {
|
|
180
181
|
format: "decimal",
|
|
181
182
|
options: { truncateAt: "thousand" },
|
|
182
183
|
}, yAxisFormat: "integer", showLegend: false }) })] })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxTable.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/CheckboxTable/CheckboxTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxTable.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/CheckboxTable/CheckboxTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,GAAI,uFAAgH,kBAAkB,4CAuHxJ,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -8,22 +8,23 @@ import { Stack } from '../../Layout/Stack/Stack';
|
|
|
8
8
|
import { Title } from '../../Typography/Title/Title';
|
|
9
9
|
import { neutral } from '../../../constants/colors';
|
|
10
10
|
import { fontStyle } from '../../../constants/font';
|
|
11
|
+
import { spacing } from '../../../constants/spacing';
|
|
11
12
|
const CheckboxTable = ({ columns, data, className = 'none', onRowClick, title, subtitle, showColumnTitles = false, outlines = false }) => {
|
|
12
13
|
const isMobile = useMobile();
|
|
13
14
|
const style = {
|
|
14
15
|
container: {
|
|
15
16
|
borderRadius: '8px',
|
|
16
17
|
border: `1px solid ${neutral[50]}`,
|
|
17
|
-
padding:
|
|
18
|
+
padding: spacing.sm,
|
|
18
19
|
backgroundColor: 'white',
|
|
19
20
|
},
|
|
20
21
|
header: {
|
|
21
|
-
padding:
|
|
22
|
+
padding: spacing.lg,
|
|
22
23
|
minWidth: '0',
|
|
23
24
|
},
|
|
24
25
|
columns: {
|
|
25
|
-
paddingTop:
|
|
26
|
-
paddingLeft: '
|
|
26
|
+
paddingTop: spacing.lg,
|
|
27
|
+
paddingLeft: '36px',
|
|
27
28
|
whiteSpace: 'nowrap',
|
|
28
29
|
overflow: 'hidden',
|
|
29
30
|
},
|
|
@@ -31,29 +32,29 @@ const CheckboxTable = ({ columns, data, className = 'none', onRowClick, title, s
|
|
|
31
32
|
justifyContent: isMobile ? 'flex-start' : 'center',
|
|
32
33
|
...fontStyle['body'],
|
|
33
34
|
color: neutral[300],
|
|
34
|
-
padding:
|
|
35
|
-
minWidth: '
|
|
35
|
+
padding: `${spacing.sm} ${spacing.lg}`,
|
|
36
|
+
minWidth: '100px',
|
|
36
37
|
},
|
|
37
38
|
tableBody: {
|
|
38
|
-
gap: isMobile ? '
|
|
39
|
+
gap: isMobile ? '5px' : '2.5px',
|
|
39
40
|
minWidth: '0',
|
|
40
41
|
},
|
|
41
42
|
tableRow: {
|
|
42
|
-
padding: isMobile ? '
|
|
43
|
+
padding: isMobile ? '8px 16px' : '4px 32px',
|
|
43
44
|
backgroundColor: '#FFFFFF',
|
|
44
45
|
minWidth: '0',
|
|
45
|
-
gap: isMobile ? '
|
|
46
|
+
gap: isMobile ? '24px' : '0',
|
|
46
47
|
...(outlines && { borderTop: `1px solid ${neutral[50]}` }),
|
|
47
48
|
},
|
|
48
49
|
contentContainer: {
|
|
49
50
|
flex: 1,
|
|
50
51
|
flexDirection: (isMobile ? 'column' : 'row'),
|
|
51
|
-
gap:
|
|
52
|
+
gap: spacing.xxs,
|
|
52
53
|
minWidth: 0,
|
|
53
54
|
},
|
|
54
55
|
item: {
|
|
55
56
|
justifyContent: isMobile ? 'flex-start' : 'space-between',
|
|
56
|
-
minWidth: isMobile ? '0' : '
|
|
57
|
+
minWidth: isMobile ? '0' : '100px',
|
|
57
58
|
...fontStyle['body'],
|
|
58
59
|
fontWeight: 400,
|
|
59
60
|
color: neutral[200],
|
|
@@ -68,14 +69,14 @@ const CheckboxTable = ({ columns, data, className = 'none', onRowClick, title, s
|
|
|
68
69
|
}, children: column.label }, column.key))) }));
|
|
69
70
|
};
|
|
70
71
|
const renderRow = (row) => {
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsx(Center, { mr: isMobile ? 0 : '
|
|
72
|
+
return (_jsxs(_Fragment, { children: [_jsx(Center, { mr: isMobile ? 0 : '32px', ml: isMobile ? 0 : '-16px', children: _jsx(Checkbox, { checked: row.checked, onChange: () => onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row) }) }), _jsx(Group, { style: style.contentContainer, children: columns === null || columns === void 0 ? void 0 : columns.map((column, index) => {
|
|
72
73
|
const text = row[column.key] || '';
|
|
73
74
|
const className = column.className || '';
|
|
74
75
|
return (_jsx(Box, { style: {
|
|
75
76
|
...style.item,
|
|
76
77
|
width: column.width || '100%',
|
|
77
|
-
flex: isMobile ? 'none' : column.key === 'volume' ? '1 1
|
|
78
|
-
minWidth: isMobile ? '0' : column.key === 'volume' ? '
|
|
78
|
+
flex: isMobile ? 'none' : column.key === 'volume' ? '1 1 300px' : '0 0 auto',
|
|
79
|
+
minWidth: isMobile ? '0' : column.key === 'volume' ? '300px' : '100px',
|
|
79
80
|
...(className && { className }),
|
|
80
81
|
}, children: text }, index));
|
|
81
82
|
}) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/PieChart/PieChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/PieChart/PieChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,OAAO,aAAa,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,yBAAyB,CAAC;CAC3C;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwH5C,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { Stack } from '../../Layout/Stack/Stack';
|
|
|
8
8
|
import { Box } from '../../Layout/Box/Box';
|
|
9
9
|
import { neutral } from '../../../constants/colors';
|
|
10
10
|
import { textStyle } from '../../../constants/font';
|
|
11
|
+
import { spacing } from '../../../constants/spacing';
|
|
11
12
|
import { getChartFormatter } from '../../../utils/charts';
|
|
12
13
|
export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadius = 100, paddingAngle = 0, format = 'percentage', loading = false, centerContent, height = '100%', }) => {
|
|
13
14
|
const hasData = data && data.length > 0;
|
|
@@ -22,7 +23,7 @@ export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadiu
|
|
|
22
23
|
if (active && payload && payload.length) {
|
|
23
24
|
return (_jsxs(Box, { sx: {
|
|
24
25
|
backgroundColor: 'white',
|
|
25
|
-
padding: '
|
|
26
|
+
padding: '10px',
|
|
26
27
|
border: `1px solid ${neutral[100]}`,
|
|
27
28
|
borderRadius: '8px',
|
|
28
29
|
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
@@ -33,11 +34,11 @@ export const PieChart = ({ data, showLegend = true, innerRadius = 80, outerRadiu
|
|
|
33
34
|
height: '8px',
|
|
34
35
|
borderRadius: '50%',
|
|
35
36
|
backgroundColor: entry.payload.color,
|
|
36
|
-
} }), _jsxs(Group, { gap:
|
|
37
|
+
} }), _jsxs(Group, { gap: spacing.xxs, children: [_jsxs(Text, { variant: "label", color: neutral[300], children: [entry.payload.key, ":"] }), _jsx(Text, { variant: "label", children: getChartFormatter(format)(entry.payload.value) })] })] }, entry.key)))] }));
|
|
37
38
|
}
|
|
38
39
|
return null;
|
|
39
40
|
};
|
|
40
|
-
return (_jsxs(_Fragment, { children: [loading || !hasData ? (_jsx(Center, { style: { height, backgroundColor: neutral[25], borderRadius: '8px' }, children: _jsx(Text, { variant: "label", color: neutral[200], children: loading ? 'Loading...' : 'No data available' }) })) : (_jsx(Center, { h: height, w: "100%", style: { position: 'relative' }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", style: { outline: 'none' }, children: _jsxs(RechartsPieChart, { style: { outline: 'none' }, children: [_jsxs(Pie, { data: transformedData, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, dataKey: "value", style: { outline: 'none' }, children: [_jsx(Label, { content: getCenterContent(), position: "center" }), data.map((entry, index) => (_jsx(Cell, { fill: entry.color, style: { outline: 'none' } }, `cell-${entry.key}`)))] }), _jsx(Tooltip, { content: getTooltip }), showLegend && _jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '
|
|
41
|
+
return (_jsxs(_Fragment, { children: [loading || !hasData ? (_jsx(Center, { style: { height, backgroundColor: neutral[25], borderRadius: '8px' }, children: _jsx(Text, { variant: "label", color: neutral[200], children: loading ? 'Loading...' : 'No data available' }) })) : (_jsx(Center, { h: height, w: "100%", style: { position: 'relative' }, children: _jsx(ResponsiveContainer, { width: "100%", height: "100%", style: { outline: 'none' }, children: _jsxs(RechartsPieChart, { style: { outline: 'none' }, children: [_jsxs(Pie, { data: transformedData, innerRadius: innerRadius, outerRadius: outerRadius, paddingAngle: paddingAngle, dataKey: "value", style: { outline: 'none' }, children: [_jsx(Label, { content: getCenterContent(), position: "center" }), data.map((entry, index) => (_jsx(Cell, { fill: entry.color, style: { outline: 'none' } }, `cell-${entry.key}`)))] }), _jsx(Tooltip, { content: getTooltip }), showLegend && _jsx(Legend, { iconType: "circle", iconSize: 8, wrapperStyle: { paddingTop: '6px' } })] }) }) })), _jsx("style", { children: `
|
|
41
42
|
.recharts-legend-item-text {
|
|
42
43
|
font-family: ${textStyle.label.fontFamily};
|
|
43
44
|
font-size: ${textStyle.label.fontSize};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/PieChart/PieChart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PieChart.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/PieChart/PieChart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAShD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,aAAa,CAmE7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA6B3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAoC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAW3B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { numberFormats } from "../../../constants/data";
|
|
3
3
|
import { primary, success, warning } from "../../../constants/colors";
|
|
4
|
+
import { spacing } from '../../../constants/spacing';
|
|
4
5
|
import { Box } from "../../Layout/Box/Box";
|
|
5
6
|
import { Group } from "../../Layout/Group/Group";
|
|
6
7
|
import { PieChart } from "./PieChart";
|
|
@@ -87,7 +88,7 @@ export const Default = {
|
|
|
87
88
|
render: (args) => (_jsx(Box, { w: "100%", maw: 480, h: 360, children: _jsx(PieChart, { ...args }) })),
|
|
88
89
|
};
|
|
89
90
|
export const Formats = {
|
|
90
|
-
render: () => (_jsx(Group, { align: "flex-start", gap:
|
|
91
|
+
render: () => (_jsx(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: ["integer", "decimal", "currency", "percentage", "multiple"].map((fmt) => (_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: fmt, height: "100%", showLegend: false }) }, fmt))) })),
|
|
91
92
|
};
|
|
92
93
|
export const WithCenterContent = {
|
|
93
94
|
render: () => (_jsx(Box, { w: "100%", maw: 480, h: 360, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", centerContent: {
|
|
@@ -97,7 +98,7 @@ export const WithCenterContent = {
|
|
|
97
98
|
} }) })),
|
|
98
99
|
};
|
|
99
100
|
export const DonutGeometry = {
|
|
100
|
-
render: () => (_jsxs(Group, { align: "flex-start", gap:
|
|
101
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", innerRadius: 0, outerRadius: 100, showLegend: false }) }), _jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", innerRadius: 80, outerRadius: 100, showLegend: false }) })] })),
|
|
101
102
|
};
|
|
102
103
|
export const PaddingAngle = {
|
|
103
104
|
name: "Slice gaps (paddingAngle)",
|
|
@@ -108,7 +109,7 @@ export const PaddingAngle = {
|
|
|
108
109
|
},
|
|
109
110
|
},
|
|
110
111
|
},
|
|
111
|
-
render: () => (_jsxs(Group, { align: "flex-start", gap:
|
|
112
|
+
render: () => (_jsxs(Group, { align: "flex-start", gap: spacing.lg, styles: { root: { flexWrap: "wrap" } }, children: [_jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", paddingAngle: 0, showLegend: false }) }), _jsx(Box, { w: 400, h: 400, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", paddingAngle: 8, showLegend: false }) })] })),
|
|
112
113
|
};
|
|
113
114
|
export const WithoutLegend = {
|
|
114
115
|
render: () => (_jsx(Box, { w: "100%", h: 320, children: _jsx(PieChart, { data: samplePieData, format: "percentage", height: "100%", showLegend: false }) })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Progress/Progress.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Progress.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/Progress/Progress.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CA6E/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KASpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAOnB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { primary, purple, success } from '../../../constants/colors';
|
|
3
|
+
import { spacing } from '../../../constants/spacing';
|
|
3
4
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
4
5
|
import { Progress } from './Progress';
|
|
5
6
|
const presetOptions = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
@@ -7,7 +8,7 @@ const meta = {
|
|
|
7
8
|
title: 'Components/Data/Progress',
|
|
8
9
|
component: Progress,
|
|
9
10
|
decorators: [
|
|
10
|
-
(Story) => (_jsx("div", { style: { width: '
|
|
11
|
+
(Story) => (_jsx("div", { style: { width: '250px' }, children: _jsx(Story, {}) })),
|
|
11
12
|
],
|
|
12
13
|
parameters: {
|
|
13
14
|
layout: 'centered',
|
|
@@ -88,16 +89,16 @@ export const Default = {
|
|
|
88
89
|
},
|
|
89
90
|
};
|
|
90
91
|
export const Values = {
|
|
91
|
-
render: () => (_jsxs(Stack, { spacing:
|
|
92
|
+
render: () => (_jsxs(Stack, { spacing: spacing.md, children: [_jsx(Progress, { value: 0, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 25, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 50, scale: "xl", cornerRadius: "xl" }), _jsx(Progress, { value: 100, scale: "xl", cornerRadius: "xl" })] })),
|
|
92
93
|
};
|
|
93
94
|
export const Scale = {
|
|
94
|
-
render: () => (_jsx(Stack, { spacing:
|
|
95
|
+
render: () => (_jsx(Stack, { spacing: spacing.md, children: presetOptions.map((preset) => (_jsx(Progress, { value: 60, scale: preset, cornerRadius: "md" }, preset))) })),
|
|
95
96
|
};
|
|
96
97
|
export const CornerRadius = {
|
|
97
|
-
render: () => (_jsx(Stack, { spacing:
|
|
98
|
+
render: () => (_jsx(Stack, { spacing: spacing.md, children: presetOptions.map((radius) => (_jsx(Progress, { value: 60, scale: "xl", cornerRadius: radius }, radius))) })),
|
|
98
99
|
};
|
|
99
100
|
export const Striped = {
|
|
100
|
-
render: () => (_jsx(Stack, { spacing:
|
|
101
|
+
render: () => (_jsx(Stack, { spacing: spacing.md, children: _jsx(Progress, { value: 55, scale: "xl", cornerRadius: "xl", striped: true }) })),
|
|
101
102
|
};
|
|
102
103
|
export const WithLabel = {
|
|
103
104
|
args: {
|
|
@@ -141,6 +142,6 @@ export const Width = {
|
|
|
141
142
|
value: 45,
|
|
142
143
|
scale: 'xl',
|
|
143
144
|
cornerRadius: 'xl',
|
|
144
|
-
width: '
|
|
145
|
+
width: '240px',
|
|
145
146
|
},
|
|
146
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemovableItemList.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/RemovableItemList/RemovableItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RemovableItemList.d.ts","sourceRoot":"","sources":["../../../../src/components/Data/RemovableItemList/RemovableItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,sBAAsB;IAC9B,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,QAAA,MAAM,iBAAiB,GAAI,6CAAkD,sBAAsB,4CAgElG,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Text } from '@mantine/core';
|
|
3
3
|
import { neutral, error } from '../../../constants/colors';
|
|
4
4
|
import { fontStyle } from '../../../constants/font';
|
|
5
|
+
import { spacing } from '../../../constants/spacing';
|
|
5
6
|
import { Title } from '../../Typography/Title/Title';
|
|
6
7
|
const RemovableItemList = ({ items, onRemove, title, disabledIndices = [] }) => {
|
|
7
8
|
const style = {
|
|
@@ -16,14 +17,14 @@ const RemovableItemList = ({ items, onRemove, title, disabledIndices = [] }) =>
|
|
|
16
17
|
titleContainer: {
|
|
17
18
|
display: 'flex',
|
|
18
19
|
alignItems: 'center',
|
|
19
|
-
padding:
|
|
20
|
+
padding: `${spacing.md} ${spacing.lg}`,
|
|
20
21
|
backgroundColor: neutral[50],
|
|
21
22
|
},
|
|
22
23
|
itemContainer: {
|
|
23
24
|
display: 'flex',
|
|
24
25
|
alignItems: 'center',
|
|
25
26
|
justifyContent: 'space-between',
|
|
26
|
-
padding:
|
|
27
|
+
padding: `${spacing.md} ${spacing.lg}`,
|
|
27
28
|
},
|
|
28
29
|
itemText: {
|
|
29
30
|
...fontStyle['body'],
|
|
@@ -37,7 +38,7 @@ const RemovableItemList = ({ items, onRemove, title, disabledIndices = [] }) =>
|
|
|
37
38
|
opacity: disabledIndices.includes(index) ? 0.5 : 1,
|
|
38
39
|
cursor: disabledIndices.includes(index) ? 'default' : 'pointer',
|
|
39
40
|
color: disabledIndices.includes(index) ? neutral[200] : error[100],
|
|
40
|
-
fontSize: '
|
|
41
|
+
fontSize: '16.25px',
|
|
41
42
|
fontWeight: 100,
|
|
42
43
|
}, onClick: () => !disabledIndices.includes(index) && onRemove(item, index) }))] }, index)))] }));
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,KAAK,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,kBAAkB,CAAC;AAEhE,KAAK,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;IACnD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,CAwD9B,CAAC;AAQF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAsC1B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { IconCheck, IconCircleFilled } from '@tabler/icons-react';
|
|
|
3
3
|
import { Badge } from './Badge';
|
|
4
4
|
import { Group } from '../../Layout/Group/Group';
|
|
5
5
|
import { Stack } from '../../Layout/Stack/Stack';
|
|
6
|
+
import { spacing } from '../../../constants/spacing';
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Components/Info/Badge',
|
|
8
9
|
component: Badge,
|
|
@@ -79,14 +80,14 @@ export const Default = {
|
|
|
79
80
|
},
|
|
80
81
|
};
|
|
81
82
|
export const Variants = {
|
|
82
|
-
render: () => (_jsxs(Group, { gap:
|
|
83
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { variant: "outline", color: "primary", children: "Outline" }), _jsx(Badge, { variant: "filled", color: "primary", children: "Filled" }), _jsx(Badge, { variant: "gradient", color: "primary", children: "Gradient" })] })),
|
|
83
84
|
};
|
|
84
85
|
export const Colors = {
|
|
85
|
-
render: () => (_jsxs(Group, { gap:
|
|
86
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, style: { flexWrap: 'wrap' }, children: [_jsx(Badge, { variant: "outline", color: "primary", children: "Primary" }), _jsx(Badge, { variant: "outline", color: "success", children: "Success" }), _jsx(Badge, { variant: "outline", color: "warning", children: "Warning" }), _jsx(Badge, { variant: "outline", color: "error", children: "Error" }), _jsx(Badge, { variant: "outline", color: "neutral", children: "Neutral" })] })),
|
|
86
87
|
};
|
|
87
88
|
export const Sizes = {
|
|
88
|
-
render: () => (_jsxs(Group, { gap:
|
|
89
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, align: "flex-end", children: [_jsx(Badge, { size: "sm", color: "primary", children: "Small" }), _jsx(Badge, { size: "md", color: "primary", children: "Medium" }), _jsx(Badge, { size: "lg", color: "primary", children: "Large" })] })),
|
|
89
90
|
};
|
|
90
91
|
export const WithLeftIcon = {
|
|
91
|
-
render: () => (_jsxs(Stack, { gap:
|
|
92
|
+
render: () => (_jsxs(Stack, { gap: spacing.lg, children: [_jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { size: "sm", leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { size: "sm", variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { size: "sm", variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] }), _jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] }), _jsxs(Group, { gap: spacing.lg, children: [_jsx(Badge, { size: "lg", leftIcon: _jsx(IconCheck, {}), color: "success", children: "Completed" }), _jsx(Badge, { size: "lg", variant: "filled", leftIcon: _jsx(IconCircleFilled, {}), color: "success", children: "Online" }), _jsx(Badge, { size: "lg", variant: "gradient", leftIcon: _jsx(IconCheck, {}), color: "success", children: "In Progress" })] })] })),
|
|
92
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/sizes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/sizes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { inputFontSize } from '../../../constants/font';
|
|
2
|
+
import { spacing } from '../../../constants/spacing';
|
|
2
3
|
export const badgeSizes = {
|
|
3
4
|
sm: {
|
|
4
5
|
mantineSize: 'md',
|
|
5
|
-
padding:
|
|
6
|
-
height: '
|
|
6
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
7
|
+
height: '15px',
|
|
7
8
|
fontSize: inputFontSize['sm'],
|
|
8
9
|
iconSize: 10,
|
|
9
10
|
},
|
|
10
11
|
md: {
|
|
11
12
|
mantineSize: 'lg',
|
|
12
|
-
padding:
|
|
13
|
-
height: '
|
|
13
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
14
|
+
height: '25px',
|
|
14
15
|
fontSize: inputFontSize['md'],
|
|
15
16
|
iconSize: 14,
|
|
16
17
|
},
|
|
17
18
|
lg: {
|
|
18
19
|
mantineSize: 'xl',
|
|
19
|
-
padding:
|
|
20
|
-
height: '
|
|
20
|
+
padding: `${spacing.xs} ${spacing.sm}`,
|
|
21
|
+
height: '30px',
|
|
21
22
|
fontSize: inputFontSize['lg'],
|
|
22
23
|
iconSize: 16,
|
|
23
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/components/Info/Badge/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7D,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,MAAM,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAoBnF"}
|