@harismawan/stamp-ui 0.1.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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/GlobalStyles.d.ts +1 -0
- package/dist/GlobalStyles.js +96 -0
- package/dist/components/Accordion.d.ts +12 -0
- package/dist/components/Accordion.js +85 -0
- package/dist/components/Alert.d.ts +9 -0
- package/dist/components/Alert.js +88 -0
- package/dist/components/Avatar.d.ts +12 -0
- package/dist/components/Avatar.js +67 -0
- package/dist/components/Badge.d.ts +7 -0
- package/dist/components/Badge.js +40 -0
- package/dist/components/Breadcrumb.d.ts +10 -0
- package/dist/components/Breadcrumb.js +50 -0
- package/dist/components/Button.d.ts +6 -0
- package/dist/components/Button.js +95 -0
- package/dist/components/Card.d.ts +8 -0
- package/dist/components/Card.js +55 -0
- package/dist/components/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox.js +49 -0
- package/dist/components/ColorPicker.d.ts +7 -0
- package/dist/components/ColorPicker.js +61 -0
- package/dist/components/ConfirmDialog.d.ts +9 -0
- package/dist/components/ConfirmDialog.js +58 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Divider.js +45 -0
- package/dist/components/Drawer.d.ts +10 -0
- package/dist/components/Drawer.js +92 -0
- package/dist/components/DropdownMenu.d.ts +20 -0
- package/dist/components/DropdownMenu.js +139 -0
- package/dist/components/EmptyState.d.ts +8 -0
- package/dist/components/EmptyState.js +43 -0
- package/dist/components/IconPicker.d.ts +7 -0
- package/dist/components/IconPicker.js +45 -0
- package/dist/components/Input.d.ts +6 -0
- package/dist/components/Input.js +63 -0
- package/dist/components/Modal.d.ts +8 -0
- package/dist/components/Modal.js +104 -0
- package/dist/components/NumberInput.d.ts +23 -0
- package/dist/components/NumberInput.js +83 -0
- package/dist/components/Pagination.d.ts +7 -0
- package/dist/components/Pagination.js +81 -0
- package/dist/components/Popover.d.ts +8 -0
- package/dist/components/Popover.js +39 -0
- package/dist/components/Progress.d.ts +9 -0
- package/dist/components/Progress.js +41 -0
- package/dist/components/Radio.d.ts +14 -0
- package/dist/components/Radio.js +72 -0
- package/dist/components/Skeleton.d.ts +34 -0
- package/dist/components/Skeleton.js +39 -0
- package/dist/components/Slider.d.ts +10 -0
- package/dist/components/Slider.js +47 -0
- package/dist/components/Spinner.d.ts +6 -0
- package/dist/components/Spinner.js +52 -0
- package/dist/components/Stat.d.ts +9 -0
- package/dist/components/Stat.js +44 -0
- package/dist/components/Stepper.d.ts +11 -0
- package/dist/components/Stepper.js +97 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Switch.js +58 -0
- package/dist/components/Table.d.ts +6 -0
- package/dist/components/Table.js +41 -0
- package/dist/components/Tabs.d.ts +21 -0
- package/dist/components/Tabs.js +174 -0
- package/dist/components/Tag.d.ts +6 -0
- package/dist/components/Tag.js +47 -0
- package/dist/components/Toast.d.ts +26 -0
- package/dist/components/Toast.js +74 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/Tooltip.js +43 -0
- package/dist/components/layout/index.d.ts +56 -0
- package/dist/components/layout/index.js +72 -0
- package/dist/hooks/useClickOutside.d.ts +2 -0
- package/dist/hooks/useClickOutside.js +25 -0
- package/dist/hooks/useDisclosure.d.ts +8 -0
- package/dist/hooks/useDisclosure.js +9 -0
- package/dist/hooks/useThemeStore.d.ts +20 -0
- package/dist/hooks/useThemeStore.js +7 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +43 -0
- package/dist/provider.d.ts +14 -0
- package/dist/provider.js +14 -0
- package/dist/theme.d.ts +193 -0
- package/dist/theme.js +156 -0
- package/package.json +48 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Theme } from '../../theme';
|
|
2
|
+
type SpaceKey = keyof Theme['space'];
|
|
3
|
+
type RadiusKey = keyof Theme['radii'];
|
|
4
|
+
type ColorKey = keyof Theme['colors'];
|
|
5
|
+
export interface BoxProps {
|
|
6
|
+
$p?: SpaceKey;
|
|
7
|
+
$px?: SpaceKey;
|
|
8
|
+
$py?: SpaceKey;
|
|
9
|
+
$m?: SpaceKey;
|
|
10
|
+
$bg?: ColorKey;
|
|
11
|
+
$radius?: RadiusKey;
|
|
12
|
+
}
|
|
13
|
+
export declare const Box: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof BoxProps> & BoxProps, never>>> & string;
|
|
14
|
+
export interface StackProps {
|
|
15
|
+
$gap?: SpaceKey;
|
|
16
|
+
$direction?: 'row' | 'column';
|
|
17
|
+
$align?: React.CSSProperties['alignItems'];
|
|
18
|
+
$justify?: React.CSSProperties['justifyContent'];
|
|
19
|
+
}
|
|
20
|
+
export declare const Stack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>> & string;
|
|
21
|
+
export declare const HStack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
22
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
23
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
24
|
+
}, "as" | "forwardedAs" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | keyof StackProps> & import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
25
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
26
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
27
|
+
}, keyof StackProps> & StackProps, "children" | "ref" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "as" | "forwardedAs" | "$gap" | "$direction" | "$align" | "$justify"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
28
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
29
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
30
|
+
}, "as" | "forwardedAs" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | keyof StackProps> & import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
31
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
32
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
33
|
+
}, keyof StackProps> & StackProps, "children" | "ref" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "as" | "forwardedAs" | "$gap" | "$direction" | "$align" | "$justify">>> & string;
|
|
34
|
+
export declare const VStack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
35
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
36
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
37
|
+
}, "as" | "forwardedAs" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | keyof StackProps> & import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
38
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
39
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
40
|
+
}, keyof StackProps> & StackProps, "children" | "ref" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "as" | "forwardedAs" | "$gap" | "$direction" | "$align" | "$justify"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
41
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
42
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
43
|
+
}, "as" | "forwardedAs" | keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement> | keyof StackProps> & import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof StackProps> & StackProps, never>>, "as" | "forwardedAs"> & {
|
|
44
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
45
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
46
|
+
}, keyof StackProps> & StackProps, "children" | "ref" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "as" | "forwardedAs" | "$gap" | "$direction" | "$align" | "$justify">>> & string;
|
|
47
|
+
export interface GridProps {
|
|
48
|
+
$cols?: number;
|
|
49
|
+
$gap?: SpaceKey;
|
|
50
|
+
}
|
|
51
|
+
export declare const Grid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof GridProps> & GridProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof GridProps> & GridProps, never>>> & string;
|
|
52
|
+
export interface ContainerProps {
|
|
53
|
+
$max?: number;
|
|
54
|
+
}
|
|
55
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$max"> & ContainerProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$max"> & ContainerProps, never>>> & string;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
function spaceValue(theme, key) {
|
|
3
|
+
if (key === undefined)
|
|
4
|
+
return undefined;
|
|
5
|
+
return theme.space[key];
|
|
6
|
+
}
|
|
7
|
+
export const Box = styled.div `
|
|
8
|
+
${(p) => p.$p !== undefined &&
|
|
9
|
+
css `
|
|
10
|
+
padding: ${spaceValue(p.theme, p.$p)};
|
|
11
|
+
`}
|
|
12
|
+
${(p) => p.$px !== undefined &&
|
|
13
|
+
css `
|
|
14
|
+
padding-left: ${spaceValue(p.theme, p.$px)};
|
|
15
|
+
padding-right: ${spaceValue(p.theme, p.$px)};
|
|
16
|
+
`}
|
|
17
|
+
${(p) => p.$py !== undefined &&
|
|
18
|
+
css `
|
|
19
|
+
padding-top: ${spaceValue(p.theme, p.$py)};
|
|
20
|
+
padding-bottom: ${spaceValue(p.theme, p.$py)};
|
|
21
|
+
`}
|
|
22
|
+
${(p) => p.$m !== undefined &&
|
|
23
|
+
css `
|
|
24
|
+
margin: ${spaceValue(p.theme, p.$m)};
|
|
25
|
+
`}
|
|
26
|
+
${(p) => p.$bg !== undefined &&
|
|
27
|
+
css `
|
|
28
|
+
background: ${p.theme.colors[p.$bg]};
|
|
29
|
+
`}
|
|
30
|
+
${(p) => p.$radius !== undefined &&
|
|
31
|
+
css `
|
|
32
|
+
border-radius: ${p.theme.radii[p.$radius]};
|
|
33
|
+
`}
|
|
34
|
+
`;
|
|
35
|
+
export const Stack = styled.div `
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: ${(p) => p.$direction ?? 'column'};
|
|
38
|
+
${(p) => p.$gap !== undefined &&
|
|
39
|
+
css `
|
|
40
|
+
gap: ${spaceValue(p.theme, p.$gap)};
|
|
41
|
+
`}
|
|
42
|
+
${(p) => p.$align !== undefined &&
|
|
43
|
+
css `
|
|
44
|
+
align-items: ${p.$align};
|
|
45
|
+
`}
|
|
46
|
+
${(p) => p.$justify !== undefined &&
|
|
47
|
+
css `
|
|
48
|
+
justify-content: ${p.$justify};
|
|
49
|
+
`}
|
|
50
|
+
`;
|
|
51
|
+
export const HStack = styled(Stack).attrs((p) => ({
|
|
52
|
+
$direction: p.$direction ?? 'row',
|
|
53
|
+
})) ``;
|
|
54
|
+
export const VStack = styled(Stack).attrs((p) => ({
|
|
55
|
+
$direction: p.$direction ?? 'column',
|
|
56
|
+
})) ``;
|
|
57
|
+
export const Grid = styled.div `
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: repeat(${(p) => p.$cols ?? 1}, minmax(0, 1fr));
|
|
60
|
+
${(p) => p.$gap !== undefined &&
|
|
61
|
+
css `
|
|
62
|
+
gap: ${spaceValue(p.theme, p.$gap)};
|
|
63
|
+
`}
|
|
64
|
+
`;
|
|
65
|
+
export const Container = styled.div `
|
|
66
|
+
width: 100%;
|
|
67
|
+
max-width: ${(p) => p.$max ?? 1120}px;
|
|
68
|
+
margin-left: auto;
|
|
69
|
+
margin-right: auto;
|
|
70
|
+
padding-left: ${(p) => p.theme.space[4]};
|
|
71
|
+
padding-right: ${(p) => p.theme.space[4]};
|
|
72
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
export function useClickOutside(ref, handler, enabled = true) {
|
|
3
|
+
// Keep latest handler in a ref so listeners don't need re-binding on every render.
|
|
4
|
+
const handlerRef = useRef(handler);
|
|
5
|
+
handlerRef.current = handler;
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (!enabled)
|
|
8
|
+
return;
|
|
9
|
+
const listener = (event) => {
|
|
10
|
+
const el = ref.current;
|
|
11
|
+
const target = event.target;
|
|
12
|
+
if (!el || !target)
|
|
13
|
+
return;
|
|
14
|
+
if (el.contains(target))
|
|
15
|
+
return;
|
|
16
|
+
handlerRef.current(event);
|
|
17
|
+
};
|
|
18
|
+
document.addEventListener('mousedown', listener);
|
|
19
|
+
document.addEventListener('touchstart', listener);
|
|
20
|
+
return () => {
|
|
21
|
+
document.removeEventListener('mousedown', listener);
|
|
22
|
+
document.removeEventListener('touchstart', listener);
|
|
23
|
+
};
|
|
24
|
+
}, [ref, enabled]);
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export function useDisclosure(initial = false) {
|
|
3
|
+
const [isOpen, setIsOpen] = useState(initial);
|
|
4
|
+
const open = useCallback(() => setIsOpen(true), []);
|
|
5
|
+
const close = useCallback(() => setIsOpen(false), []);
|
|
6
|
+
const toggle = useCallback(() => setIsOpen((prev) => !prev), []);
|
|
7
|
+
const setOpen = useCallback((value) => setIsOpen(value), []);
|
|
8
|
+
return { isOpen, open, close, toggle, setOpen };
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ThemeMode = 'light' | 'dark';
|
|
2
|
+
interface ThemeState {
|
|
3
|
+
mode: ThemeMode;
|
|
4
|
+
setMode: (mode: ThemeMode) => void;
|
|
5
|
+
toggle: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useThemeStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ThemeState>, "setState" | "persist"> & {
|
|
8
|
+
setState(partial: ThemeState | Partial<ThemeState> | ((state: ThemeState) => ThemeState | Partial<ThemeState>), replace?: false | undefined): unknown;
|
|
9
|
+
setState(state: ThemeState | ((state: ThemeState) => ThemeState), replace: true): unknown;
|
|
10
|
+
persist: {
|
|
11
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ThemeState, ThemeState, unknown>>) => void;
|
|
12
|
+
clearStorage: () => void;
|
|
13
|
+
rehydrate: () => Promise<void> | void;
|
|
14
|
+
hasHydrated: () => boolean;
|
|
15
|
+
onHydrate: (fn: (state: ThemeState) => void) => () => void;
|
|
16
|
+
onFinishHydration: (fn: (state: ThemeState) => void) => () => void;
|
|
17
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<ThemeState, ThemeState, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { persist } from 'zustand/middleware';
|
|
3
|
+
export const useThemeStore = create()(persist((set, get) => ({
|
|
4
|
+
mode: 'light',
|
|
5
|
+
setMode: (mode) => set({ mode }),
|
|
6
|
+
toggle: () => set({ mode: get().mode === 'light' ? 'dark' : 'light' }),
|
|
7
|
+
}), { name: 'stamp-ui-theme' }));
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { lightTheme, darkTheme, type Theme } from './theme';
|
|
2
|
+
export { GlobalStyles } from './GlobalStyles';
|
|
3
|
+
export { StampProvider, type StampProviderProps } from './provider';
|
|
4
|
+
export { useThemeStore, type ThemeMode } from './hooks/useThemeStore';
|
|
5
|
+
export { useDisclosure, type UseDisclosureReturn, } from './hooks/useDisclosure';
|
|
6
|
+
export { useClickOutside } from './hooks/useClickOutside';
|
|
7
|
+
export { Button, type ButtonProps } from './components/Button';
|
|
8
|
+
export { Card, CardTitle, CardValue, type CardProps } from './components/Card';
|
|
9
|
+
export { Input, Select, Textarea, FieldWrap, FieldLabel, FieldError, } from './components/Input';
|
|
10
|
+
export { NumberInput, type NumberInputProps } from './components/NumberInput';
|
|
11
|
+
export { Spinner, type SpinnerProps } from './components/Spinner';
|
|
12
|
+
export { Skeleton, SkeletonText, SkeletonCircle, SkeletonGroup, type SkeletonProps, type SkeletonTextProps, type SkeletonCircleProps, type SkeletonGroupProps, } from './components/Skeleton';
|
|
13
|
+
export { Modal, type ModalProps } from './components/Modal';
|
|
14
|
+
export { confirmDialog, ConfirmViewport, type ConfirmOptions, } from './components/ConfirmDialog';
|
|
15
|
+
export { toast, useToastStore, ToastViewport, type ToastKind, type ToastItem, } from './components/Toast';
|
|
16
|
+
export { ColorPicker, DEFAULT_SWATCHES, type ColorPickerProps, } from './components/ColorPicker';
|
|
17
|
+
export { IconPicker, DEFAULT_ICONS, type IconPickerProps, } from './components/IconPicker';
|
|
18
|
+
export { Checkbox, type CheckboxProps } from './components/Checkbox';
|
|
19
|
+
export { Radio, RadioGroup, type RadioProps, type RadioGroupProps, } from './components/Radio';
|
|
20
|
+
export { Switch, type SwitchProps } from './components/Switch';
|
|
21
|
+
export { Slider, type SliderProps } from './components/Slider';
|
|
22
|
+
export { Badge, type BadgeProps, type BadgeVariant } from './components/Badge';
|
|
23
|
+
export { Tag, type TagProps } from './components/Tag';
|
|
24
|
+
export { Avatar, AvatarGroup, type AvatarProps, type AvatarGroupProps, } from './components/Avatar';
|
|
25
|
+
export { Stat, type StatProps, type StatDeltaType } from './components/Stat';
|
|
26
|
+
export { EmptyState, type EmptyStateProps } from './components/EmptyState';
|
|
27
|
+
export { Divider, type DividerProps } from './components/Divider';
|
|
28
|
+
export { Progress, type ProgressProps, type ProgressVariant, } from './components/Progress';
|
|
29
|
+
export { Tabs, TabList, Tab, TabPanel, type TabsProps, type TabListProps, type TabProps, type TabPanelProps, } from './components/Tabs';
|
|
30
|
+
export { Accordion, AccordionItem, type AccordionProps, type AccordionItemProps, } from './components/Accordion';
|
|
31
|
+
export { Box, Stack, HStack, VStack, Grid, Container, type BoxProps, type StackProps, type GridProps, type ContainerProps, } from './components/layout';
|
|
32
|
+
export { Tooltip, type TooltipProps } from './components/Tooltip';
|
|
33
|
+
export { Popover, type PopoverProps } from './components/Popover';
|
|
34
|
+
export { Menu, MenuButton, MenuList, MenuItem, type MenuProps, type MenuButtonProps, type MenuListProps, type MenuItemProps, } from './components/DropdownMenu';
|
|
35
|
+
export { Drawer, type DrawerProps, type DrawerSide, } from './components/Drawer';
|
|
36
|
+
export { Alert, type AlertProps, type AlertVariant, } from './components/Alert';
|
|
37
|
+
export { Breadcrumb, BreadcrumbItem, type BreadcrumbProps, type BreadcrumbItemProps, } from './components/Breadcrumb';
|
|
38
|
+
export { Pagination, type PaginationProps } from './components/Pagination';
|
|
39
|
+
export { Stepper, type StepDef, type StepperProps, type StepperOrientation, } from './components/Stepper';
|
|
40
|
+
export { Table, THead, TBody, Tr, Th, Td } from './components/Table';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// ── Theme ────────────────────────────────────────────────────────────────
|
|
2
|
+
export { lightTheme, darkTheme } from './theme';
|
|
3
|
+
export { GlobalStyles } from './GlobalStyles';
|
|
4
|
+
export { StampProvider } from './provider';
|
|
5
|
+
// ── Hooks ────────────────────────────────────────────────────────────────
|
|
6
|
+
export { useThemeStore } from './hooks/useThemeStore';
|
|
7
|
+
export { useDisclosure, } from './hooks/useDisclosure';
|
|
8
|
+
export { useClickOutside } from './hooks/useClickOutside';
|
|
9
|
+
// ── Components ─────────────────────────────────────────────────────────────
|
|
10
|
+
export { Button } from './components/Button';
|
|
11
|
+
export { Card, CardTitle, CardValue } from './components/Card';
|
|
12
|
+
export { Input, Select, Textarea, FieldWrap, FieldLabel, FieldError, } from './components/Input';
|
|
13
|
+
export { NumberInput } from './components/NumberInput';
|
|
14
|
+
export { Spinner } from './components/Spinner';
|
|
15
|
+
export { Skeleton, SkeletonText, SkeletonCircle, SkeletonGroup, } from './components/Skeleton';
|
|
16
|
+
export { Modal } from './components/Modal';
|
|
17
|
+
export { confirmDialog, ConfirmViewport, } from './components/ConfirmDialog';
|
|
18
|
+
export { toast, useToastStore, ToastViewport, } from './components/Toast';
|
|
19
|
+
export { ColorPicker, DEFAULT_SWATCHES, } from './components/ColorPicker';
|
|
20
|
+
export { IconPicker, DEFAULT_ICONS, } from './components/IconPicker';
|
|
21
|
+
export { Checkbox } from './components/Checkbox';
|
|
22
|
+
export { Radio, RadioGroup, } from './components/Radio';
|
|
23
|
+
export { Switch } from './components/Switch';
|
|
24
|
+
export { Slider } from './components/Slider';
|
|
25
|
+
export { Badge } from './components/Badge';
|
|
26
|
+
export { Tag } from './components/Tag';
|
|
27
|
+
export { Avatar, AvatarGroup, } from './components/Avatar';
|
|
28
|
+
export { Stat } from './components/Stat';
|
|
29
|
+
export { EmptyState } from './components/EmptyState';
|
|
30
|
+
export { Divider } from './components/Divider';
|
|
31
|
+
export { Progress, } from './components/Progress';
|
|
32
|
+
export { Tabs, TabList, Tab, TabPanel, } from './components/Tabs';
|
|
33
|
+
export { Accordion, AccordionItem, } from './components/Accordion';
|
|
34
|
+
export { Box, Stack, HStack, VStack, Grid, Container, } from './components/layout';
|
|
35
|
+
export { Tooltip } from './components/Tooltip';
|
|
36
|
+
export { Popover } from './components/Popover';
|
|
37
|
+
export { Menu, MenuButton, MenuList, MenuItem, } from './components/DropdownMenu';
|
|
38
|
+
export { Drawer, } from './components/Drawer';
|
|
39
|
+
export { Alert, } from './components/Alert';
|
|
40
|
+
export { Breadcrumb, BreadcrumbItem, } from './components/Breadcrumb';
|
|
41
|
+
export { Pagination } from './components/Pagination';
|
|
42
|
+
export { Stepper, } from './components/Stepper';
|
|
43
|
+
export { Table, THead, TBody, Tr, Th, Td } from './components/Table';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type ThemeMode } from './hooks/useThemeStore';
|
|
3
|
+
import { type Theme } from './theme';
|
|
4
|
+
export interface StampProviderProps {
|
|
5
|
+
/** Force a theme mode. If omitted, the persisted useThemeStore mode is used. */
|
|
6
|
+
mode?: ThemeMode;
|
|
7
|
+
/**
|
|
8
|
+
* A full or partial theme object. When given, it is shallow-merged over the
|
|
9
|
+
* base theme (chosen by `mode`) and takes precedence over `mode` selection.
|
|
10
|
+
*/
|
|
11
|
+
theme?: Partial<Theme>;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function StampProvider({ mode, theme, children }: StampProviderProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider } from 'styled-components';
|
|
3
|
+
import { GlobalStyles } from './GlobalStyles';
|
|
4
|
+
import { useThemeStore } from './hooks/useThemeStore';
|
|
5
|
+
import { darkTheme, lightTheme } from './theme';
|
|
6
|
+
export function StampProvider({ mode, theme, children }) {
|
|
7
|
+
// Subscribe to the store so the tree re-renders when the persisted mode
|
|
8
|
+
// changes; only consulted when `mode` is not explicitly provided.
|
|
9
|
+
const storeMode = useThemeStore((s) => s.mode);
|
|
10
|
+
const activeMode = mode ?? storeMode;
|
|
11
|
+
const base = activeMode === 'dark' ? darkTheme : lightTheme;
|
|
12
|
+
const resolved = theme ? { ...base, ...theme } : base;
|
|
13
|
+
return (_jsxs(ThemeProvider, { theme: resolved, children: [_jsx(GlobalStyles, {}), children] }));
|
|
14
|
+
}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stamp theme — saweria-flat. Solid yellow primary, white surfaces, hard
|
|
3
|
+
* offset "stamp" shadows instead of blurry diffusion, thin definite borders,
|
|
4
|
+
* no gradients on UI chrome.
|
|
5
|
+
*/
|
|
6
|
+
declare const radii: {
|
|
7
|
+
readonly xs: "4px";
|
|
8
|
+
readonly sm: "8px";
|
|
9
|
+
readonly md: "12px";
|
|
10
|
+
readonly lg: "16px";
|
|
11
|
+
readonly xl: "20px";
|
|
12
|
+
readonly pill: "999px";
|
|
13
|
+
};
|
|
14
|
+
declare const space: {
|
|
15
|
+
readonly 0: "0";
|
|
16
|
+
readonly 1: "4px";
|
|
17
|
+
readonly 2: "8px";
|
|
18
|
+
readonly 3: "12px";
|
|
19
|
+
readonly 4: "16px";
|
|
20
|
+
readonly 5: "20px";
|
|
21
|
+
readonly 6: "24px";
|
|
22
|
+
readonly 7: "32px";
|
|
23
|
+
readonly 8: "40px";
|
|
24
|
+
readonly 9: "56px";
|
|
25
|
+
readonly 10: "72px";
|
|
26
|
+
};
|
|
27
|
+
declare const font: {
|
|
28
|
+
readonly body: "\"Plus Jakarta Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
|
|
29
|
+
readonly mono: "\"JetBrains Mono\", \"SF Mono\", Menlo, monospace";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Saweria's signature is the "hard stamp" — solid offset shadow with no blur.
|
|
33
|
+
* Use shadow.stamp for buttons/cards that should feel chunky.
|
|
34
|
+
*/
|
|
35
|
+
declare const shadow: {
|
|
36
|
+
readonly none: "none";
|
|
37
|
+
readonly stamp: "4px 4px 0 #111111";
|
|
38
|
+
readonly stampSm: "2px 2px 0 #111111";
|
|
39
|
+
readonly stampLg: "6px 6px 0 #111111";
|
|
40
|
+
};
|
|
41
|
+
declare const easing: {
|
|
42
|
+
readonly out: "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
43
|
+
readonly inOut: "cubic-bezier(0.65, 0, 0.35, 1)";
|
|
44
|
+
};
|
|
45
|
+
export declare const lightTheme: {
|
|
46
|
+
mode: string;
|
|
47
|
+
colors: {
|
|
48
|
+
primary: "#FFDE15";
|
|
49
|
+
primaryHover: "#FFCB05";
|
|
50
|
+
primaryActive: "#E6B800";
|
|
51
|
+
primarySoft: "#FFF6BF";
|
|
52
|
+
primaryInk: "#111111";
|
|
53
|
+
accent: "#FF6B6B";
|
|
54
|
+
accentDark: "#A33636";
|
|
55
|
+
income: "#1FAB6E";
|
|
56
|
+
incomeSoft: "#D7F5E5";
|
|
57
|
+
expense: "#FF6B6B";
|
|
58
|
+
expenseSoft: "#FFE0E0";
|
|
59
|
+
bg: "#FFFCF0";
|
|
60
|
+
bgAlt: "#FFF8E1";
|
|
61
|
+
surface: "#FFFFFF";
|
|
62
|
+
surfaceMuted: "#FFFCE0";
|
|
63
|
+
surfaceSunken: "#FFFCF0";
|
|
64
|
+
text: "#111111";
|
|
65
|
+
textMuted: "#3A3A3A";
|
|
66
|
+
textSubtle: "#6E6E6E";
|
|
67
|
+
border: "#1A1A1A";
|
|
68
|
+
borderSoft: "#E5E5E5";
|
|
69
|
+
borderStrong: "#1A1A1A";
|
|
70
|
+
success: "#1FAB6E";
|
|
71
|
+
danger: "#FF6B6B";
|
|
72
|
+
warning: "#E6B800";
|
|
73
|
+
overlay: string;
|
|
74
|
+
};
|
|
75
|
+
radii: {
|
|
76
|
+
readonly xs: "4px";
|
|
77
|
+
readonly sm: "8px";
|
|
78
|
+
readonly md: "12px";
|
|
79
|
+
readonly lg: "16px";
|
|
80
|
+
readonly xl: "20px";
|
|
81
|
+
readonly pill: "999px";
|
|
82
|
+
};
|
|
83
|
+
space: {
|
|
84
|
+
readonly 0: "0";
|
|
85
|
+
readonly 1: "4px";
|
|
86
|
+
readonly 2: "8px";
|
|
87
|
+
readonly 3: "12px";
|
|
88
|
+
readonly 4: "16px";
|
|
89
|
+
readonly 5: "20px";
|
|
90
|
+
readonly 6: "24px";
|
|
91
|
+
readonly 7: "32px";
|
|
92
|
+
readonly 8: "40px";
|
|
93
|
+
readonly 9: "56px";
|
|
94
|
+
readonly 10: "72px";
|
|
95
|
+
};
|
|
96
|
+
font: {
|
|
97
|
+
readonly body: "\"Plus Jakarta Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
|
|
98
|
+
readonly mono: "\"JetBrains Mono\", \"SF Mono\", Menlo, monospace";
|
|
99
|
+
};
|
|
100
|
+
shadow: {
|
|
101
|
+
readonly none: "none";
|
|
102
|
+
readonly stamp: "4px 4px 0 #111111";
|
|
103
|
+
readonly stampSm: "2px 2px 0 #111111";
|
|
104
|
+
readonly stampLg: "6px 6px 0 #111111";
|
|
105
|
+
};
|
|
106
|
+
easing: {
|
|
107
|
+
readonly out: "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
108
|
+
readonly inOut: "cubic-bezier(0.65, 0, 0.35, 1)";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare const darkTheme: {
|
|
112
|
+
mode: string;
|
|
113
|
+
colors: {
|
|
114
|
+
primary: "#FFDE15";
|
|
115
|
+
primaryHover: "#FFCB05";
|
|
116
|
+
primaryActive: "#E6B800";
|
|
117
|
+
primarySoft: string;
|
|
118
|
+
primaryInk: "#111111";
|
|
119
|
+
accent: "#FF6B6B";
|
|
120
|
+
accentDark: string;
|
|
121
|
+
income: string;
|
|
122
|
+
incomeSoft: string;
|
|
123
|
+
expense: string;
|
|
124
|
+
expenseSoft: string;
|
|
125
|
+
bg: string;
|
|
126
|
+
bgAlt: string;
|
|
127
|
+
surface: string;
|
|
128
|
+
surfaceMuted: string;
|
|
129
|
+
surfaceSunken: string;
|
|
130
|
+
text: string;
|
|
131
|
+
textMuted: string;
|
|
132
|
+
textSubtle: string;
|
|
133
|
+
border: string;
|
|
134
|
+
borderSoft: string;
|
|
135
|
+
borderStrong: string;
|
|
136
|
+
success: string;
|
|
137
|
+
danger: string;
|
|
138
|
+
warning: "#FFDE15";
|
|
139
|
+
overlay: string;
|
|
140
|
+
};
|
|
141
|
+
radii: {
|
|
142
|
+
readonly xs: "4px";
|
|
143
|
+
readonly sm: "8px";
|
|
144
|
+
readonly md: "12px";
|
|
145
|
+
readonly lg: "16px";
|
|
146
|
+
readonly xl: "20px";
|
|
147
|
+
readonly pill: "999px";
|
|
148
|
+
};
|
|
149
|
+
space: {
|
|
150
|
+
readonly 0: "0";
|
|
151
|
+
readonly 1: "4px";
|
|
152
|
+
readonly 2: "8px";
|
|
153
|
+
readonly 3: "12px";
|
|
154
|
+
readonly 4: "16px";
|
|
155
|
+
readonly 5: "20px";
|
|
156
|
+
readonly 6: "24px";
|
|
157
|
+
readonly 7: "32px";
|
|
158
|
+
readonly 8: "40px";
|
|
159
|
+
readonly 9: "56px";
|
|
160
|
+
readonly 10: "72px";
|
|
161
|
+
};
|
|
162
|
+
font: {
|
|
163
|
+
readonly body: "\"Plus Jakarta Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
|
|
164
|
+
readonly mono: "\"JetBrains Mono\", \"SF Mono\", Menlo, monospace";
|
|
165
|
+
};
|
|
166
|
+
shadow: {
|
|
167
|
+
none: string;
|
|
168
|
+
stamp: string;
|
|
169
|
+
stampSm: string;
|
|
170
|
+
stampLg: string;
|
|
171
|
+
};
|
|
172
|
+
easing: {
|
|
173
|
+
readonly out: "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
174
|
+
readonly inOut: "cubic-bezier(0.65, 0, 0.35, 1)";
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Public theme contract. Color/shadow values are intentionally widened to
|
|
179
|
+
* `string` so both `lightTheme` and `darkTheme` satisfy the same shape — if
|
|
180
|
+
* they were inferred from `lightTheme` via `typeof`, the `as const` palette
|
|
181
|
+
* would pin each value to a narrow string literal (e.g. `"#FFF6BF"`) and
|
|
182
|
+
* `darkTheme` would NOT be assignable to `Theme`.
|
|
183
|
+
*/
|
|
184
|
+
export type Theme = {
|
|
185
|
+
mode: string;
|
|
186
|
+
colors: Record<keyof typeof lightTheme.colors, string>;
|
|
187
|
+
radii: typeof radii;
|
|
188
|
+
space: typeof space;
|
|
189
|
+
font: typeof font;
|
|
190
|
+
shadow: Record<keyof typeof shadow, string>;
|
|
191
|
+
easing: typeof easing;
|
|
192
|
+
};
|
|
193
|
+
export {};
|