@lumx/react 3.20.1-alpha.27 → 3.20.1-alpha.28
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/_internal/{Button-2b55a913.js → Button-5a87fee9.js} +5 -5
- package/_internal/{Button-2b55a913.js.map → Button-5a87fee9.js.map} +1 -1
- package/_internal/{ButtonRoot-823f3e9c.js → ButtonRoot-bf682215.js} +2 -2
- package/_internal/{ButtonRoot-823f3e9c.js.map → ButtonRoot-bf682215.js.map} +1 -1
- package/_internal/{Chip-e1e85810.js → Chip-8d0aae06.js} +2 -2
- package/_internal/{Chip-e1e85810.js.map → Chip-8d0aae06.js.map} +1 -1
- package/_internal/{IconButton-be160cb0.js → IconButton-351389b0.js} +5 -5
- package/_internal/{IconButton-be160cb0.js.map → IconButton-351389b0.js.map} +1 -1
- package/_internal/{ImageCaption-fcf5720c.js → ImageCaption-4109b433.js} +4 -4
- package/_internal/{ImageCaption-fcf5720c.js.map → ImageCaption-4109b433.js.map} +1 -1
- package/_internal/{List-dbf4297f.js → List-b7882a99.js} +241 -215
- package/_internal/{List-dbf4297f.js.map → List-b7882a99.js.map} +1 -1
- package/_internal/{PopoverDialog-193a0918.js → PopoverDialog-2e7b9ed5.js} +10 -10
- package/_internal/{PopoverDialog-193a0918.js.map → PopoverDialog-2e7b9ed5.js.map} +1 -1
- package/_internal/{Slides-2d267d8c.js → Slides-83646e84.js} +3 -3
- package/_internal/{Slides-2d267d8c.js.map → Slides-83646e84.js.map} +1 -1
- package/_internal/{Thumbnail-0872250e.js → Thumbnail-741501a5.js} +3 -3
- package/_internal/{Thumbnail-0872250e.js.map → Thumbnail-741501a5.js.map} +1 -1
- package/_internal/components/{alert-dialog-a6ed922b.js → alert-dialog-5df4f133.js} +6 -6
- package/_internal/components/{alert-dialog-a6ed922b.js.map → alert-dialog-5df4f133.js.map} +1 -1
- package/_internal/components/{autocomplete-c97b7698.js → autocomplete-824c779e.js} +7 -7
- package/_internal/components/{autocomplete-c97b7698.js.map → autocomplete-824c779e.js.map} +1 -1
- package/_internal/components/{avatar-d2214a61.js → avatar-69b66f01.js} +3 -3
- package/_internal/components/{avatar-d2214a61.js.map → avatar-69b66f01.js.map} +1 -1
- package/_internal/components/{badge-8390e590.js → badge-63cd3b1c.js} +2 -2
- package/_internal/components/{badge-8390e590.js.map → badge-63cd3b1c.js.map} +1 -1
- package/_internal/components/{button-b05f8f0c.js → button-eebd4e00.js} +4 -4
- package/_internal/components/{button-b05f8f0c.js.map → button-eebd4e00.js.map} +1 -1
- package/_internal/components/{checkbox-346834f8.js → checkbox-54943a02.js} +5 -5
- package/_internal/components/{checkbox-346834f8.js.map → checkbox-54943a02.js.map} +1 -1
- package/_internal/components/{chip-e3a6330f.js → chip-9ad6b318.js} +3 -3
- package/_internal/components/{chip-e3a6330f.js.map → chip-9ad6b318.js.map} +1 -1
- package/_internal/components/{comment-block-b1acc69f.js → comment-block-55a4ab3c.js} +4 -4
- package/_internal/components/{comment-block-b1acc69f.js.map → comment-block-55a4ab3c.js.map} +1 -1
- package/_internal/components/date-picker-a824a3ae.js +2 -0
- package/_internal/components/date-picker-a824a3ae.js.map +1 -0
- package/_internal/components/{dialog-785646aa.js → dialog-5e6320b8.js} +4 -4
- package/_internal/components/{dialog-785646aa.js.map → dialog-5e6320b8.js.map} +1 -1
- package/_internal/components/{divider-116af6b9.js → divider-bdf11ba3.js} +2 -2
- package/_internal/components/{divider-116af6b9.js.map → divider-bdf11ba3.js.map} +1 -1
- package/_internal/components/{drag-handle-6b073866.js → drag-handle-45912fd3.js} +3 -3
- package/_internal/components/{drag-handle-6b073866.js.map → drag-handle-45912fd3.js.map} +1 -1
- package/_internal/components/{dropdown-c0c0cfe8.js → dropdown-0216211d.js} +5 -5
- package/_internal/components/{dropdown-c0c0cfe8.js.map → dropdown-0216211d.js.map} +1 -1
- package/_internal/components/{expansion-panel-1de1d1ff.js → expansion-panel-3ce73c6b.js} +4 -4
- package/_internal/components/{expansion-panel-1de1d1ff.js.map → expansion-panel-3ce73c6b.js.map} +1 -1
- package/_internal/components/{flag-7c9d3abf.js → flag-1b177f78.js} +4 -4
- package/_internal/components/{flag-7c9d3abf.js.map → flag-1b177f78.js.map} +1 -1
- package/_internal/components/{flex-box-10423fa5.js → flex-box-93b97715.js} +2 -2
- package/_internal/components/{flex-box-10423fa5.js.map → flex-box-93b97715.js.map} +1 -1
- package/_internal/components/{generic-block-b79f163a.js → generic-block-925f7c5b.js} +3 -3
- package/_internal/components/{generic-block-b79f163a.js.map → generic-block-925f7c5b.js.map} +1 -1
- package/_internal/components/{grid-6f1b5a41.js → grid-95fd1493.js} +2 -2
- package/_internal/components/{grid-6f1b5a41.js.map → grid-95fd1493.js.map} +1 -1
- package/_internal/components/{grid-column-ee504283.js → grid-column-43f28cfb.js} +2 -2
- package/_internal/components/{grid-column-ee504283.js.map → grid-column-43f28cfb.js.map} +1 -1
- package/_internal/components/{heading-d4c66a34.js → heading-45d6e78e.js} +3 -3
- package/_internal/components/{heading-d4c66a34.js.map → heading-45d6e78e.js.map} +1 -1
- package/_internal/components/icon-79195151.js +2 -0
- package/_internal/components/icon-79195151.js.map +1 -0
- package/_internal/components/{image-block-762eb669.js → image-block-aba6d2db.js} +4 -4
- package/_internal/components/{image-block-762eb669.js.map → image-block-aba6d2db.js.map} +1 -1
- package/_internal/components/{image-lightbox-10fef304.js → image-lightbox-8b8e77c2.js} +8 -8
- package/_internal/components/{image-lightbox-10fef304.js.map → image-lightbox-8b8e77c2.js.map} +1 -1
- package/_internal/components/{inline-list-e6f19a98.js → inline-list-dfb9fd34.js} +2 -2
- package/_internal/components/{inline-list-e6f19a98.js.map → inline-list-dfb9fd34.js.map} +1 -1
- package/_internal/components/{input-helper-64153099.js → input-helper-c8a0078b.js} +2 -2
- package/_internal/components/{input-helper-64153099.js.map → input-helper-c8a0078b.js.map} +1 -1
- package/_internal/components/{input-label-2feb0bb0.js → input-label-9711398b.js} +2 -2
- package/_internal/components/{input-label-2feb0bb0.js.map → input-label-9711398b.js.map} +1 -1
- package/_internal/components/{lightbox-dcc9a7a0.js → lightbox-894abe64.js} +4 -4
- package/_internal/components/{lightbox-dcc9a7a0.js.map → lightbox-894abe64.js.map} +1 -1
- package/_internal/components/{link-f9421eab.js → link-e70e64ed.js} +4 -4
- package/_internal/components/{link-f9421eab.js.map → link-e70e64ed.js.map} +1 -1
- package/_internal/components/{link-preview-5c7e3878.js → link-preview-e56f3570.js} +4 -4
- package/_internal/components/{link-preview-5c7e3878.js.map → link-preview-e56f3570.js.map} +1 -1
- package/_internal/components/{list-f29e54b7.js → list-59b7ce56.js} +3 -3
- package/_internal/components/{list-f29e54b7.js.map → list-59b7ce56.js.map} +1 -1
- package/_internal/components/{message-aa3e3f76.js → message-a255dfd3.js} +4 -4
- package/_internal/components/{message-aa3e3f76.js.map → message-a255dfd3.js.map} +1 -1
- package/_internal/components/{mosaic-b4b35fa7.js → mosaic-192f2270.js} +4 -4
- package/_internal/components/mosaic-192f2270.js.map +1 -0
- package/_internal/components/{navigation-8357dbe6.js → navigation-dfe8aac0.js} +7 -7
- package/_internal/components/{navigation-8357dbe6.js.map → navigation-dfe8aac0.js.map} +1 -1
- package/_internal/components/{notification-ec4cf95f.js → notification-10f289b5.js} +4 -4
- package/_internal/components/{notification-ec4cf95f.js.map → notification-10f289b5.js.map} +1 -1
- package/_internal/components/popover-6c7f745b.js +3 -0
- package/_internal/components/popover-6c7f745b.js.map +1 -0
- package/_internal/components/{post-block-bb3d3cbf.js → post-block-f7dcc6e9.js} +4 -4
- package/_internal/components/{post-block-bb3d3cbf.js.map → post-block-f7dcc6e9.js.map} +1 -1
- package/_internal/components/{progress-f39c3fa2.js → progress-7a05fb0c.js} +2 -2
- package/_internal/components/{progress-f39c3fa2.js.map → progress-7a05fb0c.js.map} +1 -1
- package/_internal/components/{progress-tracker-997931ac.js → progress-tracker-48876add.js} +5 -5
- package/_internal/components/{progress-tracker-997931ac.js.map → progress-tracker-48876add.js.map} +1 -1
- package/_internal/components/{radio-button-559a4863.js → radio-button-07cf45e9.js} +4 -4
- package/_internal/components/{radio-button-559a4863.js.map → radio-button-07cf45e9.js.map} +1 -1
- package/_internal/components/{select-8295a416.js → select-8b54a444.js} +9 -9
- package/_internal/components/{select-8295a416.js.map → select-8b54a444.js.map} +1 -1
- package/_internal/components/{side-navigation-40ee8bda.js → side-navigation-7eeed3b4.js} +4 -4
- package/_internal/components/{side-navigation-40ee8bda.js.map → side-navigation-7eeed3b4.js.map} +1 -1
- package/_internal/components/{skeleton-c66516ee.js → skeleton-a4e84085.js} +2 -2
- package/_internal/components/{skeleton-c66516ee.js.map → skeleton-a4e84085.js.map} +1 -1
- package/_internal/components/{slider-efbfbc45.js → slider-5d64b470.js} +4 -4
- package/_internal/components/{slider-efbfbc45.js.map → slider-5d64b470.js.map} +1 -1
- package/_internal/components/{slideshow-c5faf531.js → slideshow-bce65cf6.js} +4 -4
- package/_internal/components/{slideshow-c5faf531.js.map → slideshow-bce65cf6.js.map} +1 -1
- package/_internal/components/{switch-a26a5a72.js → switch-7ae55d89.js} +4 -4
- package/_internal/components/{switch-a26a5a72.js.map → switch-7ae55d89.js.map} +1 -1
- package/_internal/components/{table-c43ec4a5.js → table-5bdf4aec.js} +3 -3
- package/_internal/components/{table-c43ec4a5.js.map → table-5bdf4aec.js.map} +1 -1
- package/_internal/components/{tabs-4037fe57.js → tabs-2ad54592.js} +4 -4
- package/_internal/components/{tabs-4037fe57.js.map → tabs-2ad54592.js.map} +1 -1
- package/_internal/components/text-09c81111.js +2 -0
- package/_internal/components/text-09c81111.js.map +1 -0
- package/_internal/components/{text-field-82adaeb4.js → text-field-3e1030f0.js} +6 -6
- package/_internal/components/{text-field-82adaeb4.js.map → text-field-3e1030f0.js.map} +1 -1
- package/_internal/components/{thumbnail-f1784929.js → thumbnail-1c5828b9.js} +2 -2
- package/_internal/components/{thumbnail-f1784929.js.map → thumbnail-1c5828b9.js.map} +1 -1
- package/_internal/components/{toolbar-a43533a2.js → toolbar-0d14efb7.js} +2 -2
- package/_internal/components/{toolbar-a43533a2.js.map → toolbar-0d14efb7.js.map} +1 -1
- package/_internal/components/{tooltip-aa48ddda.js → tooltip-31181a24.js} +3 -3
- package/_internal/components/{tooltip-aa48ddda.js.map → tooltip-31181a24.js.map} +1 -1
- package/_internal/components/{uploader-7bc3adaa.js → uploader-845b2412.js} +3 -3
- package/_internal/components/{uploader-7bc3adaa.js.map → uploader-845b2412.js.map} +1 -1
- package/_internal/components/{user-block-fc03f01a.js → user-block-91c30797.js} +4 -4
- package/_internal/components/{user-block-fc03f01a.js.map → user-block-91c30797.js.map} +1 -1
- package/_internal/{constants-b9e57936.js → constants-9b714e31.js} +145 -133
- package/_internal/{constants-b9e57936.js.map → constants-9b714e31.js.map} +1 -1
- package/_internal/forwardRef-d0e90329.js +82 -0
- package/_internal/{forwardRef-15f62847.js.map → forwardRef-d0e90329.js.map} +1 -1
- package/_internal/{index-8e7fecb5.js → index-68e1b0af.js} +4 -4
- package/_internal/{index-8e7fecb5.js.map → index-68e1b0af.js.map} +1 -1
- package/_internal/{index-192f8ada.js → index-745f94ee.js} +2 -2
- package/_internal/{index-192f8ada.js.map → index-745f94ee.js.map} +1 -1
- package/_internal/{index-b06353f2.js → index-ab520e78.js} +3 -3
- package/_internal/{index-b06353f2.js.map → index-ab520e78.js.map} +1 -1
- package/_internal/{wrapChildrenIconWithSpaces-f1e91251.js → wrapChildrenIconWithSpaces-e6038f72.js} +2 -2
- package/_internal/{wrapChildrenIconWithSpaces-f1e91251.js.map → wrapChildrenIconWithSpaces-e6038f72.js.map} +1 -1
- package/index.js +61 -61
- package/package.json +7 -13
- package/_internal/components/date-picker-582c4925.js +0 -2
- package/_internal/components/date-picker-582c4925.js.map +0 -1
- package/_internal/components/icon-7c79ab42.js +0 -2
- package/_internal/components/icon-7c79ab42.js.map +0 -1
- package/_internal/components/mosaic-b4b35fa7.js.map +0 -1
- package/_internal/components/popover-a674dd8d.js +0 -3
- package/_internal/components/popover-a674dd8d.js.map +0 -1
- package/_internal/components/text-851c62f8.js +0 -2
- package/_internal/components/text-851c62f8.js.map +0 -1
- package/_internal/forwardRef-15f62847.js +0 -70
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flex-box-
|
|
1
|
+
{"version":3,"file":"flex-box-93b97715.js","sources":["../../../src/components/flex-box/FlexBox.tsx"],"sourcesContent":["import { ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment, Orientation, HorizontalAlignment, Size, VerticalAlignment } from '@lumx/core/js/constants';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\nimport { castArray } from '@lumx/core/js/utils/collection/castArray';\n\nexport type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;\nexport type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;\ntype SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;\nexport type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;\nexport type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;\n\n/**\n * Defines the props of the component.\n */\nexport interface FlexBoxProps extends GenericProps {\n /** Customize the root element. */\n as?: React.ElementType;\n /** Children elements. */\n children?: ReactNode;\n /** Whether the \"content filling space\" is enabled or not. */\n fillSpace?: boolean;\n /** Gap space between flexbox items. */\n gap?: GapSize;\n /** Flex horizontal alignment. */\n hAlign?: FlexVerticalAlignment;\n /** Whether the \"auto margin\" is enabled all around or not. */\n marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];\n /** Whether the \"content shrink\" is disabled or not. */\n noShrink?: boolean;\n /** Flex direction. */\n orientation?: Orientation;\n /** Flex vertical alignment. */\n vAlign?: FlexHorizontalAlignment;\n /** Whether the \"flex wrap\" is enabled or not. */\n wrap?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'FlexBox';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * FlexBox component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const FlexBox = forwardRef<FlexBoxProps, HTMLDivElement>((props, ref) => {\n const {\n as: Component = 'div',\n children,\n className,\n fillSpace,\n gap,\n hAlign,\n marginAuto,\n noShrink,\n orientation,\n vAlign,\n wrap,\n ...forwardedProps\n } = props;\n\n return (\n <Component\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n orientation: orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null),\n vAlign,\n hAlign,\n gap,\n }),\n wrap && `${CLASSNAME}--wrap`,\n fillSpace && `${CLASSNAME}--fill-space`,\n noShrink && `${CLASSNAME}--no-shrink`,\n marginAuto && castArray(marginAuto).map((align) => `${CLASSNAME}--margin-auto-${align}`),\n )}\n >\n {children}\n </Component>\n );\n});\nFlexBox.displayName = COMPONENT_NAME;\nFlexBox.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","FlexBox","forwardRef","props","ref","as","Component","children","className","fillSpace","gap","hAlign","marginAuto","noShrink","orientation","vAlign","wrap","forwardedProps","_jsx","classNames","handleBasicClasses","prefix","Orientation","horizontal","castArray","map","align","displayName"],"mappings":";;;;;;AA0CA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,SAAS,CAAA;;AAEhC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,OAAO,GAAGC,UAAU,CAA+B,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5E,MAAM;IACFC,EAAE,EAAEC,SAAS,GAAG,KAAK;IACrBC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,GAAG;IACHC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,WAAW;IACXC,MAAM;IACNC,IAAI;IACJ,GAAGC,cAAAA;AACP,GAAC,GAAGd,KAAK,CAAA;EAET,oBACIe,GAAA,CAACZ,SAAS,EAAA;AACNF,IAAAA,GAAG,EAAEA,GAAI;AAAA,IAAA,GACLa,cAAc;AAClBT,IAAAA,SAAS,EAAEW,UAAU,CACjBX,SAAS,EACTY,kBAAkB,CAAC;AACfC,MAAAA,MAAM,EAAEtB,SAAS;AACjBe,MAAAA,WAAW,EAAEA,WAAW,KAAKE,IAAI,IAAIL,MAAM,IAAII,MAAM,GAAGO,WAAW,CAACC,UAAU,GAAG,IAAI,CAAC;MACtFR,MAAM;MACNJ,MAAM;AACND,MAAAA,GAAAA;AACJ,KAAC,CAAC,EACFM,IAAI,IAAI,CAAA,EAAGjB,SAAS,CAAQ,MAAA,CAAA,EAC5BU,SAAS,IAAI,GAAGV,SAAS,CAAA,YAAA,CAAc,EACvCc,QAAQ,IAAI,CAAGd,EAAAA,SAAS,CAAa,WAAA,CAAA,EACrCa,UAAU,IAAIY,SAAS,CAACZ,UAAU,CAAC,CAACa,GAAG,CAAEC,KAAK,IAAK,CAAG3B,EAAAA,SAAS,iBAAiB2B,KAAK,CAAA,CAAE,CAC3F,CAAE;AAAAnB,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFN,OAAO,CAAC0B,WAAW,GAAG7B,cAAc,CAAA;AACpCG,OAAO,CAACO,SAAS,GAAGT,SAAS;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React__default, { Children } from 'react';
|
|
2
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
2
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
3
3
|
import { i as isComponentType } from '../isComponentType-e806b848.js';
|
|
4
4
|
import { getRootClassName } from '@lumx/core/js/utils/className';
|
|
5
5
|
import { partitionMulti } from '@lumx/core/js/utils/collection/partitionMulti';
|
|
6
6
|
import { jsxs } from 'react/jsx-runtime';
|
|
7
7
|
import { Size, Orientation } from '@lumx/core/js/constants';
|
|
8
|
-
import { FlexBox } from './flex-box-
|
|
8
|
+
import { FlexBox } from './flex-box-93b97715.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Component display name.
|
|
@@ -125,4 +125,4 @@ const GenericBlockGapSize = {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
export { GenericBlock, GenericBlockGapSize };
|
|
128
|
-
//# sourceMappingURL=generic-block-
|
|
128
|
+
//# sourceMappingURL=generic-block-925f7c5b.js.map
|
package/_internal/components/{generic-block-b79f163a.js.map → generic-block-925f7c5b.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-block-b79f163a.js","sources":["../../../src/components/generic-block/GenericBlock.tsx","../../../src/components/generic-block/constants.ts"],"sourcesContent":["import React, { Children, ReactElement, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, isComponentType } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { partitionMulti } from '@lumx/core/js/utils/collection/partitionMulti';\nimport { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';\nimport { GenericBlockGapSize } from '@lumx/react/components/generic-block/constants';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport interface GenericBlockProps extends FlexBoxProps {\n /**\n * Component to use as visual element.\n */\n figure?: ReactNode;\n /**\n * Actions to set after the main content.\n */\n actions?: ReactNode;\n /**\n * Main content to display or sections components\n * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})\n */\n children: ReactNode;\n /**\n * Orientation of the 3 sections\n */\n orientation?: FlexBoxProps['orientation'];\n /**\n * Horizontal alignment.\n */\n hAlign?: FlexBoxProps['hAlign'];\n /**\n * Vertical alignment.\n */\n vAlign?: FlexBoxProps['vAlign'];\n /**\n * The props to forward to the content.\n * By default, the content will have the same alignment as wrapper.\n */\n contentProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the actions element.\n */\n actionsProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the figure element.\n */\n figureProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * Gap space between sections.\n */\n gap?: GenericBlockGapSize;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GenericBlock';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<GenericBlockProps> = {\n gap: Size.big,\n orientation: Orientation.horizontal,\n};\n\ntype BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;\n\ninterface GenericBlockSectionProps extends FlexBoxProps {\n /**\n * Gap space between items.\n */\n gap?: GenericBlockGapSize;\n}\n\ninterface GenericBlock extends BaseGenericBlock {\n /**\n * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"figure\" section of the block (instead of using `figure` and `figureProps` props).\n */\n Figure: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"content\" section of the block (instead of using `content` and `contentProps` props).\n */\n Content: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"actions\" section of the block (instead of using `actions` and `actionsProps` props).\n */\n Actions: Comp<GenericBlockSectionProps>;\n}\n\nconst Figure = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isFigure = isComponentType(Figure);\n\nconst Content = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isContent = isComponentType(Content);\n\nconst Actions = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isActions = isComponentType(Actions);\n\n/**\n * The GenericBlock is a layout component made of 3 sections that can be\n * displayed either horizontally of vertically with the same gap between each section.\n *\n * The sections are:\n * - `Figure` => A visual element to display before the main content.\n * - `Content` => The main content displayed\n * - `Actions` => One or more actions to set after the element.\n *\n * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076\n */\nconst BaseGenericBlock: BaseGenericBlock = forwardRef((props, ref) => {\n const {\n className,\n figure,\n figureProps,\n children,\n actions,\n actionsProps,\n gap = DEFAULT_PROPS.gap,\n orientation = DEFAULT_PROPS.orientation,\n contentProps,\n ...forwardedProps\n } = props;\n\n const sections = React.useMemo(() => {\n // Split children by section type\n const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(\n Children.toArray(children),\n [isFigure, isContent, isActions],\n );\n return {\n figureChild,\n figureChildProps: (figureChild as ReactElement)?.props,\n contentChild,\n contentChildProps: (contentChild as ReactElement)?.props,\n actionsChild,\n actionsChildProps: (actionsChild as ReactElement)?.props,\n // TODO: check this is working\n otherChildren: otherChildren.filter((child) => React.Children.count(child) > 0),\n };\n }, [children]);\n\n return (\n <FlexBox\n ref={ref}\n className={classNames(className, CLASSNAME)}\n gap={gap}\n orientation={orientation}\n {...forwardedProps}\n >\n {(figure || sections.figureChildProps?.children) && (\n <FlexBox\n ref={(sections.figureChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...figureProps}\n {...sections.figureChildProps}\n className={classNames(\n figureProps?.className,\n sections.figureChildProps?.className,\n `${CLASSNAME}__figure`,\n )}\n >\n {figure}\n {sections.figureChildProps?.children}\n </FlexBox>\n )}\n\n {(sections.contentChildProps?.children || sections.otherChildren.length > 0) && (\n <FlexBox\n ref={(sections.contentChild as any)?.ref}\n orientation={Orientation.vertical}\n fillSpace\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...contentProps}\n {...sections.contentChildProps}\n className={classNames(\n contentProps?.className,\n sections.contentChildProps?.className,\n `${CLASSNAME}__content`,\n )}\n >\n {sections.contentChildProps?.children}\n {sections.otherChildren}\n </FlexBox>\n )}\n\n {(actions || sections.actionsChildProps?.children) && (\n <FlexBox\n ref={(sections.actionsChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...actionsProps}\n {...sections.actionsChildProps}\n className={classNames(\n actionsProps?.className,\n sections.actionsChildProps?.className,\n `${CLASSNAME}__actions`,\n )}\n >\n {actions}\n {sections.actionsChildProps?.children}\n </FlexBox>\n )}\n </FlexBox>\n );\n});\nBaseGenericBlock.displayName = COMPONENT_NAME;\nBaseGenericBlock.className = CLASSNAME;\nBaseGenericBlock.defaultProps = DEFAULT_PROPS;\n\nexport const GenericBlock: GenericBlock = Object.assign(BaseGenericBlock, { Figure, Content, Actions });\n","import { Size } from '@lumx/react';\n\nexport type GenericBlockGapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;\n\n/**\n * Accepted gap sizes for the generic block.\n */\nexport const GenericBlockGapSize: { [S in GenericBlockGapSize]: S } = {\n tiny: Size.tiny,\n regular: Size.regular,\n medium: Size.medium,\n big: Size.big,\n huge: Size.huge,\n};\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","gap","Size","big","orientation","Orientation","horizontal","Figure","isFigure","isComponentType","Content","isContent","Actions","isActions","BaseGenericBlock","forwardRef","props","ref","className","figure","figureProps","children","actions","actionsProps","contentProps","forwardedProps","sections","React","useMemo","figureChild","contentChild","actionsChild","otherChildren","partitionMulti","Children","toArray","figureChildProps","contentChildProps","actionsChildProps","filter","child","count","_jsxs","FlexBox","classNames","vAlign","hAlign","length","vertical","fillSpace","displayName","defaultProps","GenericBlock","Object","assign","GenericBlockGapSize","tiny","regular","medium","huge"],"mappings":";;;;;;;;;AAwDA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,cAAc,CAAA;;AAErC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAyC,GAA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AEtC,MAAMoD,YAA0B,GAAGC,MAAM,CAACC,MAAM,CAACxC,gBAAgB,EAAE;EAAEP,MAAM;EAAEG,OAAO;AAAEE,EAAAA,OAAAA;AAAQ,CAAC;;AC3NtG;AACA;AACA;AACO,MAAM2C,mBAAsD,GAAG;EAClEC,IAAI,EAAEtD,IAAI,CAACsD,IAAI;EACfC,OAAO,EAAEvD,IAAI,CAACuD,OAAO;EACrBC,MAAM,EAAExD,IAAI,CAACwD,MAAM;EACnBvD,GAAG,EAAED,IAAI,CAACC,GAAG;EACbwD,IAAI,EAAEzD,IAAI,CAACyD,IAAAA;AACf;;;;"}
|
|
1
|
+
{"version":3,"file":"generic-block-925f7c5b.js","sources":["../../../src/components/generic-block/GenericBlock.tsx","../../../src/components/generic-block/constants.ts"],"sourcesContent":["import React, { Children, ReactElement, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, isComponentType } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { partitionMulti } from '@lumx/core/js/utils/collection/partitionMulti';\nimport { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';\nimport { GenericBlockGapSize } from '@lumx/react/components/generic-block/constants';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport interface GenericBlockProps extends FlexBoxProps {\n /**\n * Component to use as visual element.\n */\n figure?: ReactNode;\n /**\n * Actions to set after the main content.\n */\n actions?: ReactNode;\n /**\n * Main content to display or sections components\n * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})\n */\n children: ReactNode;\n /**\n * Orientation of the 3 sections\n */\n orientation?: FlexBoxProps['orientation'];\n /**\n * Horizontal alignment.\n */\n hAlign?: FlexBoxProps['hAlign'];\n /**\n * Vertical alignment.\n */\n vAlign?: FlexBoxProps['vAlign'];\n /**\n * The props to forward to the content.\n * By default, the content will have the same alignment as wrapper.\n */\n contentProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the actions element.\n */\n actionsProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the figure element.\n */\n figureProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * Gap space between sections.\n */\n gap?: GenericBlockGapSize;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GenericBlock';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<GenericBlockProps> = {\n gap: Size.big,\n orientation: Orientation.horizontal,\n};\n\ntype BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;\n\ninterface GenericBlockSectionProps extends FlexBoxProps {\n /**\n * Gap space between items.\n */\n gap?: GenericBlockGapSize;\n}\n\ninterface GenericBlock extends BaseGenericBlock {\n /**\n * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"figure\" section of the block (instead of using `figure` and `figureProps` props).\n */\n Figure: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"content\" section of the block (instead of using `content` and `contentProps` props).\n */\n Content: Comp<GenericBlockSectionProps>;\n /**\n * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"actions\" section of the block (instead of using `actions` and `actionsProps` props).\n */\n Actions: Comp<GenericBlockSectionProps>;\n}\n\nconst Figure = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isFigure = isComponentType(Figure);\n\nconst Content = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isContent = isComponentType(Content);\n\nconst Actions = (() => {}) as unknown as Comp<FlexBoxProps>;\nconst isActions = isComponentType(Actions);\n\n/**\n * The GenericBlock is a layout component made of 3 sections that can be\n * displayed either horizontally of vertically with the same gap between each section.\n *\n * The sections are:\n * - `Figure` => A visual element to display before the main content.\n * - `Content` => The main content displayed\n * - `Actions` => One or more actions to set after the element.\n *\n * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076\n */\nconst BaseGenericBlock: BaseGenericBlock = forwardRef((props, ref) => {\n const {\n className,\n figure,\n figureProps,\n children,\n actions,\n actionsProps,\n gap = DEFAULT_PROPS.gap,\n orientation = DEFAULT_PROPS.orientation,\n contentProps,\n ...forwardedProps\n } = props;\n\n const sections = React.useMemo(() => {\n // Split children by section type\n const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(\n Children.toArray(children),\n [isFigure, isContent, isActions],\n );\n return {\n figureChild,\n figureChildProps: (figureChild as ReactElement)?.props,\n contentChild,\n contentChildProps: (contentChild as ReactElement)?.props,\n actionsChild,\n actionsChildProps: (actionsChild as ReactElement)?.props,\n // TODO: check this is working\n otherChildren: otherChildren.filter((child) => React.Children.count(child) > 0),\n };\n }, [children]);\n\n return (\n <FlexBox\n ref={ref}\n className={classNames(className, CLASSNAME)}\n gap={gap}\n orientation={orientation}\n {...forwardedProps}\n >\n {(figure || sections.figureChildProps?.children) && (\n <FlexBox\n ref={(sections.figureChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...figureProps}\n {...sections.figureChildProps}\n className={classNames(\n figureProps?.className,\n sections.figureChildProps?.className,\n `${CLASSNAME}__figure`,\n )}\n >\n {figure}\n {sections.figureChildProps?.children}\n </FlexBox>\n )}\n\n {(sections.contentChildProps?.children || sections.otherChildren.length > 0) && (\n <FlexBox\n ref={(sections.contentChild as any)?.ref}\n orientation={Orientation.vertical}\n fillSpace\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...contentProps}\n {...sections.contentChildProps}\n className={classNames(\n contentProps?.className,\n sections.contentChildProps?.className,\n `${CLASSNAME}__content`,\n )}\n >\n {sections.contentChildProps?.children}\n {sections.otherChildren}\n </FlexBox>\n )}\n\n {(actions || sections.actionsChildProps?.children) && (\n <FlexBox\n ref={(sections.actionsChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...actionsProps}\n {...sections.actionsChildProps}\n className={classNames(\n actionsProps?.className,\n sections.actionsChildProps?.className,\n `${CLASSNAME}__actions`,\n )}\n >\n {actions}\n {sections.actionsChildProps?.children}\n </FlexBox>\n )}\n </FlexBox>\n );\n});\nBaseGenericBlock.displayName = COMPONENT_NAME;\nBaseGenericBlock.className = CLASSNAME;\nBaseGenericBlock.defaultProps = DEFAULT_PROPS;\n\nexport const GenericBlock: GenericBlock = Object.assign(BaseGenericBlock, { Figure, Content, Actions });\n","import { Size } from '@lumx/react';\n\nexport type GenericBlockGapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;\n\n/**\n * Accepted gap sizes for the generic block.\n */\nexport const GenericBlockGapSize: { [S in GenericBlockGapSize]: S } = {\n tiny: Size.tiny,\n regular: Size.regular,\n medium: Size.medium,\n big: Size.big,\n huge: Size.huge,\n};\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","gap","Size","big","orientation","Orientation","horizontal","Figure","isFigure","isComponentType","Content","isContent","Actions","isActions","BaseGenericBlock","forwardRef","props","ref","className","figure","figureProps","children","actions","actionsProps","contentProps","forwardedProps","sections","React","useMemo","figureChild","contentChild","actionsChild","otherChildren","partitionMulti","Children","toArray","figureChildProps","contentChildProps","actionsChildProps","filter","child","count","_jsxs","FlexBox","classNames","vAlign","hAlign","length","vertical","fillSpace","displayName","defaultProps","GenericBlock","Object","assign","GenericBlockGapSize","tiny","regular","medium","huge"],"mappings":";;;;;;;;;AAwDA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,cAAc,CAAA;;AAErC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAyC,GAAG;EAC9CC,GAAG,EAAEC,IAAI,CAACC,GAAG;EACbC,WAAW,EAAEC,WAAW,CAACC,UAAAA;AAC7B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G,OAAO;AAAEE,EAAAA,OAAAA;AAAQ,CAAC;;AC3NtG;AACA;AACA;AACO,MAAM2C,mBAAsD,GAAG;EAClEC,IAAI,EAAEtD,IAAI,CAACsD,IAAI;EACfC,OAAO,EAAEvD,IAAI,CAACuD,OAAO;EACrBC,MAAM,EAAExD,IAAI,CAACwD,MAAM;EACnBvD,GAAG,EAAED,IAAI,CAACC,GAAG;EACbwD,IAAI,EAAEzD,IAAI,CAACyD,IAAAA;AACf;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
1
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
2
2
|
import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { Orientation } from '@lumx/core/js/constants';
|
|
@@ -101,4 +101,4 @@ GridItem.displayName = COMPONENT_NAME;
|
|
|
101
101
|
GridItem.className = CLASSNAME;
|
|
102
102
|
|
|
103
103
|
export { Grid, GridItem };
|
|
104
|
-
//# sourceMappingURL=grid-
|
|
104
|
+
//# sourceMappingURL=grid-95fd1493.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-
|
|
1
|
+
{"version":3,"file":"grid-95fd1493.js","sources":["../../../src/components/grid/Grid.tsx","../../../src/components/grid/GridItem.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { Alignment, Orientation, Size } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\ntype GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface GridProps extends GenericProps {\n /** Orientation. */\n orientation?: Orientation;\n /** Whether the children are wrapped or not. */\n wrap?: string;\n /** Vertical alignment. */\n vAlign?: Alignment;\n /** Horizontal alignment. */\n hAlign?: Alignment;\n /** Gutter size. */\n gutter?: GridGutterSize;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Grid';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<GridProps> = {\n orientation: Orientation.horizontal,\n wrap: 'nowrap',\n};\n\n/**\n * Grid component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Grid = forwardRef<GridProps, HTMLDivElement>((props, ref) => {\n const {\n children,\n className,\n gutter,\n hAlign,\n orientation = DEFAULT_PROPS.orientation,\n vAlign,\n wrap = DEFAULT_PROPS.wrap,\n ...forwardedProps\n } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n `${CLASSNAME}-container`,\n { [`${CLASSNAME}--h-align-${hAlign}`]: hAlign },\n { [`${CLASSNAME}--v-align-${vAlign}`]: vAlign },\n handleBasicClasses({ prefix: CLASSNAME, orientation, wrap, gutter }),\n )}\n >\n {children}\n </div>\n );\n});\nGrid.displayName = COMPONENT_NAME;\nGrid.className = CLASSNAME;\nGrid.defaultProps = DEFAULT_PROPS;\n","import classNames from 'classnames';\n\nimport { Alignment } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\ntype Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';\n\n/**\n * Defines the props of the component.\n */\nexport interface GridItemProps extends GenericProps {\n /** Alignment. */\n align?: Alignment;\n /** Order. */\n order?: Columns;\n /** Width. */\n width?: Columns;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GridItem';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * GridItem component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const GridItem = forwardRef<GridItemProps, HTMLDivElement>((props, ref) => {\n const { children, className, width, align, order, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, width, order, align }))}\n >\n {children}\n </div>\n );\n});\nGridItem.displayName = COMPONENT_NAME;\nGridItem.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","orientation","Orientation","horizontal","wrap","Grid","forwardRef","props","ref","children","className","gutter","hAlign","vAlign","forwardedProps","_jsx","classNames","handleBasicClasses","prefix","displayName","defaultProps","GridItem","width","align","order"],"mappings":";;;;;AA2BA;AACA;AACA;AACA,MAAMA,gBAAc,GAAG,MAAM,CAAA;;AAE7B;AACA;AACA;AACA,MAAMC,WAAS,GAAGC,gBAAgB,CAACF,gBAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAiC,GAAG;EACtCC,WAAW,EAAEC,WAAW,CAACC,UAAU;AACnCC,EAAAA,IAAI,EAAE,QAAA;AACV,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,IAAI,GAAGC,UAAU,CAA4B,CAACC,KAAK,EAAEC,GAAG,KAAK;EACtE,MAAM;IACFC,QAAQ;IACRC,SAAS;IACTC,MAAM;IACNC,MAAM;IACNX,WAAW,GAAGD,aAAa,CAACC,WAAW;IACvCY,MAAM;IACNT,IAAI,GAAGJ,aAAa,CAACI,IAAI;IACzB,GAAGU,cAAAA;AACP,GAAC,GAAGP,KAAK,CAAA;AAET,EAAA,oBACIQ,GAAA,CAAA,KAAA,EAAA;AACIP,IAAAA,GAAG,EAAEA,GAAI;AAAA,IAAA,GACLM,cAAc;IAClBJ,SAAS,EAAEM,UAAU,C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,CAAE;AAAAd,IAAAA,QAAA,EAEhGA,QAAAA;AAAQ,GACR,CAAC,CAAA;AAEd,CAAC,EAAC;AACFY,QAAQ,CAACF,WAAW,GAAGtB,cAAc,CAAA;AACrCwB,QAAQ,CAACX,SAAS,GAAGZ,SAAS;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
1
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
2
2
|
import { getRootClassName } from '@lumx/core/js/utils/className';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
@@ -55,4 +55,4 @@ GridColumn.className = CLASSNAME;
|
|
|
55
55
|
GridColumn.defaultProps = DEFAULT_PROPS;
|
|
56
56
|
|
|
57
57
|
export { GridColumn };
|
|
58
|
-
//# sourceMappingURL=grid-column-
|
|
58
|
+
//# sourceMappingURL=grid-column-43f28cfb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-column-
|
|
1
|
+
{"version":3,"file":"grid-column-43f28cfb.js","sources":["../../../src/components/grid-column/GridColumn.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Size } from '@lumx/react';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nexport type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface GridColumnProps extends GenericProps {\n /** Customize the root element. */\n as?: React.ElementType;\n /** Children elements. */\n children?: ReactNode;\n /** Space between columns and rows. */\n gap?: GridColumnGapSize;\n /** Ideal number of columns. */\n maxColumns?: number;\n /** Minimum width for each item, reduce the number of column if there is not enough space. */\n itemMinWidth?: number;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GridColumn';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<GridColumnProps> = {};\n\n/**\n * The GridColumn is a layout component that can display children in a grid\n * with custom display properties. It also comes with a responsive design,\n * with a number of column that reduce when there is not enough space for each item.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const GridColumn = forwardRef<GridColumnProps>((props, ref): ReactElement => {\n const {\n as: Component = 'div',\n gap,\n maxColumns,\n itemMinWidth,\n children,\n className,\n style = {},\n ...forwardedProps\n } = props;\n\n return (\n <Component\n {...forwardedProps}\n ref={ref as React.Ref<any>}\n className={classNames(className, CLASSNAME)}\n style={{\n ...style,\n ['--lumx-grid-column-item-min-width' as any]: Number.isInteger(itemMinWidth) && `${itemMinWidth}px`,\n ['--lumx-grid-column-columns' as any]: maxColumns,\n ['--lumx-grid-column-gap' as any]: gap && `var(--lumx-spacing-unit-${gap})`,\n }}\n >\n {children}\n </Component>\n );\n});\nGridColumn.displayName = COMPONENT_NAME;\nGridColumn.className = CLASSNAME;\nGridColumn.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","GridColumn","forwardRef","props","ref","as","Component","gap","maxColumns","itemMinWidth","children","className","style","forwardedProps","_jsx","classNames","Number","isInteger","displayName","defaultProps"],"mappings":";;;;AA2BA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,YAAY,CAAA;;AAEnC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAuC,GAAG,EAAE,CAAA;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAGC,UAAU,CAAkB,CAACC,KAAK,EAAEC,GAAG,KAAmB;EAChF,MAAM;IACFC,EAAE,EAAEC,SAAS,GAAG,KAAK;IACrBC,GAAG;IACHC,UAAU;IACVC,YAAY;IACZC,QAAQ;IACRC,SAAS;IACTC,KAAK,GAAG,EAAE;IACV,GAAGC,cAAAA;AACP,GAAC,GAAGV,KAAK,CAAA;EAET,oBACIW,GAAA,CAACR,SAAS,EAAA;AAAA,IAAA,GACFO,cAAc;AAClBT,IAAAA,GAAG,EAAEA,GAAsB;AAC3BO,IAAAA,SAAS,EAAEI,UAAU,CAACJ,SAAS,EAAEb,SAAS,CAAE;AAC5Cc,IAAAA,KAAK,EAAE;AACH,MAAA,GAAGA,KAAK;MACR,CAAC,mCAAmC,GAAUI,MAAM,CAACC,SAAS,CAACR,YAAY,CAAC,IAAI,CAAGA,EAAAA,YAAY,CAAI,EAAA,CAAA;MACnG,CAAC,4BAA4B,GAAUD,UAAU;AACjD,MAAA,CAAC,wBAAwB,GAAUD,GAAG,IAAI,2BAA2BA,GAAG,CAAA,CAAA,CAAA;KAC1E;AAAAG,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEpB,CAAC,EAAC;AACFT,UAAU,CAACiB,WAAW,GAAGrB,cAAc,CAAA;AACvCI,UAAU,CAACU,SAAS,GAAGb,SAAS,CAAA;AAChCG,UAAU,CAACkB,YAAY,GAAGnB,aAAa;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
1
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
2
2
|
import { getRootClassName } from '@lumx/core/js/utils/className';
|
|
3
3
|
import { u as useHeadingLevel, D as DEFAULT_TYPOGRAPHY_BY_LEVEL } from '../HeadingLevelProvider-ebdcb0c7.js';
|
|
4
4
|
export { H as HeadingLevelProvider } from '../HeadingLevelProvider-ebdcb0c7.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { T as Text } from '../index-
|
|
6
|
+
import { T as Text } from '../index-ab520e78.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Component display name.
|
|
@@ -50,4 +50,4 @@ Heading.className = CLASSNAME;
|
|
|
50
50
|
Heading.defaultProps = DEFAULT_PROPS;
|
|
51
51
|
|
|
52
52
|
export { Heading, useHeadingLevel };
|
|
53
|
-
//# sourceMappingURL=heading-
|
|
53
|
+
//# sourceMappingURL=heading-45d6e78e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading-
|
|
1
|
+
{"version":3,"file":"heading-45d6e78e.js","sources":["../../../src/components/heading/Heading.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport { HeadingElement } from '@lumx/react/utils/type';\nimport { getRootClassName } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nimport { Text, TextProps } from '../text';\nimport { DEFAULT_TYPOGRAPHY_BY_LEVEL } from './constants';\nimport { useHeadingLevel } from './useHeadingLevel';\n\n/**\n * Defines the props of the component.\n */\nexport interface HeadingProps extends Partial<TextProps> {\n /**\n * Display a specific heading level instead of the one provided by parent context provider.\n */\n as?: HeadingElement;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Heading';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS = {} as const;\n\n/**\n * Renders a heading component.\n * Extends the `Text` Component with the heading level automatically computed based on\n * the current level provided by the context.\n */\nexport const Heading = forwardRef<HeadingProps>((props, ref) => {\n const { children, as, className, ...forwardedProps } = props;\n const { headingElement } = useHeadingLevel();\n\n const computedHeadingElement = as || headingElement;\n return (\n <Text\n ref={ref}\n className={classNames(className, CLASSNAME)}\n as={computedHeadingElement}\n typography={DEFAULT_TYPOGRAPHY_BY_LEVEL[computedHeadingElement]}\n {...forwardedProps}\n >\n {children}\n </Text>\n );\n});\n\nHeading.displayName = COMPONENT_NAME;\nHeading.className = CLASSNAME;\nHeading.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","Heading","forwardRef","props","ref","children","as","className","forwardedProps","headingElement","useHeadingLevel","computedHeadingElement","_jsx","Text","classNames","typography","DEFAULT_TYPOGRAPHY_BY_LEVEL","displayName","defaultProps"],"mappings":";;;;;;;AAwBA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,SAAS,CAAA;;AAEhC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAa,GAAG,EAAW,CAAA;;AAEjC;AACA;AACA;AACA;AACA;AACO,MAAMC,OAAO,GAAGC,UAAU,CAAe,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC5D,MAAM;IAAEC,QAAQ;IAAEC,EAAE;IAAEC,SAAS;IAAE,GAAGC,cAAAA;AAAe,GAAC,GAAGL,KAAK,CAAA;EAC5D,MAAM;AAAEM,IAAAA,cAAAA;GAAgB,GAAGC,eAAe,EAAE,CAAA;AAE5C,EAAA,MAAMC,sBAAsB,GAAGL,EAAE,IAAIG,cAAc,CAAA;EACnD,oBACIG,GAAA,CAACC,IAAI,EAAA;AACDT,IAAAA,GAAG,EAAEA,GAAI;AACTG,IAAAA,SAAS,EAAEO,UAAU,CAACP,SAAS,EAAET,SAAS,CAAE;AAC5CQ,IAAAA,EAAE,EAAEK,sBAAuB;AAC3BI,IAAAA,UAAU,EAAEC,2BAA2B,CAACL,sBAAsB,CAAE;AAAA,IAAA,GAC5DH,cAAc;AAAAH,IAAAA,QAAA,EAEjBA,QAAAA;AAAQ,GACP,CAAC,CAAA;AAEf,CAAC,EAAC;AAEFJ,OAAO,CAACgB,WAAW,GAAGpB,cAAc,CAAA;AACpCI,OAAO,CAACM,SAAS,GAAGT,SAAS,CAAA;AAC7BG,OAAO,CAACiB,YAAY,GAAGlB,aAAa;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-79195151.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
1
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
2
2
|
import { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';
|
|
3
3
|
import { u as useTheme } from '../ThemeContext-3181f000.js';
|
|
4
|
-
import { I as ImageCaption } from '../ImageCaption-
|
|
4
|
+
import { I as ImageCaption } from '../ImageCaption-4109b433.js';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { Alignment, Theme } from '@lumx/core/js/constants';
|
|
7
|
-
import { T as Thumbnail } from '../Thumbnail-
|
|
7
|
+
import { T as Thumbnail } from '../Thumbnail-741501a5.js';
|
|
8
8
|
|
|
9
9
|
const ImageBlockCaptionPosition = {
|
|
10
10
|
below: 'below',
|
|
@@ -107,4 +107,4 @@ ImageBlock.className = CLASSNAME;
|
|
|
107
107
|
ImageBlock.defaultProps = DEFAULT_PROPS;
|
|
108
108
|
|
|
109
109
|
export { ImageBlock, ImageBlockCaptionPosition };
|
|
110
|
-
//# sourceMappingURL=image-block-
|
|
110
|
+
//# sourceMappingURL=image-block-aba6d2db.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-block-
|
|
1
|
+
{"version":3,"file":"image-block-aba6d2db.js","sources":["../../../src/components/image-block/ImageBlock.tsx"],"sourcesContent":["import { ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment, HorizontalAlignment, Size, Theme, Thumbnail } from '@lumx/react';\n\nimport { GenericProps, HasTheme, ValueOf } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { ThumbnailProps } from '../thumbnail/Thumbnail';\nimport { ImageCaption, ImageCaptionMetadata } from './ImageCaption';\n\n/**\n * Image block variants.\n */\nexport const ImageBlockCaptionPosition = {\n below: 'below',\n over: 'over',\n} as const;\nexport type ImageBlockCaptionPosition = ValueOf<typeof ImageBlockCaptionPosition>;\n\n/**\n * Image block sizes.\n */\nexport type ImageBlockSize = Extract<Size, 'xl' | 'xxl'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface ImageBlockProps extends GenericProps, HasTheme, ImageCaptionMetadata {\n /** Action toolbar content. */\n actions?: ReactNode;\n /** Alignment. */\n align?: HorizontalAlignment;\n /** Image alternative text. */\n alt: string;\n /** Caption position. */\n captionPosition?: ImageBlockCaptionPosition;\n /** Whether the image has to fill its container height or not. */\n fillHeight?: boolean;\n /** Image URL. */\n image: string;\n /** Size variant. */\n size?: ImageBlockSize;\n /** Props to pass to the thumbnail (minus those already set by the ImageBlock props). */\n thumbnailProps?: Omit<ThumbnailProps, 'image' | 'size' | 'theme' | 'align' | 'fillHeight'>;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ImageBlock';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<ImageBlockProps> = {\n captionPosition: ImageBlockCaptionPosition.below,\n align: Alignment.left,\n};\n\n/**\n * ImageBlock component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ImageBlock = forwardRef<ImageBlockProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n actions,\n align = DEFAULT_PROPS.align,\n alt,\n captionPosition = DEFAULT_PROPS.captionPosition,\n captionStyle,\n className,\n description,\n descriptionProps,\n fillHeight,\n image,\n size,\n tags,\n theme = defaultTheme,\n thumbnailProps,\n title,\n titleProps,\n ...forwardedProps\n } = props;\n return (\n <figure\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n captionPosition,\n align,\n size,\n theme,\n }),\n fillHeight && `${CLASSNAME}--fill-height`,\n )}\n >\n <Thumbnail\n {...thumbnailProps}\n className={classNames(`${CLASSNAME}__image`, thumbnailProps?.className)}\n fillHeight={fillHeight}\n align={align}\n image={image}\n size={size}\n theme={theme}\n alt={(alt || title) as string}\n />\n <ImageCaption\n as=\"figcaption\"\n baseClassName={CLASSNAME}\n theme={theme}\n title={title}\n titleProps={titleProps}\n description={description}\n descriptionProps={descriptionProps}\n tags={tags}\n captionStyle={captionStyle}\n align={align}\n truncate={captionPosition === 'over'}\n />\n {actions && <div className={`${CLASSNAME}__actions`}>{actions}</div>}\n </figure>\n );\n});\nImageBlock.displayName = COMPONENT_NAME;\nImageBlock.className = CLASSNAME;\nImageBlock.defaultProps = DEFAULT_PROPS;\n"],"names":["ImageBlockCaptionPosition","below","over","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","captionPosition","align","Alignment","left","ImageBlock","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","actions","alt","captionStyle","className","description","descriptionProps","fillHeight","image","size","tags","theme","thumbnailProps","title","titleProps","forwardedProps","_jsxs","classNames","handleBasicClasses","prefix","children","_jsx","Thumbnail","ImageCaption","as","baseClassName","truncate","displayName","defaultProps"],"mappings":";;;;;;;;AAiBO,MAAMA,yBAAyB,GAAG;AACrCC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,IAAI,EAAE,MAAA;AACV,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,YAAY,CAAA;;AAEnC;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAuC,GAAG;EAC5CC,eAAe,EAAEP,yBAAyB,CAACC,KAAK;EAChDO,KAAK,E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,GAAG,EAAGA,GAAG,IAAIW,KAAAA;AAAiB,KACjC,CAAC,eACFQ,GAAA,CAACE,YAAY,EAAA;AACTC,MAAAA,EAAE,EAAC,YAAY;AACfC,MAAAA,aAAa,EAAEvC,SAAU;AACzByB,MAAAA,KAAK,EAAEA,KAAM;AACbE,MAAAA,KAAK,EAAEA,KAAM;AACbC,MAAAA,UAAU,EAAEA,UAAW;AACvBT,MAAAA,WAAW,EAAEA,WAAY;AACzBC,MAAAA,gBAAgB,EAAEA,gBAAiB;AACnCI,MAAAA,IAAI,EAAEA,IAAK;AACXP,MAAAA,YAAY,EAAEA,YAAa;AAC3Bb,MAAAA,KAAK,EAAEA,KAAM;MACboC,QAAQ,EAAErC,eAAe,KAAK,MAAA;AAAO,KACxC,CAAC,EACDY,OAAO,iBAAIoB,GAAA,CAAA,KAAA,EAAA;MAAKjB,SAAS,EAAE,CAAGlB,EAAAA,SAAS,CAAY,SAAA,CAAA;AAAAkC,MAAAA,QAAA,EAAEnB,OAAAA;AAAO,KAAM,CAAC,CAAA;AAAA,GAChE,CAAC,CAAA;AAEjB,CAAC,EAAC;AACFR,UAAU,CAACkC,WAAW,GAAG1C,cAAc,CAAA;AACvCQ,UAAU,CAACW,SAAS,GAAGlB,SAAS,CAAA;AAChCO,UAAU,CAACmC,YAAY,GAAGxC,aAAa;;;;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { f as forwardRef, c as classNames } from '../forwardRef-
|
|
2
|
+
import { f as forwardRef, c as classNames } from '../forwardRef-d0e90329.js';
|
|
3
3
|
import { u as useMergeRefs, m as mergeRefs } from '../mergeRefs-f0d7d6ea.js';
|
|
4
4
|
import memoize from 'lodash/memoize';
|
|
5
|
-
import { I as ImageCaption } from '../ImageCaption-
|
|
5
|
+
import { I as ImageCaption } from '../ImageCaption-4109b433.js';
|
|
6
6
|
import { getRootClassName } from '@lumx/core/js/utils/className';
|
|
7
7
|
import throttle from 'lodash/throttle';
|
|
8
8
|
import { i as isReducedMotion } from '../useTransitionVisibility-321fdbfa.js';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import { S as SlideshowItem, a as SlideshowControls, b as Slides } from '../Slides-
|
|
11
|
-
import { T as Thumbnail } from '../Thumbnail-
|
|
12
|
-
import { I as IconButton } from '../IconButton-
|
|
13
|
-
import { FlexBox } from './flex-box-
|
|
10
|
+
import { S as SlideshowItem, a as SlideshowControls, b as Slides } from '../Slides-83646e84.js';
|
|
11
|
+
import { T as Thumbnail } from '../Thumbnail-741501a5.js';
|
|
12
|
+
import { I as IconButton } from '../IconButton-351389b0.js';
|
|
13
|
+
import { FlexBox } from './flex-box-93b97715.js';
|
|
14
14
|
import ReactDOM from 'react-dom';
|
|
15
|
-
import { Lightbox } from './lightbox-
|
|
15
|
+
import { Lightbox } from './lightbox-894abe64.js';
|
|
16
16
|
import { T as ThemeProvider } from '../ThemeContext-3181f000.js';
|
|
17
17
|
import { C as ClickAwayProvider } from '../ClickAwayProvider-1204f237.js';
|
|
18
18
|
|
|
@@ -756,4 +756,4 @@ const ImageLightbox = Object.assign(Inner, {
|
|
|
756
756
|
});
|
|
757
757
|
|
|
758
758
|
export { ImageLightbox };
|
|
759
|
-
//# sourceMappingURL=image-lightbox-
|
|
759
|
+
//# sourceMappingURL=image-lightbox-8b8e77c2.js.map
|