@cwellt_software/cwellt-reactjs-lib 1.5.4 → 1.6.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/content/icons/IconLibrary.stories.tsx +18 -0
- package/dist/index.cjs.js +117 -93
- package/dist/index.css +2 -2
- package/dist/index.d.ts +63 -42
- package/dist/index.es.js +117 -93
- package/dist/src/common/styles/tokens/ColorContrast.stories.d.ts +11 -0
- package/dist/src/common/styles/tokens/ColorContrast.stories.d.ts.map +1 -0
- package/dist/src/common/styles/tokens/ColorPalette.stories.d.ts +22 -0
- package/dist/src/common/styles/tokens/ColorPalette.stories.d.ts.map +1 -0
- package/dist/src/common/styles/tokens/DarkModePreview.stories.d.ts +12 -0
- package/dist/src/common/styles/tokens/DarkModePreview.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/button/CwButtonSplit.stories.d.ts +24 -0
- package/dist/src/components/control/action/button/CwButtonSplit.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/button/CwButtonSwitch.stories.d.ts +39 -0
- package/dist/src/components/control/action/button/CwButtonSwitch.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts +1 -1
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.stories.d.ts +29 -0
- package/dist/src/components/control/action/contextmenu/CwAnchoredMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts +2 -3
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwContextMenu.stories.d.ts +24 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/search/CwSearchAsync.stories.d.ts +103 -0
- package/dist/src/components/control/action/search/CwSearchAsync.stories.d.ts.map +1 -0
- package/dist/src/components/control/action/search/CwSearchInput.stories.d.ts +452 -0
- package/dist/src/components/control/action/search/CwSearchInput.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwCheck.stories.d.ts +47 -0
- package/dist/src/components/control/choice/checkbox/CwCheck.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.stories.d.ts +102 -0
- package/dist/src/components/control/choice/checkbox/CwCheckboxGroup.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/checkbox/CwRadioGroup.stories.d.ts +96 -0
- package/dist/src/components/control/choice/checkbox/CwRadioGroup.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.d.ts +4 -0
- package/dist/src/components/control/choice/dropdown/CwDropdownFilter.d.ts.map +1 -1
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.stories.d.ts +29 -0
- package/dist/src/components/control/choice/dropdown/CwPopoverButton.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.stories.d.ts +53 -0
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/nav-menu/CwNavMenu.stories.d.ts +325 -0
- package/dist/src/components/control/choice/nav-menu/CwNavMenu.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/select/CwDropdown.stories.d.ts +653 -0
- package/dist/src/components/control/choice/select/CwDropdown.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/select/CwSelect.stories.d.ts +657 -0
- package/dist/src/components/control/choice/select/CwSelect.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/tag-selector/CwTagSelector.stories.d.ts +132 -0
- package/dist/src/components/control/choice/tag-selector/CwTagSelector.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/toggle/CwToggle.stories.d.ts +47 -0
- package/dist/src/components/control/choice/toggle/CwToggle.stories.d.ts.map +1 -0
- package/dist/src/components/control/choice/tree-view/CwTreeView.stories.d.ts +41 -0
- package/dist/src/components/control/choice/tree-view/CwTreeView.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/any/CwInput.d.ts +4 -0
- package/dist/src/components/control/input/any/CwInput.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwColorPicker.d.ts +2 -3
- package/dist/src/components/control/input/color/CwColorPicker.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwColorPicker.stories.d.ts +31 -0
- package/dist/src/components/control/input/color/CwColorPicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/color/CwInputColor.d.ts +1 -2
- package/dist/src/components/control/input/color/CwInputColor.d.ts.map +1 -1
- package/dist/src/components/control/input/color/CwInputColor.stories.d.ts +91 -0
- package/dist/src/components/control/input/color/CwInputColor.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/date-text/CwInputDateText.d.ts +4 -0
- package/dist/src/components/control/input/date-text/CwInputDateText.d.ts.map +1 -1
- package/dist/src/components/control/input/digit/CwDigit.stories.d.ts +845 -0
- package/dist/src/components/control/input/digit/CwDigit.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts +1 -2
- package/dist/src/components/control/input/file/CwFileUploadMultiple.d.ts.map +1 -1
- package/dist/src/components/control/input/file/CwFileUploadMultiple.stories.d.ts +78 -0
- package/dist/src/components/control/input/file/CwFileUploadMultiple.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/image/CwInputImage.stories.d.ts +38 -0
- package/dist/src/components/control/input/image/CwInputImage.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/image-area/CwImageArea.stories.d.ts +50 -0
- package/dist/src/components/control/input/image-area/CwImageArea.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDatePicker.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDatePicker.stories.d.ts +140 -0
- package/dist/src/components/control/input/new-dates/CwDatePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDatePickerTemporal.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDatePickerTemporal.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.stories.d.ts +160 -0
- package/dist/src/components/control/input/new-dates/CwDateRangePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateRangePickerTemporal.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDateRangePickerTemporal.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.stories.d.ts +150 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/new-dates/CwDateTimePickerCompact.d.ts +0 -1
- package/dist/src/components/control/input/new-dates/CwDateTimePickerCompact.d.ts.map +1 -1
- package/dist/src/components/control/input/new-dates/CwTimePicker.stories.d.ts +111 -0
- package/dist/src/components/control/input/new-dates/CwTimePicker.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/phone/CwInputPhone.stories.d.ts +839 -0
- package/dist/src/components/control/input/phone/CwInputPhone.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/text/CwInputText.d.ts +3 -4
- package/dist/src/components/control/input/text/CwInputText.d.ts.map +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.d.ts +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.d.ts.map +1 -1
- package/dist/src/components/control/input/text-area/CwTextArea.stories.d.ts +668 -0
- package/dist/src/components/control/input/text-area/CwTextArea.stories.d.ts.map +1 -0
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.d.ts +1 -2
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.d.ts.map +1 -1
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.stories.d.ts +108 -0
- package/dist/src/components/control/input/weekday/CwWeekdaySelector.stories.d.ts.map +1 -0
- package/dist/src/components/custom/scheduler-new/presentation/Scheduler.stories.d.ts +41 -0
- package/dist/src/components/custom/scheduler-new/presentation/Scheduler.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/accordion/CwAccordionContainer.d.ts +2 -4
- package/dist/src/components/display/data/accordion/CwAccordionContainer.d.ts.map +1 -1
- package/dist/src/components/display/data/accordion/CwAccordionContainer.stories.d.ts +27 -0
- package/dist/src/components/display/data/accordion/CwAccordionContainer.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +4 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/table/CwTable.stories.d.ts +59 -0
- package/dist/src/components/display/data/table/CwTable.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.stories.d.ts +53 -0
- package/dist/src/components/display/data/table-serverside/CwTableServerSide.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/table_sortable/CwSortableTable.stories.d.ts +45 -0
- package/dist/src/components/display/data/table_sortable/CwSortableTable.stories.d.ts.map +1 -0
- package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts +1 -2
- package/dist/src/components/display/data/tooltip_manager/CwTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/tooltip_manager/CwTooltipNew.stories.d.ts +52 -0
- package/dist/src/components/display/data/tooltip_manager/CwTooltipNew.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/icon/CwIcon.stories.d.ts +37 -0
- package/dist/src/components/display/graphics/icon/CwIcon.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/image-gallery/CwImageGallery.stories.d.ts +24 -0
- package/dist/src/components/display/graphics/image-gallery/CwImageGallery.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/image-zoom/CwImageZoom.stories.d.ts +23 -0
- package/dist/src/components/display/graphics/image-zoom/CwImageZoom.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts +1 -1
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts.map +1 -1
- package/dist/src/components/display/graphics/loading/CwLoading.stories.d.ts +44 -0
- package/dist/src/components/display/graphics/loading/CwLoading.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/progress/CwProgress.stories.d.ts +61 -0
- package/dist/src/components/display/graphics/progress/CwProgress.stories.d.ts.map +1 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.stories.d.ts +52 -0
- package/dist/src/components/display/graphics/skeleton/CwSkeleton.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/badge/CwBadge.stories.d.ts +36 -0
- package/dist/src/components/display/text/badge/CwBadge.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/heading/CwHeading.stories.d.ts +23 -0
- package/dist/src/components/display/text/heading/CwHeading.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/label/CwLabel.stories.d.ts +31 -0
- package/dist/src/components/display/text/label/CwLabel.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/message/CwMessage.stories.d.ts +38 -0
- package/dist/src/components/display/text/message/CwMessage.stories.d.ts.map +1 -0
- package/dist/src/components/display/text/tag/CwChip.d.ts +9 -9
- package/dist/src/components/display/text/tag/CwChip.d.ts.map +1 -1
- package/dist/src/components/layout/align/CwAlign.stories.d.ts +439 -0
- package/dist/src/components/layout/align/CwAlign.stories.d.ts.map +1 -0
- package/dist/src/components/layout/card/CwCard.d.ts +17 -17
- package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
- package/dist/src/components/layout/card/CwCard.stories.d.ts +75 -0
- package/dist/src/components/layout/card/CwCard.stories.d.ts.map +1 -0
- package/dist/src/components/layout/card/CwCardList.stories.d.ts +52 -0
- package/dist/src/components/layout/card/CwCardList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.d.ts +5 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.d.ts.map +1 -1
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.stories.d.ts +55 -0
- package/dist/src/components/layout/confirmation-popup/CwConfirmationPopup.stories.d.ts.map +1 -0
- package/dist/src/components/layout/dialog/CwDialog.d.ts +1 -1
- package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
- package/dist/src/components/layout/dialog/CwDialog.stories.d.ts +62 -0
- package/dist/src/components/layout/dialog/CwDialog.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/details/CwExpandable.d.ts +2 -1
- package/dist/src/components/layout/list/details/CwExpandable.d.ts.map +1 -1
- package/dist/src/components/layout/list/details/CwExpandable.stories.d.ts +35 -0
- package/dist/src/components/layout/list/details/CwExpandable.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.stories.d.ts +84 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/list/sortable/CwSortableList.stories.d.ts +49 -0
- package/dist/src/components/layout/list/sortable/CwSortableList.stories.d.ts.map +1 -0
- package/dist/src/components/layout/master-detail/CwMasterDetail.stories.d.ts +71 -0
- package/dist/src/components/layout/master-detail/CwMasterDetail.stories.d.ts.map +1 -0
- package/dist/src/components/layout/modal/hover/CwModalHover.d.ts +2 -1
- package/dist/src/components/layout/modal/hover/CwModalHover.d.ts.map +1 -1
- package/dist/src/components/layout/modal/hover/CwModalHover.stories.d.ts +404 -0
- package/dist/src/components/layout/modal/hover/CwModalHover.stories.d.ts.map +1 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.d.ts +1 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.d.ts.map +1 -1
- package/dist/src/components/layout/table/grouped/CwTableGrouped.stories.d.ts +31 -0
- package/dist/src/components/layout/table/grouped/CwTableGrouped.stories.d.ts.map +1 -0
- package/dist/src/components/layout/tabs/CwTabs.stories.d.ts +36 -0
- package/dist/src/components/layout/tabs/CwTabs.stories.d.ts.map +1 -0
- package/dist/src/content/icons/IconLibrary.stories.d.ts +20 -0
- package/dist/src/content/icons/IconLibrary.stories.d.ts.map +1 -0
- package/dist/src/playground/pages/ShadowRecipesPage.d.ts +3 -0
- package/dist/src/playground/pages/ShadowRecipesPage.d.ts.map +1 -0
- package/dist/src/storybook/PaletteAndComponentMappingDecorator.d.ts +28 -0
- package/dist/src/storybook/PaletteAndComponentMappingDecorator.d.ts.map +1 -0
- package/dist/src/storybook/PaletteDecorator.d.ts +12 -0
- package/dist/src/storybook/PaletteDecorator.d.ts.map +1 -0
- package/dist/src/storybook/StoryValue.d.ts +11 -0
- package/dist/src/storybook/StoryValue.d.ts.map +1 -0
- package/dist/src/storybook/componentMappings.d.ts +29 -0
- package/dist/src/storybook/componentMappings.d.ts.map +1 -0
- package/dist/src/storybook/cssVarOverrideStore.d.ts +23 -0
- package/dist/src/storybook/cssVarOverrideStore.d.ts.map +1 -0
- package/dist/src/storybook/groupLayoutStoryArgs.d.ts +77 -0
- package/dist/src/storybook/groupLayoutStoryArgs.d.ts.map +1 -0
- package/dist/src/storybook/needsRefactor.d.ts +15 -0
- package/dist/src/storybook/needsRefactor.d.ts.map +1 -0
- package/dist/src/storybook/palettes.d.ts +35 -0
- package/dist/src/storybook/palettes.d.ts.map +1 -0
- package/dist/src/storybook/pickerStoryArgs.d.ts +63 -0
- package/dist/src/storybook/pickerStoryArgs.d.ts.map +1 -0
- package/dist/src/storybook/sampleImages.d.ts +11 -0
- package/dist/src/storybook/sampleImages.d.ts.map +1 -0
- package/dist/src/storybook/sampleRows.d.ts +12 -0
- package/dist/src/storybook/sampleRows.d.ts.map +1 -0
- package/dist/src/storybook/storySource.d.ts +1 -1
- package/dist/src/storybook/storySource.d.ts.map +1 -1
- package/dist/src/storybook/useCssVarOverride.d.ts +17 -0
- package/dist/src/storybook/useCssVarOverride.d.ts.map +1 -0
- package/dist/test/storybook/cssVarOverrideStore.test.d.ts +2 -0
- package/dist/test/storybook/cssVarOverrideStore.test.d.ts.map +1 -0
- package/dist/test/storybook/groupLayoutStoryArgs.test.d.ts +2 -0
- package/dist/test/storybook/groupLayoutStoryArgs.test.d.ts.map +1 -0
- package/package.json +11 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example component-assignment remaps for the Storybook "Component Mapping" toolbar - a dev/QA tool
|
|
3
|
+
* to eyeball what icons, solid/outline buttons and table headers/row-selected states would look like
|
|
4
|
+
* if they were assigned to a different semantic family, before locking the assignment in Figma.
|
|
5
|
+
*
|
|
6
|
+
* These override the LAYER-3 tokens in cw-theme.css (the "# Component assignments" section) - the
|
|
7
|
+
* layer components actually consume (CwIcon, CwButton, CwTable). Unlike the "Palette" toolbar (which
|
|
8
|
+
* overrides layer-1 primitives and cascades upward through every layer), this tool stays scoped to
|
|
9
|
+
* layer 3, so it previews a re-mapping of which family a component reads without touching what any
|
|
10
|
+
* family's colors are.
|
|
11
|
+
*
|
|
12
|
+
* Values here point at real existing tokens (layer 1, 2 or 3), never invented ones - per project
|
|
13
|
+
* convention, library stories stay domain-neutral (no real client names, no real client colors).
|
|
14
|
+
*
|
|
15
|
+
* Consumption flip in progress: cw-button.css and the generic button rule already read the layer-3
|
|
16
|
+
* names (--cw-button-solid-*, --cw-icon-content/-hover), so those mappings are live. The table pair
|
|
17
|
+
* goes live when CwTable flips. Each mapping still sets the matching OLD bridge token too, for the
|
|
18
|
+
* components that have not flipped yet (date-text icon, picker accent, table and accordion icon
|
|
19
|
+
* overrides); the duals go when the last of them moves.
|
|
20
|
+
*/
|
|
21
|
+
export type ComponentMappingOverrides = Record<string, string>;
|
|
22
|
+
export interface NamedComponentMapping {
|
|
23
|
+
label: string;
|
|
24
|
+
overrides: ComponentMappingOverrides;
|
|
25
|
+
}
|
|
26
|
+
/** Keyed by the Storybook toolbar item id. "Default" is cw-theme.css as shipped - no overrides. */
|
|
27
|
+
export declare const STORYBOOK_COMPONENT_MAPPINGS: Record<string, NamedComponentMapping>;
|
|
28
|
+
export declare const DEFAULT_COMPONENT_MAPPING_KEY = "Default";
|
|
29
|
+
//# sourceMappingURL=componentMappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentMappings.d.ts","sourceRoot":"","sources":["../../../src/storybook/componentMappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,yBAAyB,CAAC;CACrC;AAkDD,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAI9E,CAAC;AAEF,eAAO,MAAM,6BAA6B,YAAY,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared bookkeeping behind useCssVarOverride. Several instances run at once on a docs page
|
|
3
|
+
* (autodocs renders every story of the component, each with its own decorator), all writing the same
|
|
4
|
+
* root variables. The original inline value of a variable is therefore captured once, by the first
|
|
5
|
+
* holder that touches it, and restored once, by the last holder that lets go of it. An instance that
|
|
6
|
+
* captured "what was there" after a sibling had already applied the palette would otherwise restore
|
|
7
|
+
* that sibling's palette on cleanup, and switching back to Default would keep showing it.
|
|
8
|
+
*/
|
|
9
|
+
/** The slice of CSSStyleDeclaration the store needs; a plain object works in tests. */
|
|
10
|
+
export interface StyleTarget {
|
|
11
|
+
getPropertyValue(name: string): string;
|
|
12
|
+
getPropertyPriority(name: string): string;
|
|
13
|
+
setProperty(name: string, value: string, priority?: string): void;
|
|
14
|
+
removeProperty(name: string): void;
|
|
15
|
+
}
|
|
16
|
+
export declare function createCssVarOverrideStore(): {
|
|
17
|
+
apply: (style: StyleTarget, overrides: Record<string, string>) => () => void;
|
|
18
|
+
};
|
|
19
|
+
/** The one store every decorator instance on the page shares. */
|
|
20
|
+
export declare const cssVarOverrideStore: {
|
|
21
|
+
apply: (style: StyleTarget, overrides: Record<string, string>) => () => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=cssVarOverrideStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVarOverrideStore.d.ts","sourceRoot":"","sources":["../../../src/storybook/cssVarOverrideStore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uFAAuF;AACvF,MAAM,WAAW,WAAW;IAC3B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClE,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAQD,wBAAgB,yBAAyB;mBAIlB,WAAW,aAAa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAAM,IAAI;EA+BjF;AAED,iEAAiE;AACjE,eAAO,MAAM,mBAAmB;mBAlCT,WAAW,aAAa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAAM,IAAI;CAkCpB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flat story controls for the group components (CwRadioGroup, CwCheckboxGroup): the two nested
|
|
3
|
+
* layout axes of CwGroupLayoutProps (`groupLayout` = label vs options block, `itemLayout` = flow
|
|
4
|
+
* of the options), plus the label and feedback objects they share. Same idea as layoutStoryArgs
|
|
5
|
+
* and inputStoryArgs: one control per meaningful field, the real object props stay in the docs
|
|
6
|
+
* table without a control, and the snippet shows the real props. Reuse from a group story:
|
|
7
|
+
*
|
|
8
|
+
* args: { ...groupStoryDefaults, options: [...] },
|
|
9
|
+
* argTypes: { ...groupStoryArgTypesFor({ group: {...}, item: {...} }), ...hiddenGroupPropControls },
|
|
10
|
+
* render: (args) => <CwSomethingGroup {...toGroupProps(args)} />,
|
|
11
|
+
* parameters: groupStorySource("CwSomethingGroup"),
|
|
12
|
+
*/
|
|
13
|
+
import type { ArgTypes } from "@storybook/react-vite";
|
|
14
|
+
import type { CwInputFeedback } from "../common/interfaces/CwFormTypes";
|
|
15
|
+
import type { CwGroupLayoutProps, CwLayoutProps } from "../common/interfaces/CwLayoutProps";
|
|
16
|
+
import type { CwLabelProps } from "../components/display/text/label/CwLabel";
|
|
17
|
+
declare const DEFAULT = "default";
|
|
18
|
+
type Direction = NonNullable<CwLayoutProps["direction"]>;
|
|
19
|
+
type Align = NonNullable<CwLayoutProps["align"]>;
|
|
20
|
+
type Gap = NonNullable<CwLayoutProps["gap"]>;
|
|
21
|
+
declare const FEEDBACK_TYPES: readonly ["none", "danger", "warning", "success", "info", "neutral"];
|
|
22
|
+
export interface GroupStoryArgs {
|
|
23
|
+
groupDirection: typeof DEFAULT | Direction;
|
|
24
|
+
groupAlign: typeof DEFAULT | Align;
|
|
25
|
+
groupGap: typeof DEFAULT | Gap;
|
|
26
|
+
itemDirection: typeof DEFAULT | Direction;
|
|
27
|
+
itemGap: typeof DEFAULT | Gap;
|
|
28
|
+
labelText: string;
|
|
29
|
+
feedbackType: (typeof FEEDBACK_TYPES)[number];
|
|
30
|
+
feedbackMessage: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const groupStoryDefaults: GroupStoryArgs;
|
|
33
|
+
/** The values each axis really styles; a field left out gets no control. */
|
|
34
|
+
export interface SupportedGroupLayout {
|
|
35
|
+
group?: {
|
|
36
|
+
direction?: readonly Direction[];
|
|
37
|
+
align?: readonly Align[];
|
|
38
|
+
gap?: readonly Gap[];
|
|
39
|
+
};
|
|
40
|
+
item?: {
|
|
41
|
+
direction?: readonly Direction[];
|
|
42
|
+
gap?: readonly Gap[];
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare function groupStoryArgTypesFor(supported: SupportedGroupLayout): ArgTypes<GroupStoryArgs>;
|
|
46
|
+
/** The real object props keep their row in the docs table but get no control of their own. */
|
|
47
|
+
export declare const hiddenGroupPropControls: {
|
|
48
|
+
groupLayout: {
|
|
49
|
+
control: false;
|
|
50
|
+
};
|
|
51
|
+
itemLayout: {
|
|
52
|
+
control: false;
|
|
53
|
+
};
|
|
54
|
+
labelProps: {
|
|
55
|
+
control: false;
|
|
56
|
+
};
|
|
57
|
+
feedback: {
|
|
58
|
+
control: false;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export interface GroupObjectProps extends CwGroupLayoutProps {
|
|
62
|
+
labelProps: CwLabelProps | undefined;
|
|
63
|
+
feedback: CwInputFeedback | undefined;
|
|
64
|
+
}
|
|
65
|
+
/** Translates the flat story args into the component's object props and drops the flat keys. */
|
|
66
|
+
export declare function toGroupProps<T extends Partial<GroupStoryArgs>>(args: T): Omit<T, keyof GroupStoryArgs> & GroupObjectProps;
|
|
67
|
+
export declare function groupStorySource(componentName: string, componentDefaults?: Record<string, unknown>): {
|
|
68
|
+
docs: {
|
|
69
|
+
source: {
|
|
70
|
+
transform: (_code: string, storyContext: {
|
|
71
|
+
args: Record<string, unknown>;
|
|
72
|
+
}) => string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=groupLayoutStoryArgs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupLayoutStoryArgs.d.ts","sourceRoot":"","sources":["../../../src/storybook/groupLayoutStoryArgs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAG7E,QAAA,MAAM,OAAO,YAAY,CAAC;AAC1B,KAAK,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AACzD,KAAK,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,KAAK,GAAG,GAAG,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7C,QAAA,MAAM,cAAc,sEAAuE,CAAC;AAE5F,MAAM,WAAW,cAAc;IAC9B,cAAc,EAAE,OAAO,OAAO,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,OAAO,OAAO,GAAG,KAAK,CAAC;IACnC,QAAQ,EAAE,OAAO,OAAO,GAAG,GAAG,CAAC;IAC/B,aAAa,EAAE,OAAO,OAAO,GAAG,SAAS,CAAC;IAC1C,OAAO,EAAE,OAAO,OAAO,GAAG,GAAG,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9C,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,cAShC,CAAC;AAOF,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACpC,KAAK,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,SAAS,GAAG,EAAE,CAAA;KAAE,CAAC;IAC7F,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,SAAS,GAAG,EAAE,CAAA;KAAE,CAAC;CAClE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,oBAAoB,GAAG,QAAQ,CAAC,cAAc,CAAC,CAiB/F;AAED,8FAA8F;AAC9F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAKhB,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC3D,UAAU,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;CACtC;AAOD,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,cAAc,CAAC,GAAG,gBAAgB,CAYzH;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,iBAAiB,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;;;;;;EAEtG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Decorator } from "@storybook/react-vite";
|
|
2
|
+
/**
|
|
3
|
+
* For a component that still ships but should not be picked for new code. The decorator paints a
|
|
4
|
+
* solid warning note above every story (canvas and docs); the docs description leads with the same
|
|
5
|
+
* line, the component's own summary follows.
|
|
6
|
+
*/
|
|
7
|
+
export declare const withNeedsRefactorNote: Decorator;
|
|
8
|
+
export declare function needsRefactorDocs(summary: string): {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=needsRefactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needsRefactor.d.ts","sourceRoot":"","sources":["../../../src/storybook/needsRefactor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAKnC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM;;;;;;EAQhD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example palettes for the Storybook "Palette" toolbar - a dev/QA tool to eyeball contrast and the
|
|
3
|
+
* dark-mode preview against non-default brand colors before deciding on real per-client values.
|
|
4
|
+
*
|
|
5
|
+
* These override the PRIMITIVE tokens (--cw-color-{family}-{step} in cw-palette.css), the layer a
|
|
6
|
+
* customer's brand colors actually replace. The old --cw-color-* tokens in cw-colors.css are bridge
|
|
7
|
+
* aliases that read the primitives via var() (e.g. --cw-color-primary: var(--cw-color-primary-main)),
|
|
8
|
+
* and the theme/component tokens in cw-theme.css route through those old tokens in turn - so
|
|
9
|
+
* overriding the primitives cascades upward through all three layers from one place.
|
|
10
|
+
*
|
|
11
|
+
* The neutral scale's translucent primitives (--cw-color-neutral-090-25/-15) are color-mix()
|
|
12
|
+
* derivatives of --cw-color-neutral-090, so overriding -090 alone already cascades into them -
|
|
13
|
+
* no separate override entries needed for the translucent variants.
|
|
14
|
+
*
|
|
15
|
+
* Values here are invented placeholders, not real client colors - per project convention, library
|
|
16
|
+
* stories stay domain-neutral (no real client names, no real client colors).
|
|
17
|
+
*/
|
|
18
|
+
export type PaletteOverrides = Record<string, string>;
|
|
19
|
+
/** Layer-3 component-assignment tokens a palette re-points, by token name. */
|
|
20
|
+
export type ComponentOverrides = Record<string, string>;
|
|
21
|
+
export interface NamedPalette {
|
|
22
|
+
label: string;
|
|
23
|
+
overrides: PaletteOverrides;
|
|
24
|
+
/**
|
|
25
|
+
* Layer-3 component-assignment overrides bundled with this palette - applied automatically whenever
|
|
26
|
+
* the palette is selected, on top of `overrides`, so a client's brand doesn't just recolor the
|
|
27
|
+
* primitives but also carries its own icon/button re-assignment. Which family a component reads is
|
|
28
|
+
* each palette's decision; there is no generic mapping.
|
|
29
|
+
*/
|
|
30
|
+
componentOverrides?: ComponentOverrides;
|
|
31
|
+
}
|
|
32
|
+
/** Keyed by the Storybook toolbar item id. "Default" is the library's own palette - no overrides. */
|
|
33
|
+
export declare const STORYBOOK_PALETTES: Record<string, NamedPalette>;
|
|
34
|
+
export declare const DEFAULT_PALETTE_KEY = "Default";
|
|
35
|
+
//# sourceMappingURL=palettes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palettes.d.ts","sourceRoot":"","sources":["../../../src/storybook/palettes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtD,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExD,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,gBAAgB,CAAC;IAC5B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AA6LD,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAK3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flat story controls shared by the date and time pickers: label and layout (they take labelProps
|
|
3
|
+
* and alignProps but no button), plus the translation back to the real props. Feedback is only on
|
|
4
|
+
* the single-date pickers, so each story decides whether to expose it.
|
|
5
|
+
*/
|
|
6
|
+
import type { ArgTypes } from "@storybook/react-vite";
|
|
7
|
+
import type { CwInputFeedback } from "../common/interfaces/CwFormTypes";
|
|
8
|
+
import type { CwLabelProps } from "../components/display/text/label/CwLabel";
|
|
9
|
+
import type { CwAlignProps } from "../components/layout/align/CwAlign";
|
|
10
|
+
import { LABEL_WIDTHS } from "./inputStoryArgs";
|
|
11
|
+
declare const FEEDBACK_TYPES: readonly ["none", "danger", "warning", "success", "info", "neutral"];
|
|
12
|
+
export interface PickerStoryArgs {
|
|
13
|
+
direction: "row" | "column";
|
|
14
|
+
labelText: string;
|
|
15
|
+
labelWidth: (typeof LABEL_WIDTHS)[number];
|
|
16
|
+
feedbackType: (typeof FEEDBACK_TYPES)[number];
|
|
17
|
+
feedbackMessage: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const pickerStoryDefaults: PickerStoryArgs;
|
|
20
|
+
export declare const pickerStoryArgTypes: ArgTypes<PickerStoryArgs>;
|
|
21
|
+
/** For pickers without a `feedback` prop. */
|
|
22
|
+
export declare const hiddenFeedbackControls: {
|
|
23
|
+
feedbackType: {
|
|
24
|
+
table: {
|
|
25
|
+
disable: true;
|
|
26
|
+
};
|
|
27
|
+
control: false;
|
|
28
|
+
};
|
|
29
|
+
feedbackMessage: {
|
|
30
|
+
table: {
|
|
31
|
+
disable: true;
|
|
32
|
+
};
|
|
33
|
+
control: false;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const hiddenPickerPropControls: {
|
|
37
|
+
alignProps: {
|
|
38
|
+
control: false;
|
|
39
|
+
};
|
|
40
|
+
labelProps: {
|
|
41
|
+
control: false;
|
|
42
|
+
};
|
|
43
|
+
feedback: {
|
|
44
|
+
control: false;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export interface PickerObjectProps {
|
|
48
|
+
alignProps: CwAlignProps | undefined;
|
|
49
|
+
labelProps: CwLabelProps | undefined;
|
|
50
|
+
feedback: CwInputFeedback | undefined;
|
|
51
|
+
}
|
|
52
|
+
export declare function toPickerProps<T extends Partial<PickerStoryArgs>>(args: T): Omit<T, keyof PickerStoryArgs> & PickerObjectProps;
|
|
53
|
+
export declare function pickerStorySource(componentName: string, componentDefaults?: Record<string, unknown>): {
|
|
54
|
+
docs: {
|
|
55
|
+
source: {
|
|
56
|
+
transform: (_code: string, storyContext: {
|
|
57
|
+
args: Record<string, unknown>;
|
|
58
|
+
}) => string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=pickerStoryArgs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickerStoryArgs.d.ts","sourceRoot":"","sources":["../../../src/storybook/pickerStoryArgs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,QAAA,MAAM,cAAc,sEAAuE,CAAC;AAE5F,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,YAAY,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9C,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,eAMjC,CAAC;AAMF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,eAAe,CAMzD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;CAGf,CAAC;AAErB,eAAO,MAAM,wBAAwB;;;;;;;;;;CAIjB,CAAC;AAErB,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,YAAY,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;CACtC;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,eAAe,CAAC,GAAG,iBAAiB,CAQ7H;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,iBAAiB,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;;;;;;EAEvG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated placeholder pictures for stories that need an image and must not ship an asset:
|
|
3
|
+
* a tinted rectangle with a label, as an SVG data URL.
|
|
4
|
+
*/
|
|
5
|
+
export declare function sampleImage(label: string, fill: string, width?: number, height?: number): string;
|
|
6
|
+
export declare const SAMPLE_IMAGES: {
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
filename: string;
|
|
10
|
+
}[];
|
|
11
|
+
//# sourceMappingURL=sampleImages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleImages.d.ts","sourceRoot":"","sources":["../../../src/storybook/sampleImages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,SAAM,EAAE,MAAM,SAAM,GAAG,MAAM,CAO1F;AAED,eAAO,MAAM,aAAa;;;;GAKzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Domain-neutral rows for the table stories. */
|
|
2
|
+
export interface ProjectRow {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
stage: string;
|
|
7
|
+
budget: number;
|
|
8
|
+
updated: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PROJECT_ROWS: ProjectRow[];
|
|
11
|
+
export declare const formatBudget: (budget: number) => string;
|
|
12
|
+
//# sourceMappingURL=sampleRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleRows.d.ts","sourceRoot":"","sources":["../../../src/storybook/sampleRows.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,EAAE,UAAU,EAapC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,WAA4C,CAAC"}
|
|
@@ -10,7 +10,7 @@ export declare function propsToJsx(componentName: string, props: Record<string,
|
|
|
10
10
|
* (the same function the story's `render` uses), `componentDefaults` lists prop values the
|
|
11
11
|
* component already assumes, so they are left out of the snippet.
|
|
12
12
|
*/
|
|
13
|
-
export declare function storySource(componentName: string, mapArgs: (args:
|
|
13
|
+
export declare function storySource<A = Record<string, unknown>>(componentName: string, mapArgs: (args: A) => object, componentDefaults?: Record<string, unknown>): {
|
|
14
14
|
docs: {
|
|
15
15
|
source: {
|
|
16
16
|
transform: (_code: string, storyContext: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storySource.d.ts","sourceRoot":"","sources":["../../../src/storybook/storySource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAUxF;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"storySource.d.ts","sourceRoot":"","sources":["../../../src/storybook/storySource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wCAAwC;AACxC,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAUxF;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtD,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC5B,iBAAiB,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;;;+BAKzB,MAAM,gBAAgB;gBAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;aAAE;;;EAW7E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies a set of CSS custom-property overrides directly on `document.documentElement`, not on a
|
|
3
|
+
* wrapper element - a story like ColorPalette.stories.tsx reads `getComputedStyle(document.documentElement)`
|
|
4
|
+
* itself rather than its own ancestor chain, so a wrapper override would never reach it. Reverts
|
|
5
|
+
* cleanly when `overrides` changes or the caller unmounts, so no story is ever left with stale
|
|
6
|
+
* overrides from a previously selected value.
|
|
7
|
+
*
|
|
8
|
+
* The bookkeeping (who holds which variable, what to restore) lives in cssVarOverrideStore and is
|
|
9
|
+
* shared by every instance on the page: see that file for the docs-page case it exists for.
|
|
10
|
+
*
|
|
11
|
+
* Uses `useLayoutEffect`, not `useEffect`: a story that resolves a token via `getComputedStyle` in its
|
|
12
|
+
* own passive effect (ColorPalette.stories.tsx) would otherwise read the DOM before this ancestor's
|
|
13
|
+
* effect applied the new overrides - React runs all layout effects to completion before any passive
|
|
14
|
+
* effect starts, so this ordering guarantee only holds with `useLayoutEffect` here.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCssVarOverride(overrides: Record<string, string>): void;
|
|
17
|
+
//# sourceMappingURL=useCssVarOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCssVarOverride.d.ts","sourceRoot":"","sources":["../../../src/storybook/useCssVarOverride.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAEzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssVarOverrideStore.test.d.ts","sourceRoot":"","sources":["../../../test/storybook/cssVarOverrideStore.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupLayoutStoryArgs.test.d.ts","sourceRoot":"","sources":["../../../test/storybook/groupLayoutStoryArgs.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cwellt_software/cwellt-reactjs-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -19,13 +19,17 @@
|
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"dev": "vite",
|
|
22
|
+
"storybook": "storybook dev -p 6006",
|
|
23
|
+
"build-storybook": "storybook build",
|
|
22
24
|
"start": "rollup -c --watch",
|
|
23
25
|
"test": "vitest run",
|
|
24
26
|
"lint": "eslint **/*.{ts,tsx} --fix",
|
|
25
|
-
"build": "npm run lint && npm test && rollup -c",
|
|
26
|
-
"release": "rollup -c",
|
|
27
|
+
"build": "npm run lint && npm test && rollup -c && npm run tokens:check",
|
|
28
|
+
"release": "rollup -c && npm run tokens:check",
|
|
27
29
|
"link": "npm link",
|
|
28
30
|
"build:quick": "rollup -c",
|
|
31
|
+
"tokens:check": "node scripts/token-parity.mjs --check",
|
|
32
|
+
"tokens:baseline": "node scripts/token-parity.mjs --write-baseline",
|
|
29
33
|
"publish:npm": "npm install && npm run build && npm pack --dry-run && npm publish --access public"
|
|
30
34
|
},
|
|
31
35
|
"peerDependencies": {
|
|
@@ -34,6 +38,8 @@
|
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"@rollup/plugin-typescript": "12.3.0",
|
|
41
|
+
"@storybook/addon-docs": "10.6.0",
|
|
42
|
+
"@storybook/react-vite": "10.6.0",
|
|
37
43
|
"@testing-library/jest-dom": "^6.6.3",
|
|
38
44
|
"@testing-library/react": "^16.1.0",
|
|
39
45
|
"@types/eslint__js": "^8.42.3",
|
|
@@ -47,6 +53,7 @@
|
|
|
47
53
|
"@vitejs/plugin-react": "^5.0.4",
|
|
48
54
|
"cssnano": "^7.1.4",
|
|
49
55
|
"csstype": "^3.2.3",
|
|
56
|
+
"culori": "^4.0.2",
|
|
50
57
|
"eslint": "^9.14.0",
|
|
51
58
|
"eslint-plugin-react": "^7.37.2",
|
|
52
59
|
"globals": "^15.12.0",
|
|
@@ -56,6 +63,7 @@
|
|
|
56
63
|
"postcss-url": "^10.1.3",
|
|
57
64
|
"rollup": "^4.26.0",
|
|
58
65
|
"rollup-plugin-dts": "^6.2.3",
|
|
66
|
+
"storybook": "10.6.0",
|
|
59
67
|
"stylelint": "^16.10.0",
|
|
60
68
|
"stylelint-config-standard": "^36.0.1",
|
|
61
69
|
"temporal-polyfill": "^0.3.2",
|