@digigov/react-experimental 2.0.0-8de46296 → 2.0.0-96651090

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.
Files changed (56) hide show
  1. package/FloatingButton/index.d.ts +1 -1
  2. package/FloatingButton/index.js +15 -23
  3. package/Kitchensink/AllComponents.d.ts +2 -0
  4. package/Kitchensink/AllComponents.js +7 -0
  5. package/Kitchensink/KitchensinkByCategory.d.ts +6 -0
  6. package/Kitchensink/KitchensinkByCategory.js +25 -0
  7. package/Kitchensink/KitchensinkByLetter.d.ts +6 -0
  8. package/Kitchensink/KitchensinkByLetter.js +14 -0
  9. package/Kitchensink/KitchensinkComponent.d.ts +10 -0
  10. package/Kitchensink/KitchensinkComponent.js +29 -0
  11. package/Kitchensink/KitchensinkDashboard.d.ts +5 -0
  12. package/Kitchensink/KitchensinkDashboard.js +28 -0
  13. package/Kitchensink/index.d.ts +5 -0
  14. package/Kitchensink/index.js +5 -0
  15. package/OptionButtonBase/index.d.ts +5 -5
  16. package/OptionButtonBase/index.js +16 -23
  17. package/OptionButtonSteps/index.d.ts +10 -10
  18. package/OptionButtonSteps/index.js +21 -30
  19. package/index.d.ts +4 -3
  20. package/index.js +5 -4
  21. package/package.json +11 -13
  22. package/src/FloatingButton/__snapshots__/index.test.tsx.snap +37 -0
  23. package/src/FloatingButton/index.test.tsx +11 -5
  24. package/src/FloatingButton/index.tsx +1 -1
  25. package/src/Kitchensink/AllComponents.tsx +7 -0
  26. package/src/Kitchensink/KitchensinkByCategory.tsx +54 -0
  27. package/src/Kitchensink/KitchensinkByLetter.tsx +35 -0
  28. package/src/Kitchensink/KitchensinkComponent.tsx +70 -0
  29. package/src/Kitchensink/KitchensinkDashboard.tsx +56 -0
  30. package/src/Kitchensink/index.ts +5 -0
  31. package/src/OptionButtonBase/__snapshots__/index.test.tsx.snap +37 -0
  32. package/src/OptionButtonBase/index.test.tsx +11 -5
  33. package/src/OptionButtonBase/index.tsx +8 -9
  34. package/src/OptionButtonSteps/__snapshots__/index.test.tsx.snap +84 -0
  35. package/src/OptionButtonSteps/index.test.tsx +21 -7
  36. package/src/OptionButtonSteps/index.tsx +10 -11
  37. package/src/index.ts +1 -0
  38. package/FloatingButton/index.test/index.js +0 -19
  39. package/FloatingButton/index.test/package.json +0 -6
  40. package/FloatingButton/index.test.d.ts +0 -1
  41. package/FloatingButton/package.json +0 -6
  42. package/OptionButtonBase/index.test/index.js +0 -19
  43. package/OptionButtonBase/index.test/package.json +0 -6
  44. package/OptionButtonBase/index.test.d.ts +0 -1
  45. package/OptionButtonBase/package.json +0 -6
  46. package/OptionButtonSteps/index.test/index.js +0 -32
  47. package/OptionButtonSteps/index.test/package.json +0 -6
  48. package/OptionButtonSteps/index.test.d.ts +0 -1
  49. package/OptionButtonSteps/package.json +0 -6
  50. package/cjs/FloatingButton/index.js +0 -31
  51. package/cjs/FloatingButton/index.test/index.js +0 -22
  52. package/cjs/OptionButtonBase/index.js +0 -31
  53. package/cjs/OptionButtonBase/index.test/index.js +0 -22
  54. package/cjs/OptionButtonSteps/index.js +0 -38
  55. package/cjs/OptionButtonSteps/index.test/index.js +0 -35
  56. package/cjs/index.js +0 -38
@@ -17,5 +17,5 @@ export interface FloatingButtonProps extends ButtonProps {
17
17
  * Use it primary in mobile applications.
18
18
  * Avoid using text in this type of button, use icons instead.
19
19
  */
20
- export declare const FloatingButton: React.ForwardRefExoticComponent<Pick<FloatingButtonProps, "form" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "direction" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "variant" | "dense"> & React.RefAttributes<HTMLButtonElement>>;
20
+ export declare const FloatingButton: React.ForwardRefExoticComponent<Omit<FloatingButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
21
21
  export default FloatingButton;
@@ -1,24 +1,16 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["direction", "className", "children"];
4
- import React from 'react';
5
- import clsx from 'clsx';
6
- import Button from '@digigov/react-core/Button';
7
- /**
8
- *
9
- * A FloatingButton performs the primary, or most common, action on a screen.
10
- * Use it primary in mobile applications.
11
- * Avoid using text in this type of button, use icons instead.
12
- */
13
- export var FloatingButton = /*#__PURE__*/React.forwardRef(function FloatingButton(_ref, ref) {
14
- var _ref$direction = _ref.direction,
15
- direction = _ref$direction === void 0 ? 'right' : _ref$direction,
16
- className = _ref.className,
17
- children = _ref.children,
18
- props = _objectWithoutProperties(_ref, _excluded);
19
- return /*#__PURE__*/React.createElement(Button, _extends({
20
- ref: ref,
21
- className: clsx(className, direction === 'right' && 'ds-floating-btn--right', direction === 'left' && 'ds-floating-btn--left', true && 'ds-floating-btn')
22
- }, props), children);
1
+ import react from "react";
2
+ import clsx from "clsx";
3
+ import Button from "@digigov/react-core/Button/index.js";
4
+ const FloatingButton_FloatingButton = /*#__PURE__*/ react.forwardRef(function({ direction = 'right', className, children, ...props }, ref) {
5
+ return /*#__PURE__*/ react.createElement(Button, {
6
+ ref: ref,
7
+ className: clsx(className, {
8
+ 'ds-floating-btn': true,
9
+ 'ds-floating-btn--right': 'right' === direction,
10
+ 'ds-floating-btn--left': 'left' === direction
11
+ }),
12
+ ...props
13
+ }, children);
23
14
  });
24
- export default FloatingButton;
15
+ const src_FloatingButton = FloatingButton_FloatingButton;
16
+ export { FloatingButton_FloatingButton as FloatingButton, src_FloatingButton as default };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AllComponents: () => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import react from "react";
2
+ import { KitchenSinkDashboard } from "./KitchensinkDashboard.js";
3
+ import { stories } from "@digigov/ui/stories-registry";
4
+ const AllComponents = ()=>/*#__PURE__*/ react.createElement(KitchenSinkDashboard, {
5
+ stories: stories
6
+ });
7
+ export { AllComponents };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface KitchensinkByCategoryInterface {
3
+ category: string;
4
+ stories: React.ReactElement[];
5
+ }
6
+ export declare const KitchensinkByCategory: ({ category, stories, }: KitchensinkByCategoryInterface) => React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import react from "react";
2
+ import { KitchenSinkCategory } from "@digigov/react-core/KitchenSinkCategory/index.js";
3
+ import { KitchenSinkHeading } from "@digigov/react-core/KitchenSinkHeading/index.js";
4
+ import { KitchensinkByLetter } from "./KitchensinkByLetter.js";
5
+ const KitchensinkByCategory = ({ category, stories })=>{
6
+ const alphabeticalOrder = Object.keys(stories).reduce((abStories, componentStoriesKey)=>{
7
+ const componentStories = stories[componentStoriesKey];
8
+ if (!componentStories.default.component) throw new Error(`no component was found in ${componentStoriesKey}`);
9
+ const name = componentStories.default.displayName;
10
+ console.log('componentStories', componentStories, 'stories', stories);
11
+ if (!name) throw new Error(`no name was found for ${componentStoriesKey}`);
12
+ const letter = name[0];
13
+ if (abStories[letter]) abStories[letter].push(componentStories);
14
+ else abStories[letter] = [
15
+ componentStories
16
+ ];
17
+ return abStories;
18
+ }, {});
19
+ return /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement(KitchenSinkHeading, null, category), /*#__PURE__*/ react.createElement(KitchenSinkCategory, null, Object.keys(alphabeticalOrder).sort().map((letter, index)=>/*#__PURE__*/ react.createElement(KitchensinkByLetter, {
20
+ letter: letter,
21
+ stories: alphabeticalOrder[letter],
22
+ key: index
23
+ }))));
24
+ };
25
+ export { KitchensinkByCategory };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface KitchensinkByLetterInterface {
3
+ letter: string;
4
+ stories: any;
5
+ }
6
+ export declare const KitchensinkByLetter: ({ letter, stories, }: KitchensinkByLetterInterface) => React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import react from "react";
2
+ import Heading from "@digigov/react-core/Heading/index.js";
3
+ import { KitchenSinkLetterContent } from "@digigov/react-core/KitchenSinkLetterContent/index.js";
4
+ import { KitchensinkComponent } from "./KitchensinkComponent.js";
5
+ const KitchensinkByLetter = ({ letter, stories })=>/*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement(Heading, null, letter), /*#__PURE__*/ react.createElement(KitchenSinkLetterContent, null, stories.map((story, index)=>/*#__PURE__*/ react.createElement(KitchensinkComponent, {
6
+ tags: story.default.tags,
7
+ title: story.default.displayName,
8
+ description: story.default.description,
9
+ link: story.default.link,
10
+ width: story.default.defaultWidth,
11
+ stories: story,
12
+ key: index
13
+ }))));
14
+ export { KitchensinkByLetter };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface KitchensinkComponentInterface {
3
+ tags?: string[];
4
+ title: string;
5
+ description?: string;
6
+ link?: string;
7
+ stories: React.ReactElement[];
8
+ width?: 'md' | 'lg';
9
+ }
10
+ export declare const KitchensinkComponent: ({ tags, title, description, link, stories, width, }: KitchensinkComponentInterface) => React.JSX.Element;
@@ -0,0 +1,29 @@
1
+ import react from "react";
2
+ import { KitchenSinkCard } from "@digigov/react-core/KitchenSinkCard/index.js";
3
+ import { KitchenSinkContent } from "@digigov/react-core/KitchenSinkContent/index.js";
4
+ import { KitchenSinkContentInfo } from "@digigov/react-core/KitchenSinkContentInfo/index.js";
5
+ import { KitchenSinkContentTags } from "@digigov/react-core/KitchenSinkContentTags/index.js";
6
+ import PhaseBanner, { PhaseBannerTag, PhaseBannerText } from "@digigov/ui/feedback/PhaseBanner/index.js";
7
+ import SectionBreak from "@digigov/ui/layouts/SectionBreak/index.js";
8
+ import Link from "@digigov/ui/navigation/Link/index.js";
9
+ import { Paragraph } from "@digigov/ui/typography/index.js";
10
+ import Heading from "@digigov/ui/typography/Heading/index.js";
11
+ const KitchensinkComponent = ({ tags = [], title, description, link, stories, width = 'md' })=>/*#__PURE__*/ react.createElement(KitchenSinkContent, {
12
+ wide: 'lg' === width
13
+ }, /*#__PURE__*/ react.createElement(KitchenSinkContentInfo, null, /*#__PURE__*/ react.createElement(KitchenSinkContentTags, null, tags && tags.map((tag, index)=>/*#__PURE__*/ react.createElement(PhaseBanner, {
14
+ key: index
15
+ }, /*#__PURE__*/ react.createElement(PhaseBannerTag, null, tag), /*#__PURE__*/ react.createElement(PhaseBannerText, null, "Αυτή είναι μία νέα υπηρεσία – τα", ' ', /*#__PURE__*/ react.createElement(Link, {
16
+ href: "#feedback"
17
+ }, "σχόλιά"), " σας θα μας βοηθήσουν να τη βελτιώσουμε.")))), /*#__PURE__*/ react.createElement(Heading, {
18
+ size: "lg"
19
+ }, title), /*#__PURE__*/ react.createElement(Paragraph, null, description), link && /*#__PURE__*/ react.createElement(Link, {
20
+ href: link
21
+ }, "View on GOV.GR Design System"), /*#__PURE__*/ react.createElement(SectionBreak, null)), Object.keys(stories).filter((story)=>'default' !== story).map((story, index)=>{
22
+ const Component = stories[story];
23
+ return /*#__PURE__*/ react.createElement("div", {
24
+ key: index
25
+ }, /*#__PURE__*/ react.createElement(SectionBreak, null), /*#__PURE__*/ react.createElement(Heading, {
26
+ size: "sm"
27
+ }, story), /*#__PURE__*/ react.createElement(KitchenSinkCard, null, /*#__PURE__*/ react.createElement(Component, null)));
28
+ }));
29
+ export { KitchensinkComponent };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface KitchenSinkDashboardInterface {
3
+ stories: any;
4
+ }
5
+ export declare const KitchenSinkDashboard: ({ stories, }: KitchenSinkDashboardInterface) => React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ import react from "react";
2
+ import { KitchenSinkAllComponents } from "@digigov/react-core/KitchenSinkAllComponents/index.js";
3
+ import Paragraph from "@digigov/react-core/Paragraph/index.js";
4
+ import { KitchensinkByCategory } from "./KitchensinkByCategory.js";
5
+ const KitchenSinkDashboard = ({ stories })=>{
6
+ const categoryOrder = Object.keys(stories).reduce((catStories, componentStoriesKey)=>{
7
+ const componentStories = stories[componentStoriesKey];
8
+ if (componentStories.default.ignore) return catStories;
9
+ if (!componentStories.default.component) throw new Error(`no component was found in ${componentStoriesKey}`);
10
+ const title = componentStories.default.title.split('/')[1];
11
+ if (!title) throw new Error(`no title was found for ${componentStoriesKey}`);
12
+ const category = title;
13
+ if (catStories[category]) catStories[category].push(componentStories);
14
+ else catStories[category] = [
15
+ componentStories
16
+ ];
17
+ return catStories;
18
+ }, {});
19
+ return /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement(Paragraph, {
20
+ fontSize: 72,
21
+ fontWeight: "bold"
22
+ }, "Components"), /*#__PURE__*/ react.createElement(KitchenSinkAllComponents, null, Object.keys(categoryOrder).sort((a, b)=>a > b ? -1 : 1).map((category, index)=>/*#__PURE__*/ react.createElement(KitchensinkByCategory, {
23
+ category: category,
24
+ stories: categoryOrder[category],
25
+ key: index
26
+ }))));
27
+ };
28
+ export { KitchenSinkDashboard };
@@ -0,0 +1,5 @@
1
+ export * from './AllComponents.js';
2
+ export * from './KitchensinkByCategory.js';
3
+ export * from './KitchensinkByLetter.js';
4
+ export * from './KitchensinkComponent.js';
5
+ export * from './KitchensinkDashboard.js';
@@ -0,0 +1,5 @@
1
+ export * from "./AllComponents.js";
2
+ export * from "./KitchensinkByCategory.js";
3
+ export * from "./KitchensinkByLetter.js";
4
+ export * from "./KitchensinkComponent.js";
5
+ export * from "./KitchensinkDashboard.js";
@@ -4,10 +4,10 @@ export interface OptionButtonBaseProps extends BaseProps<'button'> {
4
4
  /**
5
5
  * selected is optional.
6
6
  * Use selected prop to set selected styling.
7
- * @value true
8
- * @value false
9
- * @default false
10
- */
7
+ * @value true
8
+ * @value false
9
+ * @default false
10
+ */
11
11
  selected?: boolean;
12
12
  }
13
13
  /**
@@ -15,5 +15,5 @@ export interface OptionButtonBaseProps extends BaseProps<'button'> {
15
15
  * OptionButtonBases can be used to represent small blocks of information.
16
16
  * OptionButtonBase component must be inside OptionButtonBaseSection component.
17
17
  */
18
- export declare const OptionButtonBase: React.ForwardRefExoticComponent<Pick<OptionButtonBaseProps, "form" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "name" | "type" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "selected" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden"> & React.RefAttributes<HTMLButtonElement>>;
18
+ export declare const OptionButtonBase: React.ForwardRefExoticComponent<Omit<OptionButtonBaseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
19
19
  export default OptionButtonBase;
@@ -1,24 +1,17 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["selected", "className", "children"];
4
- import React from 'react';
5
- import clsx from 'clsx';
6
- import Base from '@digigov/react-core/Base';
7
- /**
8
- *
9
- * OptionButtonBases can be used to represent small blocks of information.
10
- * OptionButtonBase component must be inside OptionButtonBaseSection component.
11
- */
12
- export var OptionButtonBase = /*#__PURE__*/React.forwardRef(function OptionButtonBase(_ref, ref) {
13
- var _ref$selected = _ref.selected,
14
- selected = _ref$selected === void 0 ? false : _ref$selected,
15
- className = _ref.className,
16
- children = _ref.children,
17
- props = _objectWithoutProperties(_ref, _excluded);
18
- return /*#__PURE__*/React.createElement(Base, _extends({
19
- as: "button",
20
- ref: ref,
21
- className: clsx(className, selected && 'ds-option-btn--selected', true && ['ds-btn', 'ds-option-btn'])
22
- }, props), children);
1
+ import react from "react";
2
+ import clsx from "clsx";
3
+ import Base from "@digigov/react-core/Base/index.js";
4
+ const OptionButtonBase_OptionButtonBase = /*#__PURE__*/ react.forwardRef(function({ selected = false, className, children, ...props }, ref) {
5
+ return /*#__PURE__*/ react.createElement(Base, {
6
+ as: "button",
7
+ ref: ref,
8
+ className: clsx(className, {
9
+ 'ds-btn': true,
10
+ 'ds-option-btn': true,
11
+ 'ds-option-btn--selected': selected
12
+ }),
13
+ ...props
14
+ }, children);
23
15
  });
24
- export default OptionButtonBase;
16
+ const src_OptionButtonBase = OptionButtonBase_OptionButtonBase;
17
+ export { OptionButtonBase_OptionButtonBase as OptionButtonBase, src_OptionButtonBase as default };
@@ -2,17 +2,17 @@ import React from 'react';
2
2
  import { BaseProps } from '@digigov/react-core/Base';
3
3
  export interface OptionButtonStepsProps extends BaseProps<'div'> {
4
4
  /**
5
- * @value 0
6
- * @value 1
7
- * @value 2
8
- * @value 3
9
- * @value 4
10
- * @default 0
11
- */
5
+ * @value 0
6
+ * @value 1
7
+ * @value 2
8
+ * @value 3
9
+ * @value 4
10
+ * @default 0
11
+ */
12
12
  steps?: stepsProps;
13
13
  /**
14
- * @default 0
15
- */
14
+ * @default 0
15
+ */
16
16
  activeStep?: number;
17
17
  }
18
18
  export type stepsProps = 0 | 1 | 2 | 3 | 4;
@@ -21,5 +21,5 @@ export type stepsProps = 0 | 1 | 2 | 3 | 4;
21
21
  * OptionButtonSteps can be used to represent small blocks of information.
22
22
  * OptionButtonSteps component must be inside OptionButtonStepsSection component.
23
23
  */
24
- export declare const OptionButtonSteps: React.ForwardRefExoticComponent<Pick<OptionButtonStepsProps, "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "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-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "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" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "steps" | "activeStep"> & React.RefAttributes<HTMLDivElement>>;
24
+ export declare const OptionButtonSteps: React.ForwardRefExoticComponent<Omit<OptionButtonStepsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
25
  export default OptionButtonSteps;
@@ -1,31 +1,22 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["steps", "activeStep", "className"];
4
- import React from 'react';
5
- import clsx from 'clsx';
6
- import Base from '@digigov/react-core/Base';
7
- /**
8
- *
9
- * OptionButtonSteps can be used to represent small blocks of information.
10
- * OptionButtonSteps component must be inside OptionButtonStepsSection component.
11
- */
12
- export var OptionButtonSteps = /*#__PURE__*/React.forwardRef(function OptionButtonSteps(_ref, ref) {
13
- var _ref$steps = _ref.steps,
14
- steps = _ref$steps === void 0 ? 0 : _ref$steps,
15
- _ref$activeStep = _ref.activeStep,
16
- activeStep = _ref$activeStep === void 0 ? 0 : _ref$activeStep,
17
- className = _ref.className,
18
- props = _objectWithoutProperties(_ref, _excluded);
19
- var renderStep = function renderStep(step) {
20
- return /*#__PURE__*/React.createElement(Base, {
21
- as: "div",
22
- className: clsx(className, activeStep >= step && 'ds-option-btn__step--active', true && 'ds-option-btn__step')
23
- });
24
- };
25
- return /*#__PURE__*/React.createElement(Base, _extends({
26
- as: "div",
27
- ref: ref,
28
- className: clsx(className, true && 'ds-option-btn__steps')
29
- }, props), steps >= 1 && renderStep(1), steps >= 2 && renderStep(2), steps >= 3 && renderStep(3), steps >= 4 && renderStep(4));
1
+ import react from "react";
2
+ import clsx from "clsx";
3
+ import Base from "@digigov/react-core/Base/index.js";
4
+ const OptionButtonSteps_OptionButtonSteps = /*#__PURE__*/ react.forwardRef(function({ steps = 0, activeStep = 0, className, ...props }, ref) {
5
+ const renderStep = (step)=>/*#__PURE__*/ react.createElement(Base, {
6
+ as: "div",
7
+ className: clsx(className, {
8
+ 'ds-option-btn__step': true,
9
+ 'ds-option-btn__step--active': activeStep >= step
10
+ })
11
+ });
12
+ return /*#__PURE__*/ react.createElement(Base, {
13
+ as: "div",
14
+ ref: ref,
15
+ className: clsx(className, {
16
+ 'ds-option-btn__steps': true
17
+ }),
18
+ ...props
19
+ }, steps >= 1 && renderStep(1), steps >= 2 && renderStep(2), steps >= 3 && renderStep(3), steps >= 4 && renderStep(4));
30
20
  });
31
- export default OptionButtonSteps;
21
+ const src_OptionButtonSteps = OptionButtonSteps_OptionButtonSteps;
22
+ export { OptionButtonSteps_OptionButtonSteps as OptionButtonSteps, src_OptionButtonSteps as default };
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from '@digigov/react-experimental/FloatingButton';
2
- export * from '@digigov/react-experimental/OptionButtonBase';
3
- export * from '@digigov/react-experimental/OptionButtonSteps';
1
+ export * from './FloatingButton/index.js';
2
+ export * from './OptionButtonBase/index.js';
3
+ export * from './OptionButtonSteps/index.js';
4
+ export * from './Kitchensink/index.js';
package/index.js CHANGED
@@ -1,8 +1,9 @@
1
- /** @license Digigov v2.0.0-8de46296
1
+ /** @license Digigov v2.0.0-96651090
2
2
  *
3
3
  * This source code is licensed under the BSD-2-Clause license found in the
4
4
  * LICENSE file in the root directory of this source tree.
5
5
  */
6
- export * from '@digigov/react-experimental/FloatingButton';
7
- export * from '@digigov/react-experimental/OptionButtonBase';
8
- export * from '@digigov/react-experimental/OptionButtonSteps';
6
+ export * from "./FloatingButton/index.js";
7
+ export * from "./OptionButtonBase/index.js";
8
+ export * from "./OptionButtonSteps/index.js";
9
+ export * from "./Kitchensink/index.js";
package/package.json CHANGED
@@ -1,22 +1,20 @@
1
1
  {
2
2
  "name": "@digigov/react-experimental",
3
- "version": "2.0.0-8de46296",
3
+ "version": "2.0.0-96651090",
4
4
  "description": "@digigov react experimental components",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
7
- "main": "./cjs/index.js",
8
- "module": "./index.js",
7
+ "type": "module",
9
8
  "peerDependencies": {
10
- "@digigov/css": "2.0.0-8de46296",
11
- "@digigov/react-experimental": "2.0.0-8de46296",
12
- "@digigov/react-icons": "2.0.0-8de46296",
13
- "clsx": "1.1.1",
14
- "react": "^16.8.0 || ^17.0.0",
15
- "react-dom": "^16.8.0 || ^17.0.0"
16
- },
17
- "dependencies": {
18
- "ts-morph": "18.0.0"
9
+ "@digigov/css": "2.0.0-96651090",
10
+ "@digigov/react-icons": "2.0.0-96651090",
11
+ "@digigov/ui": "2.0.0-96651090",
12
+ "@digigov/react-core": "2.0.0-96651090",
13
+ "clsx": "2.1.1",
14
+ "react": "^18.3.0 || ^19.1.0",
15
+ "react-dom": "^18.3.0 || ^19.1.0"
19
16
  },
20
17
  "private": false,
21
- "typings": "./index.d.ts"
18
+ "main": "index.js",
19
+ "module": "index.js"
22
20
  }
@@ -0,0 +1,37 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`renders the FloatingButton with direction="left" 1`] = `
4
+ <body>
5
+ <div>
6
+ <button
7
+ class="ds-print-hidden ds-floating-btn ds-floating-btn--left ds-btn ds-btn-primary"
8
+ >
9
+ +
10
+ </button>
11
+ </div>
12
+ </body>
13
+ `;
14
+
15
+ exports[`renders the FloatingButton with direction="right" 1`] = `
16
+ <body>
17
+ <div>
18
+ <button
19
+ class="ds-print-hidden ds-floating-btn ds-floating-btn--right ds-btn ds-btn-primary"
20
+ >
21
+ +
22
+ </button>
23
+ </div>
24
+ </body>
25
+ `;
26
+
27
+ exports[`renders the FloatingButton with no props 1`] = `
28
+ <body>
29
+ <div>
30
+ <button
31
+ class="ds-print-hidden ds-floating-btn ds-floating-btn--right ds-btn ds-btn-primary"
32
+ >
33
+ +
34
+ </button>
35
+ </div>
36
+ </body>
37
+ `;
@@ -1,14 +1,20 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
 
4
4
  import FloatingButton from '@digigov/react-experimental/FloatingButton';
5
5
 
6
6
  it('renders the FloatingButton with no props', () => {
7
- expect(mount(<FloatingButton>+</FloatingButton>)).toMatchSnapshot();
7
+ expect(
8
+ render(<FloatingButton>+</FloatingButton>).baseElement
9
+ ).toMatchSnapshot();
8
10
  });
9
11
  it('renders the FloatingButton with direction="right"', () => {
10
- expect(mount(<FloatingButton direction="right">+</FloatingButton>)).toMatchSnapshot();
12
+ expect(
13
+ render(<FloatingButton direction="right">+</FloatingButton>).baseElement
14
+ ).toMatchSnapshot();
11
15
  });
12
16
  it('renders the FloatingButton with direction="left"', () => {
13
- expect(mount(<FloatingButton direction="left">+</FloatingButton>)).toMatchSnapshot();
14
- });
17
+ expect(
18
+ render(<FloatingButton direction="left">+</FloatingButton>).baseElement
19
+ ).toMatchSnapshot();
20
+ });
@@ -41,4 +41,4 @@ export const FloatingButton = React.forwardRef<
41
41
  );
42
42
  });
43
43
 
44
- export default FloatingButton;
44
+ export default FloatingButton;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ import { KitchenSinkDashboard } from '@digigov/react-experimental/Kitchensink/KitchensinkDashboard';
4
+ // @ts-expect-error Registry not included in src files
5
+ import { stories } from '@digigov/ui/stories-registry';
6
+
7
+ export const AllComponents = () => <KitchenSinkDashboard stories={stories} />;
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import { KitchenSinkCategory } from '@digigov/react-core/KitchenSinkCategory';
3
+ import { KitchenSinkHeading } from '@digigov/react-core/KitchenSinkHeading';
4
+ import { KitchensinkByLetter } from '@digigov/react-experimental/Kitchensink/KitchensinkByLetter';
5
+
6
+ export interface KitchensinkByCategoryInterface {
7
+ category: string;
8
+ stories: React.ReactElement[];
9
+ }
10
+
11
+ export const KitchensinkByCategory = ({
12
+ category,
13
+ stories,
14
+ }: KitchensinkByCategoryInterface) => {
15
+ const alphabeticalOrder = Object.keys(stories).reduce(
16
+ (abStories, componentStoriesKey) => {
17
+ const componentStories = stories[componentStoriesKey];
18
+ if (!componentStories.default.component) {
19
+ throw new Error(`no component was found in ${componentStoriesKey}`);
20
+ }
21
+ const name = componentStories.default.displayName;
22
+ console.log('componentStories', componentStories, 'stories', stories);
23
+ if (!name) {
24
+ throw new Error(`no name was found for ${componentStoriesKey}`);
25
+ }
26
+ const letter = name[0];
27
+ if (abStories[letter]) {
28
+ abStories[letter].push(componentStories);
29
+ } else {
30
+ abStories[letter] = [componentStories];
31
+ }
32
+ return abStories;
33
+ },
34
+ {}
35
+ );
36
+ return (
37
+ <div>
38
+ <KitchenSinkHeading>{category}</KitchenSinkHeading>
39
+ <KitchenSinkCategory>
40
+ {Object.keys(alphabeticalOrder)
41
+ .sort()
42
+ .map((letter, index) => {
43
+ return (
44
+ <KitchensinkByLetter
45
+ letter={letter}
46
+ stories={alphabeticalOrder[letter]}
47
+ key={index}
48
+ />
49
+ );
50
+ })}
51
+ </KitchenSinkCategory>
52
+ </div>
53
+ );
54
+ };