react-restyle-components 0.4.23 → 0.4.24
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/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts +4 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/AlertBanner.js +45 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/elements.js +233 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts +3 -0
- package/lib/src/core-components/src/components/AlertBanner/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/index.js +2 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts +46 -0
- package/lib/src/core-components/src/components/AlertBanner/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/AlertBanner/types.js +10 -0
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Badge/Badge.d.ts +33 -33
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts +28 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/Breadcrumb.js +83 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts +44 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/elements.js +370 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/index.js +3 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts +14 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Breadcrumb/types.js +3 -0
- package/lib/src/core-components/src/components/Button/Button.spec.js +1 -1
- package/lib/src/core-components/src/components/Button/button.component.js +1 -1
- package/lib/src/core-components/src/components/Chip/Chip.d.ts +5 -0
- package/lib/src/core-components/src/components/Chip/Chip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/Chip.js +64 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts +27 -0
- package/lib/src/core-components/src/components/Chip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/elements.js +253 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Chip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/index.js +2 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts +54 -0
- package/lib/src/core-components/src/components/Chip/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Chip/types.js +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts +4 -0
- package/lib/src/core-components/src/components/Divider/Divider.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/Divider.js +25 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts +22 -0
- package/lib/src/core-components/src/components/Divider/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/elements.js +103 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Divider/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/index.js +2 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts +30 -0
- package/lib/src/core-components/src/components/Divider/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Divider/types.js +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts +6 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/DynamicGrid.js +147 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts +12 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/GridContainer.js +89 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts +49 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/elements.js +409 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts +4 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/index.js +3 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts +173 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/types.js +28 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts +65 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/DynamicGrid/utils.js +193 -0
- package/lib/src/core-components/src/components/FormField/FormField.d.ts +1 -1
- package/lib/src/core-components/src/components/Icon/Icon.js +1 -1
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts +7 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/Masonry.js +73 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts +31 -0
- package/lib/src/core-components/src/components/Masonry/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/elements.js +122 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts +21 -0
- package/lib/src/core-components/src/components/Masonry/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/hooks.js +100 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts +4 -0
- package/lib/src/core-components/src/components/Masonry/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/index.js +3 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts +117 -0
- package/lib/src/core-components/src/components/Masonry/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Masonry/types.js +1 -0
- package/lib/src/core-components/src/components/Picker/color-picker-modal/color-picker-modal.component.js +1 -1
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts +8 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/Skeleton.js +51 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Skeleton/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/elements.js +238 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/index.js +2 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts +80 -0
- package/lib/src/core-components/src/components/Skeleton/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Skeleton/types.js +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts +4 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/SpeedDial.js +128 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts +57 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/elements.js +299 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts +3 -0
- package/lib/src/core-components/src/components/SpeedDial/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/index.js +2 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts +149 -0
- package/lib/src/core-components/src/components/SpeedDial/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/SpeedDial/types.js +3 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts +4 -0
- package/lib/src/core-components/src/components/Switch/Switch.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/Switch.js +26 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts +33 -0
- package/lib/src/core-components/src/components/Switch/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/elements.js +167 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Switch/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/index.js +2 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts +32 -0
- package/lib/src/core-components/src/components/Switch/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Switch/types.js +3 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts +7 -0
- package/lib/src/core-components/src/components/Table/Table.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/Table.js +357 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts +89 -0
- package/lib/src/core-components/src/components/Table/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/elements.js +604 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts +23 -0
- package/lib/src/core-components/src/components/Table/filters.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/filters.js +181 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts +107 -0
- package/lib/src/core-components/src/components/Table/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/hooks.js +451 -0
- package/lib/src/core-components/src/components/Table/index.d.ts +5 -0
- package/lib/src/core-components/src/components/Table/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/index.js +4 -0
- package/lib/src/core-components/src/components/Table/types.d.ts +358 -0
- package/lib/src/core-components/src/components/Table/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Table/types.js +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts +5 -0
- package/lib/src/core-components/src/components/Toast/Toast.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/Toast.js +50 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts +28 -0
- package/lib/src/core-components/src/components/Toast/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/elements.js +272 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Toast/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/index.js +2 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts +52 -0
- package/lib/src/core-components/src/components/Toast/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Toast/types.js +9 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts +7 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/Tooltip.js +200 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts +19 -0
- package/lib/src/core-components/src/components/Tooltip/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/elements.js +195 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts +3 -0
- package/lib/src/core-components/src/components/Tooltip/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/index.js +2 -0
- package/lib/src/core-components/src/components/Tooltip/types.d.ts +81 -17
- package/lib/src/core-components/src/components/Tooltip/types.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tooltip/types.js +17 -1
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts +26 -0
- package/lib/src/core-components/src/components/Tooltip/utils.d.ts.map +1 -0
- package/lib/src/core-components/src/components/Tooltip/utils.js +140 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts +5 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/TreeSelect.js +303 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts +74 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/elements.js +494 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts +57 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/hooks.js +252 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts +4 -0
- package/lib/src/core-components/src/components/TreeSelect/index.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/index.js +3 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts +205 -0
- package/lib/src/core-components/src/components/TreeSelect/types.d.ts.map +1 -0
- package/lib/src/core-components/src/components/TreeSelect/types.js +1 -0
- package/lib/src/core-components/src/components/index.d.ts +13 -1
- package/lib/src/core-components/src/components/index.d.ts.map +1 -1
- package/lib/src/core-components/src/components/index.js +14 -1
- package/lib/src/core-components/src/core-components/CoreButton/CoreButton.d.ts +2 -2
- package/lib/src/core-components/src/tc.global.css +7 -3
- package/lib/src/core-components/src/tc.module.css +2 -2
- package/package.json +1 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts +0 -29
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts.map +0 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.js +0 -10
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ChipVariant, ChipSize, ChipColor } from './types';
|
|
3
|
+
export declare const ChipElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
4
|
+
$variant: ChipVariant;
|
|
5
|
+
$size: ChipSize;
|
|
6
|
+
$color: ChipColor;
|
|
7
|
+
$selected: boolean;
|
|
8
|
+
$disabled: boolean;
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const IconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
11
|
+
$size: ChipSize;
|
|
12
|
+
$side: 'left' | 'right';
|
|
13
|
+
}>> & string;
|
|
14
|
+
export declare const AvatarWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
15
|
+
$size: ChipSize;
|
|
16
|
+
}>> & string;
|
|
17
|
+
export declare const DeleteButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
18
|
+
$size: ChipSize;
|
|
19
|
+
}>> & string;
|
|
20
|
+
export declare const ChipLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
21
|
+
export declare const ChipGroupElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
22
|
+
$gap: string;
|
|
23
|
+
$wrap: boolean;
|
|
24
|
+
$scrollable: boolean;
|
|
25
|
+
$direction: 'row' | 'column';
|
|
26
|
+
}>> & string;
|
|
27
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Chip/elements.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AA2IzD,eAAO,MAAM,WAAW;cACZ,WAAW;WACd,QAAQ;YACP,SAAS;eACN,OAAO;eACP,OAAO;YAmDnB,CAAC;AAEF,eAAO,MAAM,WAAW;WACf,QAAQ;WACR,MAAM,GAAG,OAAO;YAsBxB,CAAC;AAEF,eAAO,MAAM,aAAa;WACjB,QAAQ;YAoBhB,CAAC;AAEF,eAAO,MAAM,YAAY;WAChB,QAAQ;YAsBhB,CAAC;AAEF,eAAO,MAAM,SAAS,+NAErB,CAAC;AAEF,eAAO,MAAM,gBAAgB;UACrB,MAAM;WACL,OAAO;iBACD,OAAO;gBACR,KAAK,GAAG,QAAQ;YAkC7B,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { styled, css } from 'styled-components';
|
|
2
|
+
import { tokens } from '../../utils/designTokens';
|
|
3
|
+
// Size configurations
|
|
4
|
+
const sizeConfig = {
|
|
5
|
+
small: {
|
|
6
|
+
height: '24px',
|
|
7
|
+
padding: '0 8px',
|
|
8
|
+
fontSize: '0.75rem',
|
|
9
|
+
iconSize: '14px',
|
|
10
|
+
gap: '4px',
|
|
11
|
+
borderRadius: '12px',
|
|
12
|
+
},
|
|
13
|
+
medium: {
|
|
14
|
+
height: '32px',
|
|
15
|
+
padding: '0 12px',
|
|
16
|
+
fontSize: '0.8125rem',
|
|
17
|
+
iconSize: '16px',
|
|
18
|
+
gap: '6px',
|
|
19
|
+
borderRadius: '16px',
|
|
20
|
+
},
|
|
21
|
+
large: {
|
|
22
|
+
height: '40px',
|
|
23
|
+
padding: '0 16px',
|
|
24
|
+
fontSize: '0.875rem',
|
|
25
|
+
iconSize: '18px',
|
|
26
|
+
gap: '8px',
|
|
27
|
+
borderRadius: '20px',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
// Color configurations
|
|
31
|
+
const colorConfig = {
|
|
32
|
+
default: {
|
|
33
|
+
filled: { bg: tokens.onSurface || '#1a1a2e', text: '#fff', hover: '#2d2d42' },
|
|
34
|
+
outlined: {
|
|
35
|
+
border: tokens.outline || '#d1d5db',
|
|
36
|
+
text: tokens.onSurface || '#1a1a2e',
|
|
37
|
+
hover: '#f3f4f6',
|
|
38
|
+
},
|
|
39
|
+
soft: {
|
|
40
|
+
bg: tokens.surface || '#f3f4f6',
|
|
41
|
+
text: tokens.onSurface || '#1a1a2e',
|
|
42
|
+
hover: '#e5e7eb',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
primary: {
|
|
46
|
+
filled: { bg: tokens.primary || '#454cbf', text: '#fff', hover: '#3d44a5' },
|
|
47
|
+
outlined: {
|
|
48
|
+
border: tokens.primary || '#454cbf',
|
|
49
|
+
text: tokens.primary || '#454cbf',
|
|
50
|
+
hover: '#e7e8f8',
|
|
51
|
+
},
|
|
52
|
+
soft: { bg: '#e7e8f8', text: tokens.primary || '#454cbf', hover: '#d4d6f4' },
|
|
53
|
+
},
|
|
54
|
+
success: {
|
|
55
|
+
filled: { bg: '#10b981', text: '#fff', hover: '#059669' },
|
|
56
|
+
outlined: { border: '#10b981', text: '#10b981', hover: '#ecfdf5' },
|
|
57
|
+
soft: { bg: '#ecfdf5', text: '#065f46', hover: '#d1fae5' },
|
|
58
|
+
},
|
|
59
|
+
warning: {
|
|
60
|
+
filled: { bg: '#f59e0b', text: '#fff', hover: '#d97706' },
|
|
61
|
+
outlined: { border: '#f59e0b', text: '#f59e0b', hover: '#fffbeb' },
|
|
62
|
+
soft: { bg: '#fffbeb', text: '#92400e', hover: '#fef3c7' },
|
|
63
|
+
},
|
|
64
|
+
error: {
|
|
65
|
+
filled: { bg: '#ef4444', text: '#fff', hover: '#dc2626' },
|
|
66
|
+
outlined: { border: '#ef4444', text: '#ef4444', hover: '#fef2f2' },
|
|
67
|
+
soft: { bg: '#fef2f2', text: '#991b1b', hover: '#fee2e2' },
|
|
68
|
+
},
|
|
69
|
+
info: {
|
|
70
|
+
filled: { bg: '#3b82f6', text: '#fff', hover: '#2563eb' },
|
|
71
|
+
outlined: { border: '#3b82f6', text: '#3b82f6', hover: '#e7f3ff' },
|
|
72
|
+
soft: { bg: '#e7f3ff', text: '#1e40af', hover: '#dbeafe' },
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
const getVariantStyles = (variant, color, selected) => {
|
|
76
|
+
const colorSet = colorConfig[color];
|
|
77
|
+
if (variant === 'filled') {
|
|
78
|
+
const config = colorSet.filled;
|
|
79
|
+
return css `
|
|
80
|
+
background: ${selected ? config.hover : config.bg};
|
|
81
|
+
color: ${config.text};
|
|
82
|
+
border: 2px solid transparent;
|
|
83
|
+
|
|
84
|
+
&:hover:not(:disabled) {
|
|
85
|
+
background: ${config.hover};
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
if (variant === 'outlined') {
|
|
90
|
+
const config = colorSet.outlined;
|
|
91
|
+
return css `
|
|
92
|
+
background: ${selected ? config.hover : 'transparent'};
|
|
93
|
+
color: ${config.text};
|
|
94
|
+
border: 2px solid ${config.border};
|
|
95
|
+
|
|
96
|
+
&:hover:not(:disabled) {
|
|
97
|
+
background: ${config.hover};
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
}
|
|
101
|
+
// soft
|
|
102
|
+
const config = colorSet.soft;
|
|
103
|
+
return css `
|
|
104
|
+
background: ${selected ? config.hover : config.bg};
|
|
105
|
+
color: ${config.text};
|
|
106
|
+
border: 2px solid transparent;
|
|
107
|
+
|
|
108
|
+
&:hover:not(:disabled) {
|
|
109
|
+
background: ${config.hover};
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
};
|
|
113
|
+
export const ChipElement = styled.button `
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
gap: ${({ $size }) => sizeConfig[$size].gap};
|
|
118
|
+
height: ${({ $size }) => sizeConfig[$size].height};
|
|
119
|
+
padding: ${({ $size }) => sizeConfig[$size].padding};
|
|
120
|
+
font-size: ${({ $size }) => sizeConfig[$size].fontSize};
|
|
121
|
+
font-weight: 500;
|
|
122
|
+
font-family: inherit;
|
|
123
|
+
border-radius: ${({ $size }) => sizeConfig[$size].borderRadius};
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
transition: all 0.2s ease;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
user-select: none;
|
|
128
|
+
outline: none;
|
|
129
|
+
position: relative;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
|
|
132
|
+
${({ $variant, $color, $selected }) => getVariantStyles($variant, $color, $selected)}
|
|
133
|
+
|
|
134
|
+
/* Selected state visual indicator */
|
|
135
|
+
${({ $selected, $color, $variant }) => $selected &&
|
|
136
|
+
$variant === 'outlined' &&
|
|
137
|
+
css `
|
|
138
|
+
border-color: ${colorConfig[$color].outlined.text};
|
|
139
|
+
box-shadow: 0 0 0 1px ${colorConfig[$color].outlined.text};
|
|
140
|
+
`}
|
|
141
|
+
|
|
142
|
+
/* Disabled state */
|
|
143
|
+
${({ $disabled }) => $disabled &&
|
|
144
|
+
css `
|
|
145
|
+
opacity: 0.5;
|
|
146
|
+
cursor: not-allowed;
|
|
147
|
+
`}
|
|
148
|
+
|
|
149
|
+
/* Focus visible */
|
|
150
|
+
&:focus-visible {
|
|
151
|
+
box-shadow:
|
|
152
|
+
0 0 0 2px ${tokens.surface || '#fff'},
|
|
153
|
+
0 0 0 4px ${tokens.primary || '#454cbf'};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Active state */
|
|
157
|
+
&:active:not(:disabled) {
|
|
158
|
+
transform: scale(0.97);
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
export const IconWrapper = styled.span `
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
width: ${({ $size }) => sizeConfig[$size].iconSize};
|
|
167
|
+
height: ${({ $size }) => sizeConfig[$size].iconSize};
|
|
168
|
+
|
|
169
|
+
${({ $side }) => $side === 'left'
|
|
170
|
+
? css `
|
|
171
|
+
margin-left: -2px;
|
|
172
|
+
`
|
|
173
|
+
: css `
|
|
174
|
+
margin-right: -2px;
|
|
175
|
+
`}
|
|
176
|
+
|
|
177
|
+
svg {
|
|
178
|
+
width: 100%;
|
|
179
|
+
height: 100%;
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
export const AvatarWrapper = styled.span `
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
flex-shrink: 0;
|
|
187
|
+
width: ${({ $size }) => $size === 'small' ? '18px' : $size === 'large' ? '28px' : '24px'};
|
|
188
|
+
height: ${({ $size }) => $size === 'small' ? '18px' : $size === 'large' ? '28px' : '24px'};
|
|
189
|
+
border-radius: 50%;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
margin-left: ${({ $size }) => $size === 'small' ? '-4px' : $size === 'large' ? '-10px' : '-6px'};
|
|
192
|
+
|
|
193
|
+
img {
|
|
194
|
+
width: 100%;
|
|
195
|
+
height: 100%;
|
|
196
|
+
object-fit: cover;
|
|
197
|
+
}
|
|
198
|
+
`;
|
|
199
|
+
export const DeleteButton = styled.span `
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
width: ${({ $size }) => $size === 'small' ? '14px' : $size === 'large' ? '18px' : '16px'};
|
|
205
|
+
height: ${({ $size }) => $size === 'small' ? '14px' : $size === 'large' ? '18px' : '16px'};
|
|
206
|
+
border-radius: 50%;
|
|
207
|
+
margin-right: -4px;
|
|
208
|
+
transition: all 0.2s ease;
|
|
209
|
+
|
|
210
|
+
&:hover {
|
|
211
|
+
background: rgba(0, 0, 0, 0.1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
svg {
|
|
215
|
+
width: 100%;
|
|
216
|
+
height: 100%;
|
|
217
|
+
}
|
|
218
|
+
`;
|
|
219
|
+
export const ChipLabel = styled.span `
|
|
220
|
+
line-height: 1;
|
|
221
|
+
`;
|
|
222
|
+
export const ChipGroupElement = styled.div `
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: ${({ $direction }) => $direction};
|
|
225
|
+
gap: ${({ $gap }) => $gap};
|
|
226
|
+
|
|
227
|
+
${({ $wrap }) => $wrap &&
|
|
228
|
+
css `
|
|
229
|
+
flex-wrap: wrap;
|
|
230
|
+
`}
|
|
231
|
+
|
|
232
|
+
${({ $scrollable, $direction }) => $scrollable &&
|
|
233
|
+
css `
|
|
234
|
+
overflow-x: ${$direction === 'row' ? 'auto' : 'visible'};
|
|
235
|
+
overflow-y: ${$direction === 'column' ? 'auto' : 'visible'};
|
|
236
|
+
padding-bottom: ${$direction === 'row' ? '4px' : '0'};
|
|
237
|
+
|
|
238
|
+
/* Custom scrollbar */
|
|
239
|
+
&::-webkit-scrollbar {
|
|
240
|
+
height: 4px;
|
|
241
|
+
width: 4px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&::-webkit-scrollbar-track {
|
|
245
|
+
background: transparent;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&::-webkit-scrollbar-thumb {
|
|
249
|
+
background: ${tokens.outline || '#d1d5db'};
|
|
250
|
+
border-radius: 2px;
|
|
251
|
+
}
|
|
252
|
+
`}
|
|
253
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AACvC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CHIP_VARIANTS: readonly ["filled", "outlined", "soft"];
|
|
3
|
+
export type ChipVariant = (typeof CHIP_VARIANTS)[number];
|
|
4
|
+
export declare const CHIP_SIZES: readonly ["small", "medium", "large"];
|
|
5
|
+
export type ChipSize = (typeof CHIP_SIZES)[number];
|
|
6
|
+
export declare const CHIP_COLORS: readonly ["default", "primary", "success", "warning", "error", "info"];
|
|
7
|
+
export type ChipColor = (typeof CHIP_COLORS)[number];
|
|
8
|
+
export declare const CHIP_TYPES: readonly ["button", "selection", "filter", "input"];
|
|
9
|
+
export type ChipType = (typeof CHIP_TYPES)[number];
|
|
10
|
+
export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
11
|
+
/** Chip label text */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Visual variant */
|
|
14
|
+
variant?: ChipVariant;
|
|
15
|
+
/** Size of the chip */
|
|
16
|
+
size?: ChipSize;
|
|
17
|
+
/** Color scheme */
|
|
18
|
+
color?: ChipColor;
|
|
19
|
+
/** Chip behavior type */
|
|
20
|
+
chipType?: ChipType;
|
|
21
|
+
/** Whether the chip is selected */
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
/** Whether the chip is disabled */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Icon on the left side */
|
|
26
|
+
iconLeft?: React.ReactNode;
|
|
27
|
+
/** Icon on the right side */
|
|
28
|
+
iconRight?: React.ReactNode;
|
|
29
|
+
/** Show delete icon (for input type) */
|
|
30
|
+
deletable?: boolean;
|
|
31
|
+
/** Delete handler */
|
|
32
|
+
onDelete?: () => void;
|
|
33
|
+
/** Click handler */
|
|
34
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
35
|
+
/** Avatar or image on left */
|
|
36
|
+
avatar?: React.ReactNode;
|
|
37
|
+
/** Additional class name */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ChipGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
/** Children chips */
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
/** Gap between chips */
|
|
44
|
+
gap?: string;
|
|
45
|
+
/** Wrap chips */
|
|
46
|
+
wrap?: boolean;
|
|
47
|
+
/** Horizontal scroll on overflow */
|
|
48
|
+
scrollable?: boolean;
|
|
49
|
+
/** Direction */
|
|
50
|
+
direction?: 'row' | 'column';
|
|
51
|
+
/** Additional class name */
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,aAAa,yCAA0C,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,UAAU,uCAAwC,CAAC;AAChE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,WAAW,wEAAyE,CAAC;AAClG,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,eAAO,MAAM,UAAU,qDAAsD,CAAC;AAC9E,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC5F,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,mBAAmB;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oBAAoB;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC3D,8BAA8B;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const CHIP_VARIANTS = ['filled', 'outlined', 'soft'];
|
|
2
|
+
export const CHIP_SIZES = ['small', 'medium', 'large'];
|
|
3
|
+
export const CHIP_COLORS = ['default', 'primary', 'success', 'warning', 'error', 'info'];
|
|
4
|
+
export const CHIP_TYPES = ['button', 'selection', 'filter', 'input'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,OAAO,qFA4EnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { DividerContainer, DividerLine, DividerLabel } from './elements';
|
|
5
|
+
export const Divider = forwardRef(function DividerComponent(props, ref) {
|
|
6
|
+
const { orientation = 'horizontal', variant = 'solid', size = 'thin', color = 'default', inset = '0', centerInset = false, label, labelPosition = 'center', className, ...rest } = props;
|
|
7
|
+
const hasLabel = Boolean(label);
|
|
8
|
+
// Calculate flex values for label positioning
|
|
9
|
+
const getFlexValues = () => {
|
|
10
|
+
if (!hasLabel)
|
|
11
|
+
return { start: 1, end: 0 };
|
|
12
|
+
switch (labelPosition) {
|
|
13
|
+
case 'start':
|
|
14
|
+
return { start: 0, end: 1 };
|
|
15
|
+
case 'end':
|
|
16
|
+
return { start: 1, end: 0 };
|
|
17
|
+
case 'center':
|
|
18
|
+
default:
|
|
19
|
+
return { start: 1, end: 1 };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const flexValues = getFlexValues();
|
|
23
|
+
return (_jsxs(DividerContainer, { ref: ref, "$orientation": orientation, "$variant": variant, "$size": size, "$color": color, "$inset": inset, "$centerInset": centerInset, "$hasLabel": hasLabel, role: "separator", "aria-orientation": orientation, "data-aui": "divider", className: className, ...rest, children: [flexValues.start > 0 && (_jsx(DividerLine, { "$orientation": orientation, "$variant": variant, "$size": size, "$color": color, "$flex": flexValues.start })), hasLabel && (_jsx(DividerLabel, { "$color": color, children: label })), flexValues.end > 0 && (_jsx(DividerLine, { "$orientation": orientation, "$variant": variant, "$size": size, "$color": color, "$flex": flexValues.end }))] }));
|
|
24
|
+
});
|
|
25
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DividerOrientation, DividerVariant, DividerSize, DividerColor } from './types';
|
|
3
|
+
export declare const DividerContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
+
$orientation: DividerOrientation;
|
|
5
|
+
$variant: DividerVariant;
|
|
6
|
+
$size: DividerSize;
|
|
7
|
+
$color: DividerColor;
|
|
8
|
+
$inset: string;
|
|
9
|
+
$centerInset: boolean;
|
|
10
|
+
$hasLabel: boolean;
|
|
11
|
+
}>> & string;
|
|
12
|
+
export declare const DividerLine: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
13
|
+
$orientation: DividerOrientation;
|
|
14
|
+
$variant: DividerVariant;
|
|
15
|
+
$size: DividerSize;
|
|
16
|
+
$color: DividerColor;
|
|
17
|
+
$flex?: number | undefined;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const DividerLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
20
|
+
$color: DividerColor;
|
|
21
|
+
}>> & string;
|
|
22
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Divider/elements.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAiBtF,eAAO,MAAM,gBAAgB;kBACb,kBAAkB;cACtB,cAAc;WACjB,WAAW;YACV,YAAY;YACZ,MAAM;kBACA,OAAO;eACV,OAAO;YAqBnB,CAAC;AAEF,eAAO,MAAM,WAAW;kBACR,kBAAkB;cACtB,cAAc;WACjB,WAAW;YACV,YAAY;;YA6DrB,CAAC;AAEF,eAAO,MAAM,YAAY;YACf,YAAY;YAWrB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { styled, css } from 'styled-components';
|
|
2
|
+
import { tokens } from '../../utils/designTokens';
|
|
3
|
+
// Size values
|
|
4
|
+
const sizeValues = {
|
|
5
|
+
thin: '1px',
|
|
6
|
+
medium: '2px',
|
|
7
|
+
thick: '4px',
|
|
8
|
+
};
|
|
9
|
+
// Color values
|
|
10
|
+
const colorValues = {
|
|
11
|
+
default: tokens.outline || '#e9ecef',
|
|
12
|
+
primary: tokens.primary || '#454cbf',
|
|
13
|
+
subtle: tokens.outlineSoft || '#f1f3f5',
|
|
14
|
+
dark: '#374151',
|
|
15
|
+
};
|
|
16
|
+
export const DividerContainer = styled.div `
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
${({ $orientation, $inset, $centerInset }) => $orientation === 'horizontal'
|
|
21
|
+
? css `
|
|
22
|
+
width: ${$centerInset
|
|
23
|
+
? `calc(100% - (${$inset} * 2))`
|
|
24
|
+
: `calc(100% - ${$inset})`};
|
|
25
|
+
margin-left: ${$inset};
|
|
26
|
+
${$centerInset && `margin-right: ${$inset};`}
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
`
|
|
29
|
+
: css `
|
|
30
|
+
height: 100%;
|
|
31
|
+
margin-top: ${$inset};
|
|
32
|
+
${$centerInset && `margin-bottom: ${$inset};`}
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
`}
|
|
35
|
+
`;
|
|
36
|
+
export const DividerLine = styled.div `
|
|
37
|
+
flex: ${({ $flex }) => $flex ?? 1};
|
|
38
|
+
|
|
39
|
+
${({ $orientation, $size, $variant, $color }) => $orientation === 'horizontal'
|
|
40
|
+
? css `
|
|
41
|
+
height: ${sizeValues[$size]};
|
|
42
|
+
width: 100%;
|
|
43
|
+
`
|
|
44
|
+
: css `
|
|
45
|
+
width: ${sizeValues[$size]};
|
|
46
|
+
height: 100%;
|
|
47
|
+
`}
|
|
48
|
+
|
|
49
|
+
/* Variant styles */
|
|
50
|
+
${({ $variant, $color }) => {
|
|
51
|
+
const colorValue = colorValues[$color];
|
|
52
|
+
switch ($variant) {
|
|
53
|
+
case 'solid':
|
|
54
|
+
return css `
|
|
55
|
+
background-color: ${colorValue};
|
|
56
|
+
`;
|
|
57
|
+
case 'dashed':
|
|
58
|
+
return css `
|
|
59
|
+
background-image: repeating-linear-gradient(
|
|
60
|
+
90deg,
|
|
61
|
+
${colorValue},
|
|
62
|
+
${colorValue} 8px,
|
|
63
|
+
transparent 8px,
|
|
64
|
+
transparent 16px
|
|
65
|
+
);
|
|
66
|
+
`;
|
|
67
|
+
case 'dotted':
|
|
68
|
+
return css `
|
|
69
|
+
background-image: repeating-linear-gradient(
|
|
70
|
+
90deg,
|
|
71
|
+
${colorValue},
|
|
72
|
+
${colorValue} 4px,
|
|
73
|
+
transparent 4px,
|
|
74
|
+
transparent 12px
|
|
75
|
+
);
|
|
76
|
+
`;
|
|
77
|
+
case 'gradient':
|
|
78
|
+
return css `
|
|
79
|
+
background: linear-gradient(
|
|
80
|
+
90deg,
|
|
81
|
+
transparent 0%,
|
|
82
|
+
${colorValue} 20%,
|
|
83
|
+
${colorValue} 80%,
|
|
84
|
+
transparent 100%
|
|
85
|
+
);
|
|
86
|
+
`;
|
|
87
|
+
default:
|
|
88
|
+
return css `
|
|
89
|
+
background-color: ${colorValue};
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
}}
|
|
93
|
+
`;
|
|
94
|
+
export const DividerLabel = styled.span `
|
|
95
|
+
padding: 0 ${tokens.spacing150 || '0.75rem'};
|
|
96
|
+
font-size: 0.75rem;
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
text-transform: uppercase;
|
|
99
|
+
letter-spacing: 0.05em;
|
|
100
|
+
color: ${({ $color }) => $color === 'dark' ? '#9ca3af' : tokens.onSurface ? `${tokens.onSurface}80` : '#6c757d'};
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Divider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DIVIDER_ORIENTATIONS: readonly ["horizontal", "vertical"];
|
|
3
|
+
export type DividerOrientation = (typeof DIVIDER_ORIENTATIONS)[number];
|
|
4
|
+
export declare const DIVIDER_VARIANTS: readonly ["solid", "dashed", "dotted", "gradient"];
|
|
5
|
+
export type DividerVariant = (typeof DIVIDER_VARIANTS)[number];
|
|
6
|
+
export declare const DIVIDER_SIZES: readonly ["thin", "medium", "thick"];
|
|
7
|
+
export type DividerSize = (typeof DIVIDER_SIZES)[number];
|
|
8
|
+
export declare const DIVIDER_COLORS: readonly ["default", "primary", "subtle", "dark"];
|
|
9
|
+
export type DividerColor = (typeof DIVIDER_COLORS)[number];
|
|
10
|
+
export interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Orientation of the divider */
|
|
12
|
+
orientation?: DividerOrientation;
|
|
13
|
+
/** Visual variant */
|
|
14
|
+
variant?: DividerVariant;
|
|
15
|
+
/** Thickness of the divider */
|
|
16
|
+
size?: DividerSize;
|
|
17
|
+
/** Color scheme */
|
|
18
|
+
color?: DividerColor;
|
|
19
|
+
/** Inset from edges */
|
|
20
|
+
inset?: string;
|
|
21
|
+
/** Center the inset (from both sides) */
|
|
22
|
+
centerInset?: boolean;
|
|
23
|
+
/** Label text in the middle */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Label position */
|
|
26
|
+
labelPosition?: 'start' | 'center' | 'end';
|
|
27
|
+
/** Additional class name */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Divider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,oBAAoB,qCAAsC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,eAAO,MAAM,gBAAgB,oDAAqD,CAAC;AACnF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,aAAa,sCAAuC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,mDAAoD,CAAC;AAChF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACxE,iCAAiC;IACjC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,qBAAqB;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,aAAa,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC3C,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const DIVIDER_ORIENTATIONS = ['horizontal', 'vertical'];
|
|
2
|
+
export const DIVIDER_VARIANTS = ['solid', 'dashed', 'dotted', 'gradient'];
|
|
3
|
+
export const DIVIDER_SIZES = ['thin', 'medium', 'thick'];
|
|
4
|
+
export const DIVIDER_COLORS = ['default', 'primary', 'subtle', 'dark'];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DynamicGridProps, GridItemProps, GridContextValue } from './types';
|
|
3
|
+
export declare const useGridContext: () => GridContextValue | null;
|
|
4
|
+
export declare const DynamicGrid: React.ForwardRefExoticComponent<DynamicGridProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const DynamicGridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
//# sourceMappingURL=DynamicGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicGrid.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/DynamicGrid/DynamicGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KASN,MAAM,OAAO,CAAC;AAaf,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAejB,eAAO,MAAM,cAAc,+BAAgC,CAAC;AA8D5D,eAAO,MAAM,WAAW,yFAyRvB,CAAC;AAGF,eAAO,MAAM,eAAe,sFAiC3B,CAAC"}
|