@chotot/clad-ui 2.0.0-next.4 → 2.0.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/README.md +5 -9
- package/dist/components/Announcer/Announcer.stories.d.ts.map +1 -1
- package/dist/components/Announcer/Announcer.stories.js +1 -26
- package/dist/components/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Badge/Badge.stories.js +1 -2
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +6 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.js +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -25
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.js +28 -83
- package/dist/components/Button/Button.d.ts +7 -16
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +5 -3
- package/dist/components/Button/Button.stories.d.ts +2 -2
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.js +19 -1
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +14 -11
- package/dist/components/Button/GhostButton.d.ts +5 -25
- package/dist/components/Button/GhostButton.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.js +4 -4
- package/dist/components/Button/GhostButton.stories.d.ts +2 -2
- package/dist/components/Button/GhostButton.stories.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.stories.js +19 -1
- package/dist/components/Button/IconButton.d.ts +1 -2
- package/dist/components/Button/IconButton.d.ts.map +1 -1
- package/dist/components/Button/IconButton.js +2 -7
- package/dist/components/Button/IconButton.stories.d.ts +2 -2
- package/dist/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Button/IconButton.stories.js +18 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -10
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -34
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.stories.js +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +2 -13
- package/dist/components/Input/Input.stories.js +1 -1
- package/dist/components/Pagination/PageItem.d.ts +6 -11
- package/dist/components/Pagination/PageItem.d.ts.map +1 -1
- package/dist/components/Pagination/PageItem.js +11 -5
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -3
- package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.stories.js +5 -15
- package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/components/Popover/Popover.stories.js +1 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -10
- package/dist/components/RadioButton/RadioButton.stories.d.ts.map +1 -1
- package/dist/components/RadioButton/RadioButton.stories.js +1 -38
- package/dist/components/RowItem/RowItem.stories.d.ts.map +1 -1
- package/dist/components/RowItem/RowItem.stories.js +1 -2
- package/dist/components/Slider/Slider.stories.js +1 -1
- package/dist/components/Snack/Snack.stories.js +1 -1
- package/dist/components/Tabs/Tab.d.ts +7 -14
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +5 -9
- package/dist/components/Tabs/Tabs.stories.d.ts +3 -3
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.stories.js +32 -10
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextLabel/TextLabel.stories.js +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.js +1 -30
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/patterns/Drawer/Drawer.d.ts +1 -0
- package/dist/patterns/Drawer/Drawer.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.js +7 -16
- package/dist/patterns/Drawer/Drawer.stories.d.ts +6 -0
- package/dist/patterns/Drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.stories.js +23 -24
- package/dist/patterns/Drawer/Drawer.styles.d.ts +1 -2
- package/dist/patterns/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.styles.js +1 -6
- package/dist/patterns/EmptyState/EmptyState.stories.js +1 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.js +1 -1
- package/dist/patterns/Popup/Popup.d.ts +1 -0
- package/dist/patterns/Popup/Popup.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.js +6 -15
- package/dist/patterns/Popup/Popup.stories.d.ts +6 -0
- package/dist/patterns/Popup/Popup.stories.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.stories.js +29 -30
- package/dist/patterns/Popup/Popup.styles.d.ts +1 -2
- package/dist/patterns/Popup/Popup.styles.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.styles.js +1 -6
- package/dist/patterns/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/dist/patterns/SearchInput/SearchInput.stories.js +1 -3
- package/dist/patterns/TagCloud/TagCloud.stories.d.ts.map +1 -1
- package/dist/patterns/TagCloud/TagCloud.stories.js +1 -5
- package/dist/theme/chotot.d.ts +49 -48
- package/dist/theme/chotot.d.ts.map +1 -1
- package/dist/theme/chotot.js +8 -7
- package/dist/theme/ct-job.d.ts +48 -47
- package/dist/theme/ct-job.d.ts.map +1 -1
- package/dist/theme/ct-pty.d.ts +48 -47
- package/dist/theme/ct-pty.d.ts.map +1 -1
- package/dist/theme/ct-veh.d.ts +49 -48
- package/dist/theme/ct-veh.d.ts.map +1 -1
- package/dist/theme/ct-veh.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/scrollLock/index.d.ts +7 -0
- package/dist/utils/scrollLock/index.d.ts.map +1 -0
- package/dist/utils/scrollLock/index.js +7 -0
- package/dist/utils/scrollLock/scrollLock.styles.d.ts +6 -0
- package/dist/utils/scrollLock/scrollLock.styles.d.ts.map +1 -0
- package/dist/utils/scrollLock/scrollLock.styles.js +9 -0
- package/dist/utils/scrollLock/useBodyScrollLock.d.ts +10 -0
- package/dist/utils/scrollLock/useBodyScrollLock.d.ts.map +1 -0
- package/dist/utils/scrollLock/useBodyScrollLock.js +41 -0
- package/dist/utils/sx.d.ts +8 -8
- package/dist/utils/types.d.ts +23 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +5 -0
- package/package.json +4 -3
- package/dist/storybook/GuideImage.d.ts +0 -9
- package/dist/storybook/GuideImage.d.ts.map +0 -1
- package/dist/storybook/GuideImage.js +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-veh.d.ts","sourceRoot":"","sources":["../../theme/ct-veh.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkFA;;QA1DE;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG
|
|
1
|
+
{"version":3,"file":"ct-veh.d.ts","sourceRoot":"","sources":["../../theme/ct-veh.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkFA;;QA1DE;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWH"}
|
package/dist/theme/ct-veh.js
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { default as sx } from "./sx";
|
|
|
3
3
|
export { default as getBreakpointsValues } from "./getBreakpointsValues";
|
|
4
4
|
export { default as cleanHtml } from "./cleanHtml";
|
|
5
5
|
export { default as cx } from "./cx";
|
|
6
|
+
export { default as useBodyScrollLock } from "./scrollLock";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll Lock utilities for modal/drawer components
|
|
3
|
+
*/
|
|
4
|
+
export { useBodyScrollLock } from './useBodyScrollLock';
|
|
5
|
+
export { scrollLockedClass } from './scrollLock.styles';
|
|
6
|
+
export { useBodyScrollLock as default } from './useBodyScrollLock';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/scrollLock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll Lock utilities for modal/drawer components
|
|
3
|
+
*/
|
|
4
|
+
export { useBodyScrollLock } from './useBodyScrollLock';
|
|
5
|
+
export { scrollLockedClass } from './scrollLock.styles';
|
|
6
|
+
// Re-export the hook as default
|
|
7
|
+
export { useBodyScrollLock as default } from './useBodyScrollLock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollLock.styles.d.ts","sourceRoot":"","sources":["../../../utils/scrollLock/scrollLock.styles.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,0CAG7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to manage body scroll locking with reference counting.
|
|
3
|
+
* Supports multiple modals/drawers being open simultaneously.
|
|
4
|
+
* Only locks scroll when the first modal opens, and only unlocks when all modals are closed.
|
|
5
|
+
*
|
|
6
|
+
* @param isActive - Whether the modal/drawer should contribute to the scroll lock
|
|
7
|
+
*/
|
|
8
|
+
export declare function useBodyScrollLock(isActive: boolean): void;
|
|
9
|
+
export default useBodyScrollLock;
|
|
10
|
+
//# sourceMappingURL=useBodyScrollLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBodyScrollLock.d.ts","sourceRoot":"","sources":["../../../utils/scrollLock/useBodyScrollLock.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,QA+BlD;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { scrollLockedClass } from './scrollLock.styles';
|
|
3
|
+
const COUNT_ATTR = 'data-ct-modal-count';
|
|
4
|
+
/**
|
|
5
|
+
* Hook to manage body scroll locking with reference counting.
|
|
6
|
+
* Supports multiple modals/drawers being open simultaneously.
|
|
7
|
+
* Only locks scroll when the first modal opens, and only unlocks when all modals are closed.
|
|
8
|
+
*
|
|
9
|
+
* @param isActive - Whether the modal/drawer should contribute to the scroll lock
|
|
10
|
+
*/
|
|
11
|
+
export function useBodyScrollLock(isActive) {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!document)
|
|
14
|
+
return;
|
|
15
|
+
const { body } = document;
|
|
16
|
+
if (!body)
|
|
17
|
+
return;
|
|
18
|
+
const getCount = () => parseInt(body.getAttribute(COUNT_ATTR) || '0', 10);
|
|
19
|
+
const setCount = (count) => body.setAttribute(COUNT_ATTR, count.toString());
|
|
20
|
+
if (isActive) {
|
|
21
|
+
const current = getCount();
|
|
22
|
+
const newCount = current + 1;
|
|
23
|
+
setCount(newCount);
|
|
24
|
+
if (newCount === 1) {
|
|
25
|
+
body.classList.add(scrollLockedClass);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return () => {
|
|
29
|
+
if (isActive) {
|
|
30
|
+
const current = getCount();
|
|
31
|
+
const newCount = Math.max(0, current - 1);
|
|
32
|
+
setCount(newCount);
|
|
33
|
+
if (newCount === 0) {
|
|
34
|
+
body.classList.remove(scrollLockedClass);
|
|
35
|
+
body.removeAttribute(COUNT_ATTR);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}, [isActive]);
|
|
40
|
+
}
|
|
41
|
+
export default useBodyScrollLock;
|
package/dist/utils/sx.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export type FontSizes = "body" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subt
|
|
|
96
96
|
export type Shadows = "none" | "sm" | "md" | "lg";
|
|
97
97
|
export type BorderWidths = "none" | "sm" | "md" | "lg" | "xl" | "strokeDivider" | "strokeAction" | "strokeEmphasize";
|
|
98
98
|
export type Radii = "none" | "circle" | "xs" | "sm" | "md" | "lg" | "xl" | "$sm" | "pill";
|
|
99
|
-
export type Sizes = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl";
|
|
99
|
+
export type Sizes = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl";
|
|
100
100
|
/**
|
|
101
101
|
* - Themeable style object
|
|
102
102
|
*/
|
|
@@ -156,13 +156,13 @@ export type ThemableStyle = {
|
|
|
156
156
|
boxShadow?: "none" | "sm" | "md" | "lg" | ("none" | "sm" | "md" | "lg")[] | undefined;
|
|
157
157
|
textShadow?: "none" | "sm" | "md" | "lg" | ("none" | "sm" | "md" | "lg")[] | undefined;
|
|
158
158
|
zIndex?: number | number[] | undefined;
|
|
159
|
-
width?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
160
|
-
minWidth?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
161
|
-
maxWidth?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
162
|
-
height?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
163
|
-
minHeight?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
164
|
-
maxHeight?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
165
|
-
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
159
|
+
width?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
160
|
+
minWidth?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
161
|
+
maxWidth?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
162
|
+
height?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
163
|
+
minHeight?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
164
|
+
maxHeight?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
165
|
+
size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl" | ("xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "xxxs" | "xxxxl" | "xxxxxl" | "$sm" | "vW" | "vH" | "quarter" | "third" | "half" | "twoThird" | "threeQuarter" | "full" | "lxl" | "buttonMaxWidth" | "$md" | "$lg" | "$xl")[] | undefined;
|
|
166
166
|
};
|
|
167
167
|
/**
|
|
168
168
|
* All standard CSS properties as regular object, except those from ThemableStyle
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ReactRef<T> = React.RefObject<T> | React.MutableRefObject<T> | React.Ref<T>;
|
|
2
|
+
export type As<Props = any> = React.ElementType<Props>;
|
|
3
|
+
export type PropsOf<T extends As> = React.ComponentPropsWithoutRef<T> & {
|
|
4
|
+
as?: As;
|
|
5
|
+
};
|
|
6
|
+
export type HTMLCladUIProps<T extends As = 'div', OmitKeys extends keyof any = never> = Omit<PropsOf<T>, OmitKeys> & {
|
|
7
|
+
as?: As;
|
|
8
|
+
};
|
|
9
|
+
export type RightJoinProps<SourceProps extends object = {}, OverrideProps extends object = {}> = Omit<SourceProps, keyof OverrideProps | 'as'> & OverrideProps;
|
|
10
|
+
export type MergeWithAs<ComponentProps extends object, AsProps extends object, AdditionalProps extends object = {}, AsComponent extends As = As> = (RightJoinProps<ComponentProps, AdditionalProps> | RightJoinProps<AsProps, AdditionalProps>) & {
|
|
11
|
+
as?: AsComponent;
|
|
12
|
+
};
|
|
13
|
+
export type InternalForwardRefRenderFunction<Component extends As, Props extends object = {}> = {
|
|
14
|
+
<AsComponent extends As = Component>(props: MergeWithAs<React.ComponentPropsWithoutRef<Component>, React.ComponentPropsWithoutRef<AsComponent>, Props, AsComponent>): React.ReactElement | null;
|
|
15
|
+
readonly $$typeof: symbol;
|
|
16
|
+
defaultProps?: Partial<Props> | undefined;
|
|
17
|
+
propTypes?: React.WeakValidationMap<Props> | undefined;
|
|
18
|
+
displayName?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare function forwardRef<Component extends As, Props extends object>(component: React.ForwardRefRenderFunction<any, RightJoinProps<PropsOf<Component>, Props> & {
|
|
21
|
+
as?: As;
|
|
22
|
+
}>): InternalForwardRefRenderFunction<Component, Props>;
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../utils/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExF,MAAM,MAAM,EAAE,CAAC,KAAK,GAAG,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAEvD,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,GAAG;IACtE,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,EAAE,GAAG,KAAK,EAAE,QAAQ,SAAS,MAAM,GAAG,GAAG,KAAK,IAAI,IAAI,CAC1F,OAAO,CAAC,CAAC,CAAC,EACV,QAAQ,CACT,GAAG;IACF,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,cAAc,CACxB,WAAW,SAAS,MAAM,GAAG,EAAE,EAC/B,aAAa,SAAS,MAAM,GAAG,EAAE,IAC/B,IAAI,CAAC,WAAW,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,aAAa,CAAC;AAElE,MAAM,MAAM,WAAW,CACrB,cAAc,SAAS,MAAM,EAC7B,OAAO,SAAS,MAAM,EACtB,eAAe,SAAS,MAAM,GAAG,EAAE,EACnC,WAAW,SAAS,EAAE,GAAG,EAAE,IACzB,CAAC,cAAc,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,GAAG;IACjG,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,SAAS,SAAS,EAAE,EAAE,KAAK,SAAS,MAAM,GAAG,EAAE,IAAI;IAC9F,CAAC,WAAW,SAAS,EAAE,GAAG,SAAS,EACjC,KAAK,EAAE,WAAW,CAChB,KAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC,EACzC,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAC3C,KAAK,EACL,WAAW,CACZ,GACA,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,wBAAgB,UAAU,CAAC,SAAS,SAAS,EAAE,EAAE,KAAK,SAAS,MAAM,EACnE,SAAS,EAAE,KAAK,CAAC,wBAAwB,CACvC,GAAG,EACH,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG;IAC1C,EAAE,CAAC,EAAE,EAAE,CAAC;CACT,CACF,GAEmC,gCAAgC,CAAC,SAAS,EAAE,KAAK,CAAC,CACvF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chotot/clad-ui",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Classified Ads group (Carousell, Chotot, Mudah, Onekyat) design system.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"./theme": "./dist/theme/index.js",
|
|
29
29
|
"./utils": "./dist/utils/index.js",
|
|
30
30
|
"./package.json": "./package.json",
|
|
31
|
-
"./README.md": "./README.md"
|
|
31
|
+
"./README.md": "./README.md",
|
|
32
|
+
"./CHANGELOG.md": "./CHANGELOG.md"
|
|
32
33
|
},
|
|
33
34
|
"main": "./dist/index.js",
|
|
34
35
|
"types": "./dist/index.d.ts",
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
"rimraf": "^3.0.2",
|
|
76
77
|
"sort-package-json": "2.4.1",
|
|
77
78
|
"stylelint": "*",
|
|
78
|
-
"@clad-ui/dotfiles": "0.
|
|
79
|
+
"@clad-ui/dotfiles": "0.5.0"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
82
|
"@linaria/core": "^4.2.10",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default GuideImage;
|
|
2
|
-
declare function GuideImage({ isBad, isGood, alt, ...props }: {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
isBad?: boolean | undefined;
|
|
5
|
-
isGood?: boolean | undefined;
|
|
6
|
-
alt: any;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
export const guideImageClass: import("@linaria/core").LinariaClassName;
|
|
9
|
-
//# sourceMappingURL=GuideImage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GuideImage.d.ts","sourceRoot":"","sources":["../../storybook/GuideImage.js"],"names":[],"mappings":";AAyCA;;;;;gBAEC;AAtBD,uEAkBE"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2021, ChoTot Ltd.
|
|
3
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
*
|
|
7
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
* See the License for the specific language governing permissions and
|
|
13
|
-
* limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { css, cx } from '@linaria/core';
|
|
17
|
-
import theme from '@clad-ui/theme';
|
|
18
|
-
const { space, colors, radii } = theme;
|
|
19
|
-
const guideImageClass = css `
|
|
20
|
-
display: block;
|
|
21
|
-
margin: auto;
|
|
22
|
-
margin-bottom: ${space.sm};
|
|
23
|
-
border-radius: ${radii.sm};
|
|
24
|
-
padding: ${space.sm};
|
|
25
|
-
background-color: ${colors.neutralBG};
|
|
26
|
-
max-height: 400px;
|
|
27
|
-
max-width: 100%;
|
|
28
|
-
width: auto;
|
|
29
|
-
|
|
30
|
-
&.do {
|
|
31
|
-
background-color: ${colors.positiveBG};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.dont {
|
|
35
|
-
background-color: ${colors.criticalBG};
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
const GuideImage = ({ isBad = false, isGood = false, alt, ...props }) => (<img className={cx(guideImageClass, isGood && 'do', isBad && 'dont')} alt={alt} {...props}/>);
|
|
39
|
-
export default GuideImage;
|
|
40
|
-
export { guideImageClass };
|