@taiv/ui 1.13.0 → 1.14.0
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
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconButton } from './IconButton';
|
|
3
3
|
import { Icon12Hours, Icon24Hours, Icon360View, IconAdjustments, IconAlertCircle, IconArrowLeft, IconArrowRight, IconArrowsMaximize, IconCaretDown, IconCheck, IconClock, IconClock2, IconHistory, IconLoader2 } from '@tabler/icons-react';
|
|
4
4
|
import { Group } from '../../../Layout/Group/Group';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
const meta = {
|
|
6
7
|
title: 'Components/Inputs/Buttons/IconButton',
|
|
7
8
|
component: IconButton,
|
|
@@ -103,22 +104,22 @@ export const Default = {
|
|
|
103
104
|
},
|
|
104
105
|
};
|
|
105
106
|
export const Variants = {
|
|
106
|
-
render: () => (_jsxs(Group, { gap:
|
|
107
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { variant: "primary", children: _jsx(Icon12Hours, {}) }), _jsx(IconButton, { variant: "secondary", children: _jsx(Icon24Hours, {}) }), _jsx(IconButton, { variant: "cancel", children: _jsx(IconClock, {}) }), _jsx(IconButton, { variant: "success", children: _jsx(IconCheck, {}) }), _jsx(IconButton, { variant: "warning", children: _jsx(IconAlertCircle, {}) }), _jsx(IconButton, { variant: "text", children: _jsx(IconClock2, {}) })] })),
|
|
107
108
|
};
|
|
108
109
|
export const Subtle = {
|
|
109
|
-
render: () => (_jsxs(Group, { gap:
|
|
110
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { variant: "primary", subtle: true, children: _jsx(Icon12Hours, {}) }), _jsx(IconButton, { variant: "secondary", subtle: true, children: _jsx(Icon24Hours, {}) }), _jsx(IconButton, { variant: "cancel", subtle: true, children: _jsx(IconClock, {}) }), _jsx(IconButton, { variant: "success", subtle: true, children: _jsx(IconCheck, {}) }), _jsx(IconButton, { variant: "warning", subtle: true, children: _jsx(IconAlertCircle, {}) }), _jsx(IconButton, { variant: "text", subtle: true, children: _jsx(IconClock2, {}) })] })),
|
|
110
111
|
};
|
|
111
112
|
export const Sizes = {
|
|
112
|
-
render: () => (_jsxs(Group, { gap:
|
|
113
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { size: "sm", children: _jsx(Icon360View, {}) }), _jsx(IconButton, { size: "md", children: _jsx(IconAdjustments, {}) }), _jsx(IconButton, { size: "lg", children: _jsx(IconArrowsMaximize, {}) })] })),
|
|
113
114
|
};
|
|
114
115
|
export const States = {
|
|
115
|
-
render: () => (_jsxs(Group, { gap:
|
|
116
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { children: _jsx(IconArrowLeft, {}) }), _jsx(IconButton, { disabled: true, children: _jsx(IconCaretDown, {}) }), _jsx(IconButton, { loading: true, children: _jsx(IconLoader2, {}) }), _jsx(IconButton, { shadow: true, children: _jsx(IconArrowLeft, {}) })] })),
|
|
116
117
|
};
|
|
117
118
|
export const SubtleStates = {
|
|
118
|
-
render: () => (_jsxs(Group, { gap:
|
|
119
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { subtle: true, children: _jsx(IconArrowLeft, {}) }), _jsx(IconButton, { subtle: true, disabled: true, children: _jsx(IconCaretDown, {}) }), _jsx(IconButton, { subtle: true, loading: true, children: _jsx(IconLoader2, {}) }), _jsx(IconButton, { subtle: true, shadow: true, children: _jsx(IconArrowLeft, {}) })] })),
|
|
119
120
|
};
|
|
120
121
|
export const CustomStyles = {
|
|
121
|
-
render: () => (_jsxs(Group, { gap:
|
|
122
|
+
render: () => (_jsxs(Group, { gap: spacing.lg, children: [_jsx(IconButton, { styles: {
|
|
122
123
|
root: {
|
|
123
124
|
borderRadius: '20px',
|
|
124
125
|
background: 'linear-gradient(45deg, #ff6b6b, #ee5a24)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/IconButton/sizes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/IconButton/sizes.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;CAInB,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { spacing } from '../../../../constants/spacing';
|
|
1
2
|
const componentSizes = {
|
|
2
|
-
sm: { borderLength:
|
|
3
|
-
md: { borderLength:
|
|
4
|
-
lg: { borderLength:
|
|
3
|
+
sm: { borderLength: 28, padding: spacing.xs, iconSize: 16 },
|
|
4
|
+
md: { borderLength: 36, padding: spacing.xs, iconSize: 20 },
|
|
5
|
+
lg: { borderLength: 48, padding: spacing.xs, iconSize: 24 },
|
|
5
6
|
};
|
|
6
7
|
export { componentSizes };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps as MantineButtonProps } from '@mantine/core';
|
|
3
|
+
import { componentSizes } from '../Button/sizes';
|
|
4
|
+
type OmittedProps = 'variant' | 'leftIcon' | 'rightIcon';
|
|
5
|
+
declare const providers: {
|
|
6
|
+
readonly google: {
|
|
7
|
+
readonly name: "Google";
|
|
8
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type SSOProvider = keyof typeof providers;
|
|
12
|
+
interface SSOButtonBase extends Omit<MantineButtonProps, OmittedProps> {
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
size?: keyof typeof componentSizes;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type WithProvider = SSOButtonBase & {
|
|
18
|
+
/** Shorthand — resolves the provider's name and icon automatically */
|
|
19
|
+
provider: SSOProvider;
|
|
20
|
+
/** Override the resolved provider name */
|
|
21
|
+
providerName?: string;
|
|
22
|
+
/** Override the resolved provider icon */
|
|
23
|
+
providerIcon?: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
type WithCustomProvider = SSOButtonBase & {
|
|
26
|
+
provider?: never;
|
|
27
|
+
/** Display name of the provider (e.g. "Google", "Apple") */
|
|
28
|
+
providerName: string;
|
|
29
|
+
/** Provider icon rendered to the left of the label */
|
|
30
|
+
providerIcon: React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export type SSOButtonProps = WithProvider | WithCustomProvider;
|
|
33
|
+
export declare const SSOButton: ({ provider, providerName, providerIcon, onClick, size, fullWidth, styles, children, ...props }: SSOButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=SSOButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSOButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/SSOButton/SSOButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,KAAK,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzD,QAAA,MAAM,SAAS;;;;;CAEL,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,SAAS,CAAC;AAEjD,UAAU,aAAc,SAAQ,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC;IACpE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,YAAY,GAAG,aAAa,GAAG;IAClC,sEAAsE;IACtE,QAAQ,EAAE,WAAW,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC,CAAC;AAEF,KAAK,kBAAkB,GAAG,aAAa,GAAG;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,kBAAkB,CAAC;AAE/D,eAAO,MAAM,SAAS,GAAI,gGAUvB,cAAc,4CAwChB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button as MantineButton } from '@mantine/core';
|
|
3
|
+
import { fontBase, fontWeight } from '../../../../constants/font';
|
|
4
|
+
import { componentSizes } from '../Button/sizes';
|
|
5
|
+
import { componentVariants } from '../shared/variants';
|
|
6
|
+
import { GoogleIcon } from '../../../../assets/icons';
|
|
7
|
+
const providers = {
|
|
8
|
+
google: { name: 'Google', icon: _jsx(GoogleIcon, { size: 18 }) },
|
|
9
|
+
};
|
|
10
|
+
export const SSOButton = ({ provider, providerName, providerIcon, onClick, size = 'md', fullWidth = false, styles, children, ...props }) => {
|
|
11
|
+
const resolved = provider ? providers[provider] : undefined;
|
|
12
|
+
const name = providerName !== null && providerName !== void 0 ? providerName : resolved === null || resolved === void 0 ? void 0 : resolved.name;
|
|
13
|
+
const icon = providerIcon !== null && providerIcon !== void 0 ? providerIcon : resolved === null || resolved === void 0 ? void 0 : resolved.icon;
|
|
14
|
+
const selectedVariant = componentVariants['secondary'];
|
|
15
|
+
const selectedSize = componentSizes[size];
|
|
16
|
+
const style = {
|
|
17
|
+
root: {
|
|
18
|
+
borderRadius: '8px',
|
|
19
|
+
width: fullWidth ? '100%' : 'fit-content',
|
|
20
|
+
height: `${selectedSize.height}rem`,
|
|
21
|
+
padding: selectedSize.padding,
|
|
22
|
+
minWidth: `${selectedSize.minWidth}rem`,
|
|
23
|
+
fontSize: selectedSize.fontSize,
|
|
24
|
+
transition: 'background 0.1s ease-in-out',
|
|
25
|
+
...selectedVariant,
|
|
26
|
+
},
|
|
27
|
+
label: {
|
|
28
|
+
...fontBase,
|
|
29
|
+
fontWeight: fontWeight['semibold'],
|
|
30
|
+
},
|
|
31
|
+
leftIcon: {
|
|
32
|
+
marginRight: '1rem',
|
|
33
|
+
},
|
|
34
|
+
...styles,
|
|
35
|
+
};
|
|
36
|
+
return (_jsx(MantineButton, { styles: style, size: size, onClick: onClick, leftIcon: icon, ...props, children: children !== null && children !== void 0 ? children : (name ? `Continue with ${name}` : undefined) }));
|
|
37
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { SSOButton } from './SSOButton';
|
|
3
|
+
declare const meta: Meta<typeof SSOButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SSOButton>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const BuiltInProvider: Story;
|
|
8
|
+
export declare const CustomProviders: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const States: Story;
|
|
11
|
+
export declare const CustomLabels: Story;
|
|
12
|
+
export declare const FullWidth: Story;
|
|
13
|
+
export declare const ProviderOverride: Story;
|
|
14
|
+
//# sourceMappingURL=SSOButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSOButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/SSOButton/SSOButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAmFhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAO1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAQ9B,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SSOButton } from './SSOButton';
|
|
3
|
+
import { Group } from '../../../Layout/Group/Group';
|
|
4
|
+
import { Stack } from '../../../Layout/Stack/Stack';
|
|
5
|
+
import { IconBrandApple, IconBrandGithub, IconBrandWindows } from '@tabler/icons-react';
|
|
6
|
+
import { GoogleIcon } from '../../../../assets/icons';
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Inputs/Buttons/SSOButton',
|
|
9
|
+
component: SSOButton,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'A sign-in button for third-party authentication providers. Use the `provider` shorthand for built-in providers, or pass `providerName` and `providerIcon` for any custom provider.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
provider: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: ['google'],
|
|
22
|
+
description: 'Shorthand — resolves the provider name and icon automatically',
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: "'google'" },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
providerName: {
|
|
28
|
+
control: { type: 'text' },
|
|
29
|
+
description: 'Display name of the provider. Overrides provider lookup.',
|
|
30
|
+
table: {
|
|
31
|
+
type: { summary: 'string' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
providerIcon: {
|
|
35
|
+
control: false,
|
|
36
|
+
description: 'Provider icon rendered to the left of the label. Overrides provider lookup.',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'ReactNode' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
control: { type: 'select' },
|
|
43
|
+
options: ['sm', 'md', 'lg'],
|
|
44
|
+
description: "Controls the button's height, padding, and font size",
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: "'sm' | 'md' | 'lg'" },
|
|
47
|
+
defaultValue: { summary: "'md'" },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
children: {
|
|
51
|
+
control: { type: 'text' },
|
|
52
|
+
description: 'Custom label. Defaults to "Continue with {providerName}"',
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: 'ReactNode' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
fullWidth: {
|
|
58
|
+
control: { type: 'boolean' },
|
|
59
|
+
description: 'Makes the button span the full width of its container',
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: 'boolean' },
|
|
62
|
+
defaultValue: { summary: 'false' },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
control: { type: 'boolean' },
|
|
67
|
+
description: 'Disabled state',
|
|
68
|
+
table: {
|
|
69
|
+
type: { summary: 'boolean' },
|
|
70
|
+
defaultValue: { summary: 'false' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
loading: {
|
|
74
|
+
control: { type: 'boolean' },
|
|
75
|
+
description: 'Indicate loading state',
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: 'boolean' },
|
|
78
|
+
defaultValue: { summary: 'false' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
onClick: {
|
|
82
|
+
action: 'clicked',
|
|
83
|
+
description: 'Click handler function',
|
|
84
|
+
table: {
|
|
85
|
+
type: { summary: '() => void' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export default meta;
|
|
91
|
+
export const Default = {
|
|
92
|
+
args: {
|
|
93
|
+
provider: 'google',
|
|
94
|
+
size: 'md',
|
|
95
|
+
disabled: false,
|
|
96
|
+
loading: false,
|
|
97
|
+
fullWidth: false,
|
|
98
|
+
onClick: () => { },
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
export const BuiltInProvider = {
|
|
102
|
+
render: () => (_jsx(Stack, { gap: "1.2rem", children: _jsx(SSOButton, { provider: "google" }) })),
|
|
103
|
+
};
|
|
104
|
+
export const CustomProviders = {
|
|
105
|
+
render: () => (_jsxs(Stack, { gap: "1.2rem", children: [_jsx(SSOButton, { providerName: "Apple", providerIcon: _jsx(IconBrandApple, { size: 18 }) }), _jsx(SSOButton, { providerName: "GitHub", providerIcon: _jsx(IconBrandGithub, { size: 18 }) }), _jsx(SSOButton, { providerName: "Microsoft", providerIcon: _jsx(IconBrandWindows, { size: 18 }) })] })),
|
|
106
|
+
};
|
|
107
|
+
export const Sizes = {
|
|
108
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", align: "center", children: [_jsx(SSOButton, { provider: "google", size: "sm" }), _jsx(SSOButton, { provider: "google", size: "md" }), _jsx(SSOButton, { provider: "google", size: "lg" })] })),
|
|
109
|
+
};
|
|
110
|
+
export const States = {
|
|
111
|
+
render: () => (_jsxs(Group, { gap: "1.6rem", children: [_jsx(SSOButton, { provider: "google" }), _jsx(SSOButton, { provider: "google", disabled: true }), _jsx(SSOButton, { provider: "google", loading: true })] })),
|
|
112
|
+
};
|
|
113
|
+
export const CustomLabels = {
|
|
114
|
+
render: () => (_jsxs(Stack, { gap: "1.2rem", children: [_jsx(SSOButton, { provider: "google", children: "Sign in with Google" }), _jsx(SSOButton, { providerName: "Apple", providerIcon: _jsx(IconBrandApple, { size: 18 }), children: "Sign in with Apple" })] })),
|
|
115
|
+
};
|
|
116
|
+
export const FullWidth = {
|
|
117
|
+
render: () => (_jsx("div", { style: { width: '360px' }, children: _jsxs(Stack, { gap: "1.2rem", children: [_jsx(SSOButton, { provider: "google", fullWidth: true }), _jsx(SSOButton, { providerName: "Apple", providerIcon: _jsx(IconBrandApple, { size: 18 }), fullWidth: true }), _jsx(SSOButton, { providerName: "GitHub", providerIcon: _jsx(IconBrandGithub, { size: 18 }), fullWidth: true })] }) })),
|
|
118
|
+
};
|
|
119
|
+
export const ProviderOverride = {
|
|
120
|
+
render: () => (_jsx(Stack, { gap: "1.2rem", children: _jsx(SSOButton, { provider: "google", providerIcon: _jsx(GoogleIcon, { size: 24 }), children: "Custom icon size override" }) })),
|
|
121
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnstyledButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"UnstyledButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/UnstyledButton/UnstyledButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAmCrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAWrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA2D1B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { UnstyledButton } from './UnstyledButton';
|
|
3
|
+
import { spacing } from '../../../../constants/spacing';
|
|
3
4
|
const meta = {
|
|
4
5
|
title: 'Components/Inputs/Buttons/UnstyledButton',
|
|
5
6
|
component: UnstyledButton,
|
|
@@ -49,9 +50,9 @@ export const Default = {
|
|
|
49
50
|
},
|
|
50
51
|
};
|
|
51
52
|
export const CustomStyles = {
|
|
52
|
-
render: () => (_jsxs("div", { style: { display: 'flex', gap: '
|
|
53
|
+
render: () => (_jsxs("div", { style: { display: 'flex', gap: '10px', flexWrap: 'wrap' }, children: [_jsx(UnstyledButton, { styles: {
|
|
53
54
|
root: {
|
|
54
|
-
padding:
|
|
55
|
+
padding: `${spacing.md} ${spacing.xl}`,
|
|
55
56
|
borderRadius: '8px',
|
|
56
57
|
background: 'linear-gradient(45deg, #667eea, #764ba2)',
|
|
57
58
|
color: 'white',
|
|
@@ -69,7 +70,7 @@ export const CustomStyles = {
|
|
|
69
70
|
},
|
|
70
71
|
}, children: "Gradient Button" }), _jsx(UnstyledButton, { styles: {
|
|
71
72
|
root: {
|
|
72
|
-
padding:
|
|
73
|
+
padding: `${spacing.sm} ${spacing.lg}`,
|
|
73
74
|
borderRadius: '20px',
|
|
74
75
|
background: 'transparent',
|
|
75
76
|
color: '#667eea',
|
|
@@ -25,10 +25,10 @@ export declare const componentVariants: {
|
|
|
25
25
|
readonly stroke: "white";
|
|
26
26
|
};
|
|
27
27
|
readonly '&:before': {
|
|
28
|
-
readonly top: "-
|
|
29
|
-
readonly right: "-
|
|
30
|
-
readonly left: "-
|
|
31
|
-
readonly bottom: "-
|
|
28
|
+
readonly top: "-1px";
|
|
29
|
+
readonly right: "-1px";
|
|
30
|
+
readonly left: "-1px";
|
|
31
|
+
readonly bottom: "-1px";
|
|
32
32
|
readonly borderRadius: "8px";
|
|
33
33
|
};
|
|
34
34
|
};
|
|
@@ -61,10 +61,10 @@ export declare const componentVariants: {
|
|
|
61
61
|
readonly stroke: "#6D6D6D";
|
|
62
62
|
};
|
|
63
63
|
readonly '&:before': {
|
|
64
|
-
readonly top: "-
|
|
65
|
-
readonly right: "-
|
|
66
|
-
readonly left: "-
|
|
67
|
-
readonly bottom: "-
|
|
64
|
+
readonly top: "-1px";
|
|
65
|
+
readonly right: "-1px";
|
|
66
|
+
readonly left: "-1px";
|
|
67
|
+
readonly bottom: "-1px";
|
|
68
68
|
readonly borderRadius: "8px";
|
|
69
69
|
};
|
|
70
70
|
};
|
|
@@ -96,10 +96,10 @@ export declare const componentVariants: {
|
|
|
96
96
|
readonly stroke: "white";
|
|
97
97
|
};
|
|
98
98
|
readonly '&:before': {
|
|
99
|
-
readonly top: "-
|
|
100
|
-
readonly right: "-
|
|
101
|
-
readonly left: "-
|
|
102
|
-
readonly bottom: "-
|
|
99
|
+
readonly top: "-1px";
|
|
100
|
+
readonly right: "-1px";
|
|
101
|
+
readonly left: "-1px";
|
|
102
|
+
readonly bottom: "-1px";
|
|
103
103
|
readonly borderRadius: "8px";
|
|
104
104
|
};
|
|
105
105
|
};
|
|
@@ -130,10 +130,10 @@ export declare const componentVariants: {
|
|
|
130
130
|
readonly stroke: "white";
|
|
131
131
|
};
|
|
132
132
|
readonly '&:before': {
|
|
133
|
-
readonly top: "-
|
|
134
|
-
readonly right: "-
|
|
135
|
-
readonly left: "-
|
|
136
|
-
readonly bottom: "-
|
|
133
|
+
readonly top: "-1px";
|
|
134
|
+
readonly right: "-1px";
|
|
135
|
+
readonly left: "-1px";
|
|
136
|
+
readonly bottom: "-1px";
|
|
137
137
|
readonly borderRadius: "8px";
|
|
138
138
|
};
|
|
139
139
|
};
|
|
@@ -164,10 +164,10 @@ export declare const componentVariants: {
|
|
|
164
164
|
readonly stroke: "white";
|
|
165
165
|
};
|
|
166
166
|
readonly '&:before': {
|
|
167
|
-
readonly top: "-
|
|
168
|
-
readonly right: "-
|
|
169
|
-
readonly left: "-
|
|
170
|
-
readonly bottom: "-
|
|
167
|
+
readonly top: "-1px";
|
|
168
|
+
readonly right: "-1px";
|
|
169
|
+
readonly left: "-1px";
|
|
170
|
+
readonly bottom: "-1px";
|
|
171
171
|
readonly borderRadius: "8px";
|
|
172
172
|
};
|
|
173
173
|
};
|
|
@@ -200,17 +200,17 @@ export declare const componentVariants: {
|
|
|
200
200
|
readonly stroke: "#6D6D6D";
|
|
201
201
|
};
|
|
202
202
|
readonly '&:before': {
|
|
203
|
-
readonly top: "-
|
|
204
|
-
readonly right: "-
|
|
205
|
-
readonly left: "-
|
|
206
|
-
readonly bottom: "-
|
|
203
|
+
readonly top: "-1px";
|
|
204
|
+
readonly right: "-1px";
|
|
205
|
+
readonly left: "-1px";
|
|
206
|
+
readonly bottom: "-1px";
|
|
207
207
|
readonly borderRadius: "8px";
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
211
|
readonly nav: {
|
|
212
212
|
readonly background: "white";
|
|
213
|
-
readonly paddingLeft:
|
|
213
|
+
readonly paddingLeft: string;
|
|
214
214
|
readonly color: "#6D6D6D";
|
|
215
215
|
readonly '& .mantine-Button-inner': {
|
|
216
216
|
readonly justifyContent: "flex-start";
|
|
@@ -235,10 +235,10 @@ export declare const componentVariants: {
|
|
|
235
235
|
readonly stroke: "#6D6D6D";
|
|
236
236
|
};
|
|
237
237
|
readonly '&:before': {
|
|
238
|
-
readonly top: "-
|
|
239
|
-
readonly right: "-
|
|
240
|
-
readonly left: "-
|
|
241
|
-
readonly bottom: "-
|
|
238
|
+
readonly top: "-1px";
|
|
239
|
+
readonly right: "-1px";
|
|
240
|
+
readonly left: "-1px";
|
|
241
|
+
readonly bottom: "-1px";
|
|
242
242
|
readonly borderRadius: "8px";
|
|
243
243
|
};
|
|
244
244
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/shared/variants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/shared/variants.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyLpB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAQjB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { primary, neutral, error, success, warning } from '../../../../constants/colors';
|
|
2
|
+
import { spacing } from '../../../../constants/spacing';
|
|
2
3
|
// Overrides mantine due to rem difference
|
|
3
4
|
const loading = {
|
|
4
|
-
top: '-
|
|
5
|
-
right: '-
|
|
6
|
-
left: '-
|
|
7
|
-
bottom: '-
|
|
5
|
+
top: '-1px',
|
|
6
|
+
right: '-1px',
|
|
7
|
+
left: '-1px',
|
|
8
|
+
bottom: '-1px',
|
|
8
9
|
borderRadius: '8px',
|
|
9
10
|
};
|
|
10
11
|
const disabled = {
|
|
@@ -170,7 +171,7 @@ export const componentVariants = {
|
|
|
170
171
|
},
|
|
171
172
|
nav: {
|
|
172
173
|
background: 'white',
|
|
173
|
-
paddingLeft:
|
|
174
|
+
paddingLeft: spacing.sm,
|
|
174
175
|
color: neutral[200],
|
|
175
176
|
'& .mantine-Button-inner': {
|
|
176
177
|
justifyContent: 'flex-start',
|
|
@@ -100,7 +100,7 @@ export const Default = {
|
|
|
100
100
|
},
|
|
101
101
|
};
|
|
102
102
|
export const Sizes = {
|
|
103
|
-
render: () => (_jsxs(Group, { gap: "
|
|
103
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Checkbox, { size: "sm", label: "Small Checkbox", checked: false }), _jsx(Checkbox, { size: "md", label: "Medium Checkbox (Default)", checked: true }), _jsx(Checkbox, { size: "lg", label: "Large Checkbox", checked: false })] })),
|
|
104
104
|
parameters: {
|
|
105
105
|
docs: {
|
|
106
106
|
source: {
|
|
@@ -110,7 +110,7 @@ export const Sizes = {
|
|
|
110
110
|
},
|
|
111
111
|
};
|
|
112
112
|
export const States = {
|
|
113
|
-
render: () => (_jsxs(Group, { gap: "
|
|
113
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Checkbox, { label: "Normal Checkbox", checked: true }), _jsx(Checkbox, { label: "Disabled Checkbox", checked: false, disabled: true }), _jsx(Checkbox, { label: "Checkbox with Description", description: "This is a description that provides additional context", checked: false }), _jsx(Checkbox, { label: "Checkbox with Error", error: "This field is required", checked: false })] })),
|
|
114
114
|
parameters: {
|
|
115
115
|
docs: {
|
|
116
116
|
source: {
|
|
@@ -120,7 +120,7 @@ export const States = {
|
|
|
120
120
|
},
|
|
121
121
|
};
|
|
122
122
|
export const CustomStyles = {
|
|
123
|
-
render: () => (_jsxs(Group, { gap: "
|
|
123
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Checkbox, { label: "Custom Styled Checkbox", checked: true, styles: {
|
|
124
124
|
input: {
|
|
125
125
|
'&:checked': {
|
|
126
126
|
backgroundColor: '#ff6b6b',
|
|
@@ -90,7 +90,7 @@ export const Default = {
|
|
|
90
90
|
},
|
|
91
91
|
};
|
|
92
92
|
export const RadioGroup = {
|
|
93
|
-
render: () => (_jsxs(Group, { gap: "
|
|
93
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Radio, { label: "Option 1", value: "option1", checked: true }), _jsx(Radio, { label: "Option 2", value: "option2", checked: false }), _jsx(Radio, { label: "Option 3", value: "option3", checked: false })] })),
|
|
94
94
|
parameters: {
|
|
95
95
|
docs: {
|
|
96
96
|
source: {
|
|
@@ -100,7 +100,7 @@ export const RadioGroup = {
|
|
|
100
100
|
},
|
|
101
101
|
};
|
|
102
102
|
export const States = {
|
|
103
|
-
render: () => (_jsxs(Group, { gap: "
|
|
103
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Radio, { label: "Normal Radio", value: "normal", checked: true }), _jsx(Radio, { label: "Disabled Radio", value: "disabled", checked: false, disabled: true }), _jsx(Radio, { label: "Radio with Description", description: "This is a description that provides additional context", value: "description", checked: false }), _jsx(Radio, { label: "Radio with Error", error: "This field is required", value: "error", checked: false })] })),
|
|
104
104
|
parameters: {
|
|
105
105
|
docs: {
|
|
106
106
|
source: {
|
|
@@ -110,7 +110,7 @@ export const States = {
|
|
|
110
110
|
},
|
|
111
111
|
};
|
|
112
112
|
export const CustomStyles = {
|
|
113
|
-
render: () => (_jsxs(Group, { gap: "
|
|
113
|
+
render: () => (_jsxs(Group, { gap: "20px", children: [_jsx(Radio, { label: "Custom Styled Radio", value: "custom1", checked: true, styles: {
|
|
114
114
|
radio: {
|
|
115
115
|
'&:checked': {
|
|
116
116
|
backgroundColor: '#ff6b6b',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioList.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/RadioList/RadioList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioList.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/RadioList/RadioList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,QAAA,MAAM,SAAS,GAAI,4CAAoD,cAAc,4CAkCpF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack } from '../../../Layout/Stack/Stack';
|
|
3
3
|
import { Radio } from '../Radio/Radio';
|
|
4
4
|
import { neutral } from '../../../../constants/colors';
|
|
5
|
+
import { spacing } from '../../../../constants/spacing';
|
|
5
6
|
import { Group } from '../../../Layout/Group/Group';
|
|
6
7
|
const RadioList = ({ data, value, onChange, disabled = false, width }) => {
|
|
7
8
|
const handleChange = (optionValue) => {
|
|
@@ -13,10 +14,10 @@ const RadioList = ({ data, value, onChange, disabled = false, width }) => {
|
|
|
13
14
|
border: `1px solid ${neutral[100]}`,
|
|
14
15
|
borderRadius: '16px',
|
|
15
16
|
overflow: 'hidden',
|
|
16
|
-
padding:
|
|
17
|
+
padding: `${spacing.xxs} 0 ${spacing.xxs} 0`,
|
|
17
18
|
width,
|
|
18
19
|
}, children: data.map((option, index) => (_jsxs(Group, { position: "apart", style: {
|
|
19
|
-
padding:
|
|
20
|
+
padding: `10px ${spacing.md} ${spacing.sm} ${spacing.md}`,
|
|
20
21
|
borderBottom: index < data.length - 1 ? `1px solid ${neutral[100]}` : 'none',
|
|
21
22
|
backgroundColor: 'white',
|
|
22
23
|
}, children: [_jsx(Radio, { value: option.value, label: option.label, checked: value === option.value, onChange: () => handleChange(option.value), disabled: disabled }), option.rightContent && option.rightContent] }, option.value))) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioList.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/RadioList/RadioList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioList.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/RadioList/RadioList.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA4ChC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAgCnC,eAAO,MAAM,OAAO,EAAE,KAsBrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAoBpB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAoBzB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { RadioList } from './RadioList';
|
|
3
|
+
import { spacing } from '../../../../constants/spacing';
|
|
3
4
|
const meta = {
|
|
4
5
|
title: 'Components/Inputs/Controls/RadioList',
|
|
5
6
|
component: RadioList,
|
|
@@ -117,7 +118,7 @@ export const WithIcons = {
|
|
|
117
118
|
},
|
|
118
119
|
};
|
|
119
120
|
export const States = {
|
|
120
|
-
render: () => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '
|
|
121
|
+
render: () => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsxs("div", { children: [_jsx("h4", { style: { marginBottom: spacing.xs }, children: "Normal State" }), _jsx(RadioList, { data: basicOptions, value: "option2", width: "300px" })] }), _jsxs("div", { children: [_jsx("h4", { style: { marginBottom: spacing.xs }, children: "Disabled State" }), _jsx(RadioList, { data: basicOptions, value: "option1", disabled: true, width: "300px" })] })] })),
|
|
121
122
|
parameters: {
|
|
122
123
|
docs: {
|
|
123
124
|
source: {
|
|
@@ -127,7 +128,7 @@ export const States = {
|
|
|
127
128
|
},
|
|
128
129
|
};
|
|
129
130
|
export const CustomWidth = {
|
|
130
|
-
render: () => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '
|
|
131
|
+
render: () => (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsxs("div", { children: [_jsx("h4", { style: { marginBottom: spacing.xs }, children: "Narrow Width (200px)" }), _jsx(RadioList, { data: basicOptions, value: "option1", width: "200px" })] }), _jsxs("div", { children: [_jsx("h4", { style: { marginBottom: spacing.xs }, children: "Wide Width (500px)" }), _jsx(RadioList, { data: optionsWithDescriptions, value: "pro", width: "500px" })] })] })),
|
|
131
132
|
parameters: {
|
|
132
133
|
docs: {
|
|
133
134
|
source: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Controls/SegmentedControl/SegmentedControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAWtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkHvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA8BrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAenB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAWxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAwBpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA2B1B,CAAC"}
|