@stack-spot/citric-react 0.22.0 → 0.23.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/citric.css +17 -4
- package/dist/components/Accordion.d.ts +34 -0
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion.js +34 -0
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Alert.d.ts +8 -0
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +8 -0
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/AsyncContent.d.ts +18 -4
- package/dist/components/AsyncContent.d.ts.map +1 -1
- package/dist/components/AsyncContent.js +18 -4
- package/dist/components/AsyncContent.js.map +1 -1
- package/dist/components/Avatar.d.ts +9 -0
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar.js +11 -1
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/AvatarGroup.d.ts +8 -0
- package/dist/components/AvatarGroup.d.ts.map +1 -1
- package/dist/components/AvatarGroup.js +8 -0
- package/dist/components/AvatarGroup.js.map +1 -1
- package/dist/components/Badge.d.ts +13 -2
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/components/Badge.js +14 -3
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Blockquote.d.ts +8 -0
- package/dist/components/Blockquote.d.ts.map +1 -1
- package/dist/components/Blockquote.js +8 -0
- package/dist/components/Blockquote.js.map +1 -1
- package/dist/components/Breadcrumb.d.ts +8 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb.js +10 -1
- package/dist/components/Breadcrumb.js.map +1 -1
- package/dist/components/Button.d.ts +11 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +14 -2
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +15 -4
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +13 -1
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Checkbox.d.ts +14 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +14 -0
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/CheckboxGroup.d.ts +22 -3
- package/dist/components/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/CheckboxGroup.js +23 -3
- package/dist/components/CheckboxGroup.js.map +1 -1
- package/dist/components/Circle.d.ts +16 -0
- package/dist/components/Circle.d.ts.map +1 -1
- package/dist/components/Circle.js +8 -0
- package/dist/components/Circle.js.map +1 -1
- package/dist/components/CitricComponent.d.ts +14 -0
- package/dist/components/CitricComponent.d.ts.map +1 -1
- package/dist/components/CitricComponent.js +14 -0
- package/dist/components/CitricComponent.js.map +1 -1
- package/dist/components/Divider.d.ts +4 -1
- package/dist/components/Divider.d.ts.map +1 -1
- package/dist/components/Divider.js +4 -1
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/ErrorBoundary.d.ts +13 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.js +13 -0
- package/dist/components/ErrorBoundary.js.map +1 -1
- package/dist/components/ErrorMessage.js +1 -1
- package/dist/components/ErrorMessage.js.map +1 -1
- package/dist/components/FallbackBoundary.d.ts +12 -1
- package/dist/components/FallbackBoundary.d.ts.map +1 -1
- package/dist/components/FallbackBoundary.js +12 -1
- package/dist/components/FallbackBoundary.js.map +1 -1
- package/dist/components/Favorite.d.ts +12 -0
- package/dist/components/Favorite.d.ts.map +1 -1
- package/dist/components/Favorite.js +12 -0
- package/dist/components/Favorite.js.map +1 -1
- package/dist/components/FieldGroup.d.ts +13 -0
- package/dist/components/FieldGroup.d.ts.map +1 -1
- package/dist/components/FieldGroup.js +13 -0
- package/dist/components/FieldGroup.js.map +1 -1
- package/dist/components/Form.d.ts +18 -0
- package/dist/components/Form.d.ts.map +1 -1
- package/dist/components/Form.js +18 -0
- package/dist/components/Form.js.map +1 -1
- package/dist/components/FormGroup.d.ts +12 -0
- package/dist/components/FormGroup.d.ts.map +1 -1
- package/dist/components/FormGroup.js +12 -0
- package/dist/components/FormGroup.js.map +1 -1
- package/dist/components/IconBox.d.ts +33 -8
- package/dist/components/IconBox.d.ts.map +1 -1
- package/dist/components/IconBox.js +37 -11
- package/dist/components/IconBox.js.map +1 -1
- package/dist/components/ImageBox.d.ts +32 -8
- package/dist/components/ImageBox.d.ts.map +1 -1
- package/dist/components/ImageBox.js +36 -11
- package/dist/components/ImageBox.js.map +1 -1
- package/dist/components/ImageWithFallback.d.ts +18 -0
- package/dist/components/ImageWithFallback.d.ts.map +1 -1
- package/dist/components/ImageWithFallback.js +11 -0
- package/dist/components/ImageWithFallback.js.map +1 -1
- package/dist/components/Input.d.ts +15 -3
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +16 -3
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Link.d.ts +6 -0
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +6 -0
- package/dist/components/Link.js.map +1 -1
- package/dist/components/MenuOverlay/index.d.ts +20 -0
- package/dist/components/MenuOverlay/index.d.ts.map +1 -1
- package/dist/components/MenuOverlay/index.js +20 -0
- package/dist/components/MenuOverlay/index.js.map +1 -1
- package/dist/components/Overlay/index.d.ts +16 -0
- package/dist/components/Overlay/index.d.ts.map +1 -1
- package/dist/components/Overlay/index.js +16 -0
- package/dist/components/Overlay/index.js.map +1 -1
- package/dist/components/Pagination.d.ts +27 -8
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +18 -5
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/ProgressBar.d.ts +14 -0
- package/dist/components/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar.js +14 -0
- package/dist/components/ProgressBar.js.map +1 -1
- package/dist/components/ProgressCircular.d.ts +14 -0
- package/dist/components/ProgressCircular.d.ts.map +1 -1
- package/dist/components/ProgressCircular.js +14 -0
- package/dist/components/ProgressCircular.js.map +1 -1
- package/dist/components/RadioGroup.d.ts +24 -3
- package/dist/components/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup.js +25 -3
- package/dist/components/RadioGroup.js.map +1 -1
- package/dist/components/Rating.d.ts +10 -0
- package/dist/components/Rating.d.ts.map +1 -1
- package/dist/components/Rating.js +10 -0
- package/dist/components/Rating.js.map +1 -1
- package/dist/components/Select/RichSelect.d.ts +3 -5
- package/dist/components/Select/RichSelect.d.ts.map +1 -1
- package/dist/components/Select/RichSelect.js +4 -4
- package/dist/components/Select/RichSelect.js.map +1 -1
- package/dist/components/Select/SimpleSelect.d.ts +2 -3
- package/dist/components/Select/SimpleSelect.d.ts.map +1 -1
- package/dist/components/Select/SimpleSelect.js +2 -3
- package/dist/components/Select/SimpleSelect.js.map +1 -1
- package/dist/components/Select/index.d.ts +25 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +26 -3
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/types.d.ts +1 -2
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/SelectBox.d.ts +31 -2
- package/dist/components/SelectBox.d.ts.map +1 -1
- package/dist/components/SelectBox.js +32 -3
- package/dist/components/SelectBox.js.map +1 -1
- package/dist/components/Skeleton.d.ts +11 -0
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton.js +11 -0
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Slider.d.ts +12 -0
- package/dist/components/Slider.d.ts.map +1 -1
- package/dist/components/Slider.js +12 -0
- package/dist/components/Slider.js.map +1 -1
- package/dist/components/SmartTable.d.ts +36 -2
- package/dist/components/SmartTable.d.ts.map +1 -1
- package/dist/components/SmartTable.js +37 -3
- package/dist/components/SmartTable.js.map +1 -1
- package/dist/components/Stepper.d.ts +20 -3
- package/dist/components/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper.js +21 -3
- package/dist/components/Stepper.js.map +1 -1
- package/dist/components/Table.d.ts +10 -0
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +10 -0
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs/TabController.d.ts +14 -0
- package/dist/components/Tabs/TabController.d.ts.map +1 -1
- package/dist/components/Tabs/TabController.js +14 -0
- package/dist/components/Tabs/TabController.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +20 -3
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +21 -3
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text.d.ts +16 -2
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js +17 -3
- package/dist/components/Text.js.map +1 -1
- package/dist/components/Textarea.d.ts +11 -1
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +12 -2
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/Tooltip.d.ts +14 -1
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip.js +13 -0
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/layout.d.ts +41 -7
- package/dist/components/layout.d.ts.map +1 -1
- package/dist/components/layout.js +44 -9
- package/dist/components/layout.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Accordion.tsx +34 -0
- package/src/components/Alert.tsx +8 -0
- package/src/components/AsyncContent.tsx +18 -4
- package/src/components/Avatar.tsx +11 -1
- package/src/components/AvatarGroup.tsx +8 -0
- package/src/components/Badge.tsx +24 -8
- package/src/components/Blockquote.tsx +8 -0
- package/src/components/Breadcrumb.tsx +10 -1
- package/src/components/Button.tsx +17 -2
- package/src/components/Card.tsx +34 -14
- package/src/components/Checkbox.tsx +14 -0
- package/src/components/CheckboxGroup.tsx +61 -40
- package/src/components/Circle.tsx +16 -0
- package/src/components/CitricComponent.ts +14 -0
- package/src/components/Divider.tsx +6 -5
- package/src/components/ErrorBoundary.tsx +13 -0
- package/src/components/ErrorMessage.tsx +1 -1
- package/src/components/FallbackBoundary.tsx +12 -1
- package/src/components/Favorite.tsx +12 -0
- package/src/components/FieldGroup.tsx +13 -0
- package/src/components/Form.tsx +18 -0
- package/src/components/FormGroup.tsx +12 -0
- package/src/components/IconBox.tsx +61 -30
- package/src/components/ImageBox.tsx +60 -30
- package/src/components/ImageWithFallback.tsx +18 -0
- package/src/components/Input.tsx +28 -14
- package/src/components/Link.tsx +6 -0
- package/src/components/MenuOverlay/index.tsx +20 -0
- package/src/components/Overlay/index.tsx +17 -0
- package/src/components/Pagination.tsx +40 -17
- package/src/components/ProgressBar.tsx +14 -0
- package/src/components/ProgressCircular.tsx +14 -0
- package/src/components/RadioGroup.tsx +62 -39
- package/src/components/Rating.tsx +10 -0
- package/src/components/Select/RichSelect.tsx +183 -182
- package/src/components/Select/SimpleSelect.tsx +57 -57
- package/src/components/Select/index.tsx +29 -5
- package/src/components/Select/types.ts +1 -1
- package/src/components/SelectBox.tsx +92 -62
- package/src/components/Skeleton.tsx +11 -0
- package/src/components/Slider.tsx +12 -0
- package/src/components/SmartTable.tsx +91 -56
- package/src/components/Stepper.tsx +76 -57
- package/src/components/Table.tsx +10 -0
- package/src/components/Tabs/TabController.ts +14 -0
- package/src/components/Tabs/index.tsx +56 -37
- package/src/components/Text.ts +36 -21
- package/src/components/Textarea.tsx +14 -4
- package/src/components/Tooltip.tsx +14 -1
- package/src/components/layout.tsx +56 -13
- package/src/index.ts +0 -1
- package/dist/components/Switch.d.ts +0 -10
- package/dist/components/Switch.d.ts.map +0 -1
- package/dist/components/Switch.js +0 -8
- package/dist/components/Switch.js.map +0 -1
- package/src/components/Switch.tsx +0 -30
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { WithColorScheme } from '../types.js';
|
|
2
|
-
|
|
2
|
+
type SupportedTags = 'div' | 'header' | 'ul' | 'ol' | 'dl' | 'section' | 'article' | 'a' | 'button';
|
|
3
|
+
export interface BaseCardProps<T extends SupportedTags = SupportedTags> extends WithColorScheme {
|
|
3
4
|
/**
|
|
4
5
|
* HTML tag to render.
|
|
5
6
|
*
|
|
6
7
|
* @default 'div'
|
|
7
8
|
*/
|
|
8
|
-
tag?:
|
|
9
|
+
tag?: T;
|
|
9
10
|
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
10
11
|
/**
|
|
11
12
|
* The size of the card.
|
|
@@ -20,6 +21,16 @@ export interface BaseCardProps extends WithColorScheme {
|
|
|
20
21
|
*/
|
|
21
22
|
bgLevel?: 300 | 400 | 500 | 600;
|
|
22
23
|
}
|
|
23
|
-
export type CardProps = React.JSX.IntrinsicElements['div'] & BaseCardProps;
|
|
24
|
-
|
|
24
|
+
export type CardProps<T extends SupportedTags> = (T extends 'a' ? React.JSX.IntrinsicElements['a'] : (T extends 'button' ? React.JSX.IntrinsicElements['button'] : React.JSX.IntrinsicElements['div'])) & BaseCardProps;
|
|
25
|
+
/**
|
|
26
|
+
* Renders a box with padding, border and background-color. If the card is focusable or has an onClick listener, hover events are also
|
|
27
|
+
* present.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```
|
|
31
|
+
* <Card>The card content</Card>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const Card: <T extends SupportedTags>({ tag, onClick, size, bgLevel, className, children, ...props }: CardProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
25
36
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAA;AAEnG,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,CAAE,SAAQ,eAAe;IAC7F;;;;OAIG;IACH,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACxD;;;;OAIG;IACH,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACjC;AAGD,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,IAAI,CAC/C,CAAC,SAAS,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CACjD,CAAC,SAAS,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GACxD,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,aAAa,CAAA;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GACD,CAAC,SAAS,aAAa,kEAA0E,SAAS,CAAC,CAAC,CAAC,4CAc5H,CAAA"}
|
package/dist/components/Card.js
CHANGED
|
@@ -2,5 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
3
3
|
import { withRef } from '../utils/react.js';
|
|
4
4
|
import { CitricComponent } from './CitricComponent.js';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Renders a box with padding, border and background-color. If the card is focusable or has an onClick listener, hover events are also
|
|
7
|
+
* present.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```
|
|
11
|
+
* <Card>The card content</Card>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const Card = withRef(function Card({ tag = 'div', onClick, size, bgLevel, className, children, ...props }) {
|
|
15
|
+
const clickable = onClick || props.tabIndex === 0 || tag === 'button' || tag === 'a';
|
|
16
|
+
return (_jsx(CitricComponent, { tag: tag, component: "card", onClick: onClick, className: listToClass([clickable && 'clickable', size, bgLevel && `bg-${bgLevel}`, className]), ...props, children: children }));
|
|
17
|
+
});
|
|
6
18
|
//# sourceMappingURL=Card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/components/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAgCnD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CACzB,SAAS,IAAI,CAA0B,EAAE,GAAG,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB;IACzH,MAAM,SAAS,GAAG,OAAO,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,GAAG,CAAA;IACpF,OAAO,CACL,KAAC,eAAe,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,IAAI,WAAW,EAAE,IAAI,EAAE,OAAO,IAAI,MAAM,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC,KAC3F,KAAK,YAER,QAAQ,GACO,CACnB,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -10,5 +10,19 @@ export interface BaseCheckboxProps extends WithColorScheme {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
export type CheckboxProps = ControlledInput & BaseCheckboxProps;
|
|
13
|
+
/**
|
|
14
|
+
* Renders a simple checkbox. If you want to render multiple checkboxes to control the value of multi-selectable field, prefer using the
|
|
15
|
+
* component `CheckboxGroup`.
|
|
16
|
+
*
|
|
17
|
+
* Attention: the prop `onChange` receives a boolean (current value) instead of the event.
|
|
18
|
+
*
|
|
19
|
+
* A checkbox can also be a switch! Just change the property "appearance".
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```
|
|
23
|
+
* const [value, setValue] = useState(false)
|
|
24
|
+
* return <Checkbox value={value} setValue={setValue}>This is the checkbox label</Checkbox>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
13
27
|
export declare const Checkbox: ({ appearance, value, onChange, colorScheme, children, className, style, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
28
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI3D,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,iBAAiB,CAAA;AAE/D,eAAO,MAAM,QAAQ,uFAC8E,aAAa,4CAkB9G,CAAA"}
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI3D,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,iBAAiB,CAAA;AAE/D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,uFAC8E,aAAa,4CAkB9G,CAAA"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { withRef } from '../utils/react.js';
|
|
3
3
|
import { CitricComponent } from './CitricComponent.js';
|
|
4
|
+
/**
|
|
5
|
+
* Renders a simple checkbox. If you want to render multiple checkboxes to control the value of multi-selectable field, prefer using the
|
|
6
|
+
* component `CheckboxGroup`.
|
|
7
|
+
*
|
|
8
|
+
* Attention: the prop `onChange` receives a boolean (current value) instead of the event.
|
|
9
|
+
*
|
|
10
|
+
* A checkbox can also be a switch! Just change the property "appearance".
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* const [value, setValue] = useState(false)
|
|
15
|
+
* return <Checkbox value={value} setValue={setValue}>This is the checkbox label</Checkbox>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
4
18
|
export const Checkbox = withRef(({ appearance = 'checkbox', value, onChange, colorScheme, children, className, style, ...props }) => {
|
|
5
19
|
const handleChange = onChange ? () => onChange(!value) : undefined;
|
|
6
20
|
return children ? (_jsxs(CitricComponent, { tag: "label", component: `${appearance}-row`, colorScheme: colorScheme, style: style, className: className, children: [_jsx("input", { type: "checkbox", checked: value, onChange: handleChange, ...props }), children] })) : _jsx(CitricComponent, { tag: "input", type: "checkbox", component: appearance, checked: value, onChange: handleChange, className: className, style: style, ...props });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAenD,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,CAC9B,EAAE,UAAU,GAAG,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAiB,EAC9G,EAAE;IACF,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAClE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,MAAC,eAAe,IAAC,GAAG,EAAC,OAAO,EAAC,SAAS,EAAE,GAAG,UAAU,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,aACvH,gBAAO,IAAI,EAAC,UAAU,EAAC,OAAO,EA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C,UAAU,EACf,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,KACR,KAAK,GACT,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -63,7 +63,26 @@ export interface BaseCheckboxGroupProps<T = any> extends WithColorScheme {
|
|
|
63
63
|
isDisabled?: (option: T) => boolean;
|
|
64
64
|
}
|
|
65
65
|
export type CheckboxGroupProps<T> = Omit<React.JSX.IntrinsicElements['div'], 'onChange' | 'children'> & BaseCheckboxGroupProps<T>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Renders a list of checkbox for multi-selection. One checkbox is rendered for each option.
|
|
68
|
+
*
|
|
69
|
+
* This component can be heavily customized via its properties. Check the storybook for complex examples.
|
|
70
|
+
*
|
|
71
|
+
* Tip: if you need to implement features like "search" and "select all", use the hook `useCheckboxGroupControls`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
*
|
|
75
|
+
* ```
|
|
76
|
+
* const options = useMemo(() => [
|
|
77
|
+
* { id: 1, name: 'Option 1' },
|
|
78
|
+
* { id: 2, name: 'Option 2' },
|
|
79
|
+
* { id: 3, name: 'Option 3' },
|
|
80
|
+
* ], [])
|
|
81
|
+
*
|
|
82
|
+
* const [value, setValue] = useState<typeof options>([])
|
|
83
|
+
*
|
|
84
|
+
* return <CheckboxGroup options={options} renderLabel={o => o.name} renderKey={o => o.id} value={value} setValue={setValue} />
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const CheckboxGroup: <T>({ appearance, name, value, options, onChange, renderLabel, renderKey, renderItem, isDisabled, colorScheme, style, ...props }: CheckboxGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
69
88
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../src/components/CheckboxGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAM1C,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,eAAe;IACtE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7C;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1E;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;CACrC;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAEjI,
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../src/components/CheckboxGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAM1C,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,eAAe;IACtE;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;OAEG;IACH,OAAO,EAAE,CAAC,EAAE,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7C;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1E;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;CACrC;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAEjI;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,GACD,CAAC,gIAarB,kBAAkB,CAAC,CAAC,CAAC,4CAyBzB,CAAA"}
|
|
@@ -5,7 +5,28 @@ import { defaultRenderKey, defaultRenderLabel } from '../utils/options.js';
|
|
|
5
5
|
import { withRef } from '../utils/react.js';
|
|
6
6
|
import { CitricComponent } from './CitricComponent.js';
|
|
7
7
|
import { Column } from './layout.js';
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Renders a list of checkbox for multi-selection. One checkbox is rendered for each option.
|
|
10
|
+
*
|
|
11
|
+
* This component can be heavily customized via its properties. Check the storybook for complex examples.
|
|
12
|
+
*
|
|
13
|
+
* Tip: if you need to implement features like "search" and "select all", use the hook `useCheckboxGroupControls`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* const options = useMemo(() => [
|
|
19
|
+
* { id: 1, name: 'Option 1' },
|
|
20
|
+
* { id: 2, name: 'Option 2' },
|
|
21
|
+
* { id: 3, name: 'Option 3' },
|
|
22
|
+
* ], [])
|
|
23
|
+
*
|
|
24
|
+
* const [value, setValue] = useState<typeof options>([])
|
|
25
|
+
*
|
|
26
|
+
* return <CheckboxGroup options={options} renderLabel={o => o.name} renderKey={o => o.id} value={value} setValue={setValue} />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const CheckboxGroup = withRef(function CheckboxGroup({ appearance = 'checkbox', name, value = [], options, onChange, renderLabel = defaultRenderLabel, renderKey = defaultRenderKey, renderItem, isDisabled, colorScheme, style, ...props }) {
|
|
9
30
|
const items = useMemo(() => {
|
|
10
31
|
const valueKeys = value.map(renderKey);
|
|
11
32
|
return options.map((o) => {
|
|
@@ -15,6 +36,5 @@ function _CheckboxGroup({ appearance = 'checkbox', name, value = [], options, on
|
|
|
15
36
|
});
|
|
16
37
|
}, [options, value, name, colorScheme, appearance]);
|
|
17
38
|
return _jsx(Column, { ...props, style: { gap: '8px', ...style }, children: items });
|
|
18
|
-
}
|
|
19
|
-
export const CheckboxGroup = withRef(_CheckboxGroup);
|
|
39
|
+
});
|
|
20
40
|
//# sourceMappingURL=CheckboxGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["../../src/components/CheckboxGroup.tsx"],"names":[],"mappings":";AAA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AA"}
|
|
@@ -9,10 +9,26 @@ export interface BaseCircleProps extends WithColorPalette, WithColorScheme {
|
|
|
9
9
|
/**
|
|
10
10
|
* The size of the circle.
|
|
11
11
|
*
|
|
12
|
+
* - xxs: 8px;
|
|
13
|
+
* - xs: 12px;
|
|
14
|
+
* - sm: 18px;
|
|
15
|
+
* - md: 27px;
|
|
16
|
+
* - lg: 40px;
|
|
17
|
+
* - xl: 60px;
|
|
18
|
+
* - xxl: 90px.
|
|
19
|
+
*
|
|
12
20
|
* @default 'xs'
|
|
13
21
|
*/
|
|
14
22
|
size?: 'xxs' | 'xs' | 'sm' | 'lg' | 'xl' | 'xxl';
|
|
15
23
|
}
|
|
16
24
|
export type CircleProps = React.JSX.IntrinsicElements['div'] & BaseCircleProps;
|
|
25
|
+
/**
|
|
26
|
+
* Renders a simple circle. If the circle has any children, it gets cropped by the circle borders. The content of the circle is centered.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```
|
|
30
|
+
* <Circle colorScheme="success" />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
17
33
|
export declare const Circle: ({ showBorders, className, size, children, ...props }: CircleProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
34
|
//# sourceMappingURL=Circle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../src/components/Circle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI5D,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,eAAe;IACxE;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB
|
|
1
|
+
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../src/components/Circle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI5D,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,eAAe;IACxE;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;CAClD;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,CAAA;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,yDAAkE,WAAW,4CAI9F,CAAA"}
|
|
@@ -2,5 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
3
3
|
import { withRef } from '../utils/react.js';
|
|
4
4
|
import { CitricComponent } from './CitricComponent.js';
|
|
5
|
+
/**
|
|
6
|
+
* Renders a simple circle. If the circle has any children, it gets cropped by the circle borders. The content of the circle is centered.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* <Circle colorScheme="success" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
5
13
|
export const Circle = withRef(({ showBorders, className, size, children, ...props }) => (_jsx(CitricComponent, { tag: "div", component: "circle", className: listToClass([className, showBorders && 'bordered', size]), ...props, children: children })));
|
|
6
14
|
//# sourceMappingURL=Circle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../src/components/Circle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../src/components/Circle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AA2BnD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE,CAAC,CACnG,KAAC,eAAe,IAAC,GAAG,EAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,WAAW,IAAI,UAAU,EAAE,IAAI,CAAC,CAAC,KAAM,KAAK,YAC1H,QAAQ,GACO,CACnB,CAAC,CAAA"}
|
|
@@ -13,6 +13,20 @@ interface CitricComponentType {
|
|
|
13
13
|
} & BaseCitricProps & T): React.ReactNode;
|
|
14
14
|
}
|
|
15
15
|
export declare function asCitricProps({ colorScheme, colorPalette, component, ...props }: BaseCitricProps & Record<string, any>): Record<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* Renders any tag or component with the appearance of a Citric Component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* An anchor that looks like a card.
|
|
21
|
+
* ```
|
|
22
|
+
* <CitricComponent tag="a" component="card" href="https://www.google.com" target="_blank">This is a card link</CitricComponent>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Suppose we have a component called "MyComponent" that accepts the property "myProp". We can make it look like a citric component:
|
|
26
|
+
* ```
|
|
27
|
+
* <CitricComponent render={MyComponent} component="card" myProp="my value" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
16
30
|
export declare const CitricComponent: CitricComponentType;
|
|
17
31
|
export {};
|
|
18
32
|
//# sourceMappingURL=CitricComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitricComponent.d.ts","sourceRoot":"","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G,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;CACxG;AAED,wBAAgB,aAAa,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,uBAKtH;AAED;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,eAAe,EAAE,mBAK7B,CAAA"}
|
|
@@ -7,6 +7,20 @@ export function asCitricProps({ colorScheme, colorPalette, component, ...props }
|
|
|
7
7
|
citricProps['data-color-palette'] = colorPalette;
|
|
8
8
|
return citricProps;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders any tag or component with the appearance of a Citric Component.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* An anchor that looks like a card.
|
|
15
|
+
* ```
|
|
16
|
+
* <CitricComponent tag="a" component="card" href="https://www.google.com" target="_blank">This is a card link</CitricComponent>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Suppose we have a component called "MyComponent" that accepts the property "myProp". We can make it look like a citric component:
|
|
20
|
+
* ```
|
|
21
|
+
* <CitricComponent render={MyComponent} component="card" myProp="my value" />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
10
24
|
// eslint-disable-next-line react/display-name
|
|
11
25
|
export const CitricComponent = forwardRef((props, ref) => {
|
|
12
26
|
const { tag, render, ...citricProps } = asCitricProps(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitricComponent.js","sourceRoot":"","sources":["../../src/components/CitricComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAmBjD,MAAM,UAAU,aAAa,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyC;IACrH,MAAM,WAAW,GAAwB,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE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AAa,CAAC,GAAG,IAAI,MAAM,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,EAAE,CAAC,CAAA;AAC9D,CAAC,CACF,CAAA"}
|
|
@@ -10,5 +10,8 @@ export interface BaseDividerProps extends WithColorScheme {
|
|
|
10
10
|
size?: 'sm' | 'md' | 'lg';
|
|
11
11
|
}
|
|
12
12
|
export type DividerProps = React.JSX.IntrinsicElements['hr'] & BaseDividerProps;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Renders a divider (hr). "size" determines how thick the ruler is and "direction" places it on the vertical or horizontal axis.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Divider: ({ size, direction, className, ...props }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/components/Divider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAA;AAE/E,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/components/Divider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,OAAO,6CAAsD,YAAY,4CAErF,CAAA"}
|
|
@@ -2,5 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
3
3
|
import { withRef } from '../utils/react.js';
|
|
4
4
|
import { CitricComponent } from './CitricComponent.js';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Renders a divider (hr). "size" determines how thick the ruler is and "direction" places it on the vertical or horizontal axis.
|
|
7
|
+
*/
|
|
8
|
+
export const Divider = withRef(({ size, direction, className, ...props }) => _jsx(CitricComponent, { tag: "hr", component: "divider", className: listToClass([className, size, direction]), ...props }));
|
|
6
9
|
//# sourceMappingURL=Divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../src/components/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAenD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../src/components/Divider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAenD;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE,CACxF,KAAC,eAAe,IAAC,GAAG,EAAC,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,KAAM,KAAK,GAAI,CAClH,CAAA"}
|
|
@@ -14,6 +14,19 @@ interface Props {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* An Error Boundary that renders an error feedback instead of its content if any of its children throws.
|
|
17
|
+
*
|
|
18
|
+
* You can customize the appearance of the error through the function `renderError` of a CitricController.
|
|
19
|
+
*
|
|
20
|
+
* Errors can be watched through the function `onError` of a CitricController.
|
|
21
|
+
*
|
|
22
|
+
* Attention: if you're using React Suspense, consider using the component "FallbackBoundary" instead.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```
|
|
26
|
+
* <ErrorBoundary>
|
|
27
|
+
* {content}
|
|
28
|
+
* </ErrorBoundary>
|
|
29
|
+
* ```
|
|
17
30
|
*/
|
|
18
31
|
export declare class ErrorBoundary extends Component<Props, State> {
|
|
19
32
|
static contextType: import("react").Context<import("../index.js").CitricController | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGxD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/D;AAED
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGxD,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACxD,MAAM,CAAC,WAAW,qEAAgB;IAC1B,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,aAAa,CAAC,CAAA;gBAE5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG;;;IAI1C,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAM5C,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC;IAM7C,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,aAAa;IAQrB,MAAM;CAGP"}
|
|
@@ -4,6 +4,19 @@ import { CitricContext } from '../context/CitricContext.js';
|
|
|
4
4
|
import { ErrorMessage } from './ErrorMessage.js';
|
|
5
5
|
/**
|
|
6
6
|
* An Error Boundary that renders an error feedback instead of its content if any of its children throws.
|
|
7
|
+
*
|
|
8
|
+
* You can customize the appearance of the error through the function `renderError` of a CitricController.
|
|
9
|
+
*
|
|
10
|
+
* Errors can be watched through the function `onError` of a CitricController.
|
|
11
|
+
*
|
|
12
|
+
* Attention: if you're using React Suspense, consider using the component "FallbackBoundary" instead.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* <ErrorBoundary>
|
|
17
|
+
* {content}
|
|
18
|
+
* </ErrorBoundary>
|
|
19
|
+
* ```
|
|
7
20
|
*/
|
|
8
21
|
export class ErrorBoundary extends Component {
|
|
9
22
|
constructor(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAgB7C
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAgB7C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAuB;IAIxD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAU;QACxC,OAAO,EAAE,KAAK,EAAE,CAAA;IAClB,CAAC;IAED,iBAAiB,CAAC,KAAU,EAAE,SAAc;QAC1C,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;QAC9B,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IACjC,CAAC;IAED,kBAAkB,CAAC,SAA0B;QAC3C,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAEO,mBAAmB;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACtD,CAAC;IAEO,aAAa;QACnB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,UAAU;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACzF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC;YACvD,CAAC,CAAC,KAAC,YAAY,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI;YACjE,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAChC,CAAC;IAGD,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;IACtE,CAAC;;AAtCM;;;;WAAc,aAAa;GAAA"}
|
|
@@ -3,5 +3,5 @@ import { Icon } from '@stack-spot/citric-icons';
|
|
|
3
3
|
import { theme } from '@stack-spot/portal-theme';
|
|
4
4
|
import { Row } from './layout.js';
|
|
5
5
|
import { Text } from './Text.js';
|
|
6
|
-
export const ErrorMessage = ({ error }) => (_jsxs(Row, { gap: "18px", p: "20px", justifyContent: "center", children: [_jsx(Icon, { icon: "TimesCircle", size: "xl", style: { color: theme.color.danger[500] } }), _jsx(Text, {
|
|
6
|
+
export const ErrorMessage = ({ error }) => (_jsxs(Row, { gap: "18px", p: "20px", justifyContent: "center", children: [_jsx(Icon, { icon: "TimesCircle", size: "xl", style: { color: theme.color.danger[500] } }), _jsx(Text, { children: error.message || `${error}` })] }));
|
|
7
7
|
//# sourceMappingURL=ErrorMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../src/components/ErrorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE,CAAC,CACzD,MAAC,GAAG,IAAC,GAAG,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,aAC9C,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAI,EAChF,KAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../../src/components/ErrorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE,CAAC,CACzD,MAAC,GAAG,IAAC,GAAG,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,cAAc,EAAC,QAAQ,aAC9C,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAI,EAChF,KAAC,IAAI,cAAE,KAAK,CAAC,OAAO,IAAI,GAAG,KAAK,EAAE,GAAQ,IACtC,CACP,CAAA"}
|
|
@@ -6,7 +6,18 @@ interface Props {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* A Boundary that renders an error feedback if a child throws an error or a loading feedback if it suspends.
|
|
10
|
+
*
|
|
11
|
+
* You can customize the appearance of the loading and error views through a CitricController.
|
|
12
|
+
*
|
|
13
|
+
* Errors can be watched through the function `onError` of a CitricController.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* <FallbackBoundary>
|
|
18
|
+
* {content}
|
|
19
|
+
* </FallbackBoundary>
|
|
20
|
+
* ```
|
|
10
21
|
*/
|
|
11
22
|
export declare const FallbackBoundary: ({ children, message }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackBoundary.d.ts","sourceRoot":"","sources":["../../src/components/FallbackBoundary.tsx"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAQD
|
|
1
|
+
{"version":3,"file":"FallbackBoundary.d.ts","sourceRoot":"","sources":["../../src/components/FallbackBoundary.tsx"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAQD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAI,uBAAuB,KAAK,4CAM5D,CAAA"}
|
|
@@ -5,7 +5,18 @@ import { Center } from './layout.js';
|
|
|
5
5
|
import { ProgressCircular } from './ProgressCircular.js';
|
|
6
6
|
const loading = (_jsx(Center, { flex: 1, p: "80px", "data-test-hint": "loading", children: _jsx(ProgressCircular, {}) }));
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* A Boundary that renders an error feedback if a child throws an error or a loading feedback if it suspends.
|
|
9
|
+
*
|
|
10
|
+
* You can customize the appearance of the loading and error views through a CitricController.
|
|
11
|
+
*
|
|
12
|
+
* Errors can be watched through the function `onError` of a CitricController.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* <FallbackBoundary>
|
|
17
|
+
* {content}
|
|
18
|
+
* </FallbackBoundary>
|
|
19
|
+
* ```
|
|
9
20
|
*/
|
|
10
21
|
export const FallbackBoundary = ({ children, message }) => (_jsx(ErrorBoundary, { message: message, children: _jsx(Suspense, { fallback: loading, children: children }) }));
|
|
11
22
|
//# sourceMappingURL=FallbackBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FallbackBoundary.js","sourceRoot":"","sources":["../../src/components/FallbackBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAUrD,MAAM,OAAO,GAAG,CACd,KAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAC,MAAM,oBAAgB,SAAS,YAChD,KAAC,gBAAgB,KAAG,GACb,CACV,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"FallbackBoundary.js","sourceRoot":"","sources":["../../src/components/FallbackBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAUrD,MAAM,OAAO,GAAG,CACd,KAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAC,MAAM,oBAAgB,SAAS,YAChD,KAAC,gBAAgB,KAAG,GACb,CACV,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAS,EAAE,EAAE,CAAC,CAChE,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,YAC7B,KAAC,QAAQ,IAAC,QAAQ,EAAE,OAAO,YACxB,QAAQ,GACA,GACG,CACjB,CAAA"}
|
|
@@ -23,6 +23,18 @@ export interface BaseFavoriteProps {
|
|
|
23
23
|
loading?: boolean;
|
|
24
24
|
}
|
|
25
25
|
export type FavoriteProps = Omit<ControlledInput, 'size'> & BaseFavoriteProps;
|
|
26
|
+
/**
|
|
27
|
+
* Renders a checkbox with the appearance of a favorite button. If unchecked, the stroke of a star is rendered, when checked, a filled
|
|
28
|
+
* yellow star is rendered.
|
|
29
|
+
*
|
|
30
|
+
* You can also set a loading state to indicate the component is busy.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```
|
|
34
|
+
* const { isFavorite, setFavorite, isLoading } = useRemoteFavoriteStatus()
|
|
35
|
+
* return <Favorite value={isFavorite} onChange={setFavorite} loading={isLoading} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
26
38
|
export declare const Favorite: ({ value, size, appearance, onChange, loading, disabled, className, ...props }: FavoriteProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
39
|
export {};
|
|
28
40
|
//# sourceMappingURL=Favorite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Favorite.d.ts","sourceRoot":"","sources":["../../src/components/Favorite.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,KAAK,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,YAAY,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAA;AAE7E,eAAO,MAAM,QAAQ,kFAA2F,aAAa,4CAY5H,CAAA"}
|
|
1
|
+
{"version":3,"file":"Favorite.d.ts","sourceRoot":"","sources":["../../src/components/Favorite.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,KAAK,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,YAAY,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAA;AAE7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,kFAA2F,aAAa,4CAY5H,CAAA"}
|
|
@@ -2,5 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
3
3
|
import { withRef } from '../utils/react.js';
|
|
4
4
|
import { CitricComponent } from './CitricComponent.js';
|
|
5
|
+
/**
|
|
6
|
+
* Renders a checkbox with the appearance of a favorite button. If unchecked, the stroke of a star is rendered, when checked, a filled
|
|
7
|
+
* yellow star is rendered.
|
|
8
|
+
*
|
|
9
|
+
* You can also set a loading state to indicate the component is busy.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* const { isFavorite, setFavorite, isLoading } = useRemoteFavoriteStatus()
|
|
14
|
+
* return <Favorite value={isFavorite} onChange={setFavorite} loading={isLoading} />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
5
17
|
export const Favorite = withRef(({ value, size, appearance, onChange, loading, disabled, className, ...props }) => _jsx(CitricComponent, { tag: "input", type: "checkbox", component: "favorite", className: listToClass([appearance, size, className]), checked: !!value, onChange: () => onChange(!value), "aria-busy": loading, disabled: loading || disabled, ...props }));
|
|
6
18
|
//# sourceMappingURL=Favorite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Favorite.js","sourceRoot":"","sources":["../../src/components/Favorite.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB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AChB,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,eACrB,OAAO,EAClB,QAAQ,EAAE,OAAO,IAAI,QAAQ,KACzB,KAAK,GACT,CACH,CAAA"}
|
|
@@ -15,5 +15,18 @@ export interface BaseFieldGroupProps {
|
|
|
15
15
|
fullWidth?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export type FieldGroupProps = React.JSX.IntrinsicElements['div'] & BaseFieldGroupProps;
|
|
18
|
+
/**
|
|
19
|
+
* A FieldGroup is used to concatenate an input with other UI elements, like icons and buttons.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* A search field, with a search icon and a button to submit the search.
|
|
23
|
+
* ```
|
|
24
|
+
* <FieldGroup>
|
|
25
|
+
* <Icon icon="Search" />
|
|
26
|
+
* <Input type="search" />
|
|
27
|
+
* <Button colorScheme="light">Submit</Button>
|
|
28
|
+
* </FieldGroup>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
18
31
|
export declare const FieldGroup: ({ auto, fullWidth, className, children, ...props }: FieldGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
32
|
//# sourceMappingURL=FieldGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.d.ts","sourceRoot":"","sources":["../../src/components/FieldGroup.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAA;AAEtF,eAAO,MAAM,UAAU,uDAAuE,eAAe,4CAS3G,CAAA"}
|
|
1
|
+
{"version":3,"file":"FieldGroup.d.ts","sourceRoot":"","sources":["../../src/components/FieldGroup.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAA;AAEtF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,uDAAuE,eAAe,4CAS3G,CAAA"}
|
|
@@ -2,5 +2,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { listToClass } from '@stack-spot/portal-theme';
|
|
3
3
|
import { withRef } from '../utils/react.js';
|
|
4
4
|
import { CitricComponent } from './CitricComponent.js';
|
|
5
|
+
/**
|
|
6
|
+
* A FieldGroup is used to concatenate an input with other UI elements, like icons and buttons.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* A search field, with a search icon and a button to submit the search.
|
|
10
|
+
* ```
|
|
11
|
+
* <FieldGroup>
|
|
12
|
+
* <Icon icon="Search" />
|
|
13
|
+
* <Input type="search" />
|
|
14
|
+
* <Button colorScheme="light">Submit</Button>
|
|
15
|
+
* </FieldGroup>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
5
18
|
export const FieldGroup = withRef(({ auto = true, fullWidth, className, children, ...props }) => (_jsx(CitricComponent, { tag: "div", component: "field-group", className: listToClass([className, auto && 'auto', fullWidth && 'full-width']), ...props, children: children })));
|
|
6
19
|
//# sourceMappingURL=FieldGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../src/components/FieldGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAqBnD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE,CAAC,CAChH,KAAC,eAAe,IACd,GAAG,EAAC,KAAK,EACT,SAAS,EAAC,aAAa,EACvB,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,IAAI,YAAY,CAAC,CAAC,KAC1E,KAAK,YAER,QAAQ,GACO,CACnB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../src/components/FieldGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAqBnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB,EAAE,EAAE,CAAC,CAChH,KAAC,eAAe,IACd,GAAG,EAAC,KAAK,EACT,SAAS,EAAC,aAAa,EACvB,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,IAAI,YAAY,CAAC,CAAC,KAC1E,KAAK,YAER,QAAQ,GACO,CACnB,CAAC,CAAA"}
|