@makeswift/runtime 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +15 -15
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +10 -10
- package/dist/Button.cjs.js +12 -12
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +10 -10
- package/dist/Carousel.cjs.js +28 -28
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +7 -7
- package/dist/Countdown.cjs.js +15 -15
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +7 -7
- package/dist/Divider.cjs.js +12 -12
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +10 -10
- package/dist/Embed.cjs.js +3 -30
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -29
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +51 -51
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +7 -7
- package/dist/Image.cjs.js +8 -8
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +7 -7
- package/dist/LiveProvider.cjs.js +6 -6
- package/dist/LiveProvider.es.js +8 -8
- package/dist/Navigation.cjs.js +27 -27
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +6 -6
- package/dist/PreviewProvider.cjs.js +7 -7
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +7 -7
- package/dist/ReadOnlyText.cjs.js +16 -13
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +11 -8
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +13 -10
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +9 -6
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +8 -8
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +6 -6
- package/dist/SocialLinks.cjs.js +14 -14
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +10 -10
- package/dist/Text.cjs.js +4 -4
- package/dist/Text.es.js +5 -5
- package/dist/Video.cjs.js +3 -30
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -29
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +4 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +4 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +9 -9
- package/dist/components.es.js +9 -9
- package/dist/control-serialization.cjs.js +88 -12
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +89 -13
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +15 -4
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +6 -3
- package/dist/controls.es.js.map +1 -1
- package/dist/deepEqual.cjs.js +40 -0
- package/dist/deepEqual.cjs.js.map +1 -0
- package/dist/deepEqual.es.js +39 -0
- package/dist/deepEqual.es.js.map +1 -0
- package/dist/index.cjs.js +102 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +173 -249
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs11.js +375 -0
- package/dist/index.cjs11.js.map +1 -0
- package/dist/index.cjs2.js +14 -16
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs4.js +2 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs6.js +700 -22
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +37 -13
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +17 -41
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs9.js +13 -266
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +85 -80
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +174 -250
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es11.js +368 -0
- package/dist/index.es11.js.map +1 -0
- package/dist/index.es2.js +3 -5
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es4.js +2 -1
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es6.js +695 -22
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +33 -14
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +17 -39
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es9.js +12 -261
- package/dist/index.es9.js.map +1 -1
- package/dist/leaf.cjs.js +1 -1
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +2 -2
- package/dist/main.cjs.js +4 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +4 -2
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +3 -3
- package/dist/next.es.js +4 -4
- package/dist/prop-controllers.cjs.js +4 -2
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +4 -2
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +958 -1431
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +852 -1343
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +3 -3
- package/dist/react.es.js +3 -3
- package/dist/select.cjs.js +21 -0
- package/dist/select.cjs.js.map +1 -0
- package/dist/select.es.js +16 -0
- package/dist/select.es.js.map +1 -0
- package/dist/slate.cjs.js +213 -12
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +207 -6
- package/dist/slate.es.js.map +1 -1
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/control-serialization.d.ts +3 -3
- package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +2 -2
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/controls/style-v2.d.ts +5 -0
- package/dist/types/src/builder/serialization/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/controls/control.d.ts +4 -2
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/icon-radio-group.d.ts +29 -0
- package/dist/types/src/controls/icon-radio-group.d.ts.map +1 -0
- package/dist/types/src/controls/index.d.ts +2 -0
- package/dist/types/src/controls/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +12 -3
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +1 -2
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/style-v2.d.ts +64 -0
- package/dist/types/src/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/document.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/instances.d.ts +2 -2
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +5 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +10 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +10 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts +13 -0
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/ColorPlugin/index.d.ts +10 -0
- package/dist/types/src/slate/ColorPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +2 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +9 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/index.d.ts +2 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +39 -0
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types/src/slate/utils/responsive.d.ts +16 -0
- package/dist/types/src/slate/utils/responsive.d.ts.map +1 -0
- package/dist/useMediaQuery.es.js +1 -1
- package/package.json +1 -1
package/dist/Box.cjs.js
CHANGED
|
@@ -35,26 +35,26 @@ var React = require("react");
|
|
|
35
35
|
var css = require("@emotion/css");
|
|
36
36
|
var uuid = require("uuid");
|
|
37
37
|
var next = require("./index.cjs.js");
|
|
38
|
+
var reactPage = require("./react-page.cjs.js");
|
|
38
39
|
var jsxRuntime = require("react/jsx-runtime");
|
|
39
40
|
var index = require("./index.cjs2.js");
|
|
40
41
|
var boxModels = require("./box-models.cjs.js");
|
|
41
42
|
require("use-sync-external-store/shim/with-selector");
|
|
42
43
|
require("next/dynamic");
|
|
43
|
-
require("./react-page.cjs.js");
|
|
44
|
-
require("redux");
|
|
45
|
-
require("redux-thunk");
|
|
46
44
|
require("./actions.cjs.js");
|
|
47
|
-
require("./state/breakpoints.cjs.js");
|
|
48
|
-
require("slate");
|
|
49
|
-
require("is-hotkey");
|
|
50
|
-
require("slate-react");
|
|
51
|
-
require("@emotion/serialize");
|
|
52
|
-
require("@emotion/utils");
|
|
53
45
|
require("./text-input.cjs.js");
|
|
54
46
|
require("./combobox.cjs.js");
|
|
47
|
+
require("./select.cjs.js");
|
|
48
|
+
require("slate");
|
|
55
49
|
require("use-sync-external-store/shim");
|
|
50
|
+
require("redux");
|
|
51
|
+
require("redux-thunk");
|
|
56
52
|
require("./types.cjs.js");
|
|
53
|
+
require("./deepEqual.cjs.js");
|
|
54
|
+
require("./state/breakpoints.cjs.js");
|
|
57
55
|
require("color");
|
|
56
|
+
require("@emotion/serialize");
|
|
57
|
+
require("@emotion/utils");
|
|
58
58
|
require("scroll-into-view-if-needed");
|
|
59
59
|
require("react-dom");
|
|
60
60
|
require("html-react-parser");
|
|
@@ -87,7 +87,7 @@ var Placeholder = React.forwardRef(function Placeholder2(_a, ref) {
|
|
|
87
87
|
style: {
|
|
88
88
|
visibility: hide ? "hidden" : "initial"
|
|
89
89
|
},
|
|
90
|
-
className:
|
|
90
|
+
className: reactPage.useStyle({
|
|
91
91
|
width: "100%",
|
|
92
92
|
background: "rgba(161, 168, 194, 0.18)",
|
|
93
93
|
height: 80,
|
|
@@ -184,7 +184,7 @@ const Box = React.forwardRef(function Box2({
|
|
|
184
184
|
}) : null;
|
|
185
185
|
}
|
|
186
186
|
}), []);
|
|
187
|
-
const gridItemClassName =
|
|
187
|
+
const gridItemClassName = reactPage.useStyle(next.useResponsiveStyle([verticalAlign], ([alignItems = "flex-start"]) => ({
|
|
188
188
|
alignItems
|
|
189
189
|
})));
|
|
190
190
|
const [key, setKey] = React.useState(() => uuid.v4());
|
|
@@ -208,19 +208,19 @@ const Box = React.forwardRef(function Box2({
|
|
|
208
208
|
return /* @__PURE__ */ jsxRuntime.jsx(index.BackgroundsContainer, {
|
|
209
209
|
ref: boxElementCallbackRef,
|
|
210
210
|
id,
|
|
211
|
-
className: css.cx(width, margin, borderRadius,
|
|
211
|
+
className: css.cx(width, margin, borderRadius, reactPage.useStyle({
|
|
212
212
|
display: "flex"
|
|
213
|
-
}),
|
|
213
|
+
}), reactPage.useStyle(next.useResponsiveStyle([height], ([alignSelf = "auto"]) => ({
|
|
214
214
|
alignSelf
|
|
215
215
|
}))), animationClassName),
|
|
216
216
|
backgrounds,
|
|
217
217
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
218
218
|
ref: innerRef,
|
|
219
|
-
className: css.cx(padding, boxShadow, border,
|
|
219
|
+
className: css.cx(padding, boxShadow, border, reactPage.useStyle({
|
|
220
220
|
display: "flex",
|
|
221
221
|
flexWrap: "wrap",
|
|
222
222
|
width: "100%"
|
|
223
|
-
}),
|
|
223
|
+
}), reactPage.useStyle(next.useResponsiveStyle([verticalAlign], ([alignContent = "flex-start"]) => ({
|
|
224
224
|
alignContent
|
|
225
225
|
})))),
|
|
226
226
|
children: children && children.elements.length > 0 ? children.elements.map((child, index$1) => /* @__PURE__ */ jsxRuntime.jsx(index.GridItem, {
|
package/dist/Box.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.cjs.js","sources":["../src/components/builtin/Box/components/Placeholder/index.tsx","../src/components/builtin/Box/Box.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\ntype Props = { hide?: boolean }\n\nexport default forwardRef(function Placeholder(\n { hide = false, ...restOfProps }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <div\n {...restOfProps}\n ref={ref}\n style={{ visibility: hide ? 'hidden' : 'initial' }}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n GapYValue,\n GapXValue,\n CheckboxValue,\n BackgroundsValue,\n} from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: GapYValue\n columnGap?: GapXValue\n hidePlaceholder?: CheckboxValue\n children?: GridValue\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const boxElementObjectRef = useRef<HTMLElement | null>(null)\n const [animationClassName, replayAnimation, setElement] = useBoxAnimation(\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n const boxElementCallbackRef = useCallback((current: HTMLElement | null) => {\n boxElementObjectRef.current = current\n\n setElement(current)\n }, [])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return boxElementObjectRef.current\n },\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElementObjectRef.current\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [],\n )\n\n const gridItemClassName = useStyle(\n useResponsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={boxElementCallbackRef}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(useResponsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n useResponsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({\n alignContent,\n })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"names":["forwardRef","ref","hide","restOfProps","visibility","useStyle","width","background","height","padding","overflow","Box","id","backgrounds","margin","border","children","borderRadius","boxShadow","rowGap","columnGap","hidePlaceholder","verticalAlign","boxAnimateType","boxAnimateDuration","boxAnimateDelay","itemAnimateDelay","itemAnimateType","itemAnimateDuration","itemStaggerDuration","innerRef","useRef","boxElementObjectRef","animationClassName","replayAnimation","setElement","useBoxAnimation","boxElementCallbackRef","useCallback","current","useImperativeHandle","getDomNode","getBoxModel","paddingBoxElement","borderBoxElement","marginBoxElement","borderBox","getBoundingClientRect","paddingBoxComputedStyle","ownerDocument","defaultView","getComputedStyle","borderBoxComputedStyle","marginBoxComputedStyle","top","parse","paddingTop","right","paddingRight","bottom","paddingBottom","left","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","marginTop","marginRight","marginBottom","marginLeft","createBox","gridItemClassName","useResponsiveStyle","alignItems","key","setKey","useState","uuid","animationProps","prevAnimationProps","useEffect","areBoxAnimationPropsEqual","BackgroundsContainer","cx","display","alignSelf","flexWrap","alignContent","elements","length","map","child","index","GridItem","columns","Element"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAA,cAAeA,iBAAW,sBACxB,IACAC,KACA;AAFA,eAAEC;AAAAA,WAAO;AAAA,MAAT,IAAmBC,wBAAnB,IAAmBA;AAAAA,IAAjBD;AAAAA;AAGF,gFAEQC;IACJ;AAAA,IACA,OAAO;AAAA,MAAEC,YAAYF,OAAO,WAAW;AAAA,IAHzC;AAAA,IAIE,WAAWG,KAA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AlB,CADZ,CALG;AAAA,MAYZxE,UAAAA,YAAYA,SAASyE,SAASC,SAAS,IACtC1E,SAASyE,SAASE,IAAI,CAACC,OAAOC,2CAC3BC,MAAAA,UAAD;AAAA,QAEE,WAAWtB;AAAAA,QACX,MAAMxD,SAAS+E;AAAAA,QAAAA,OACfF;AAAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QATF,yCAWGG,cAAD;AAAA,UAAS,SAASJ;AAAAA,QAAAA,CAAlB;AAAA,SAVKA,MAAMjB,GADb,CADF,mCAgBC,aAAD;AAAA,QAAa,MAAMtD;AAAAA,MAAAA,CAAnB;AAAA,OA9BGsD,GAFP;AAAA,EAAA,CAdJ;AAmDD,CA9JqB;;"}
|
|
1
|
+
{"version":3,"file":"Box.cjs.js","sources":["../src/components/builtin/Box/components/Placeholder/index.tsx","../src/components/builtin/Box/Box.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\ntype Props = { hide?: boolean }\n\nexport default forwardRef(function Placeholder(\n { hide = false, ...restOfProps }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <div\n {...restOfProps}\n ref={ref}\n style={{ visibility: hide ? 'hidden' : 'initial' }}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import {\n forwardRef,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n GapYValue,\n GapXValue,\n CheckboxValue,\n BackgroundsValue,\n} from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: GapYValue\n columnGap?: GapXValue\n hidePlaceholder?: CheckboxValue\n children?: GridValue\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const boxElementObjectRef = useRef<HTMLElement | null>(null)\n const [animationClassName, replayAnimation, setElement] = useBoxAnimation(\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n const boxElementCallbackRef = useCallback((current: HTMLElement | null) => {\n boxElementObjectRef.current = current\n\n setElement(current)\n }, [])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return boxElementObjectRef.current\n },\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElementObjectRef.current\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [],\n )\n\n const gridItemClassName = useStyle(\n useResponsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={boxElementCallbackRef}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(useResponsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n useResponsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({\n alignContent,\n })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"names":["forwardRef","ref","hide","restOfProps","visibility","useStyle","width","background","height","padding","overflow","Box","id","backgrounds","margin","border","children","borderRadius","boxShadow","rowGap","columnGap","hidePlaceholder","verticalAlign","boxAnimateType","boxAnimateDuration","boxAnimateDelay","itemAnimateDelay","itemAnimateType","itemAnimateDuration","itemStaggerDuration","innerRef","useRef","boxElementObjectRef","animationClassName","replayAnimation","setElement","useBoxAnimation","boxElementCallbackRef","useCallback","current","useImperativeHandle","getDomNode","getBoxModel","paddingBoxElement","borderBoxElement","marginBoxElement","borderBox","getBoundingClientRect","paddingBoxComputedStyle","ownerDocument","defaultView","getComputedStyle","borderBoxComputedStyle","marginBoxComputedStyle","top","parse","paddingTop","right","paddingRight","bottom","paddingBottom","left","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","marginTop","marginRight","marginBottom","marginLeft","createBox","gridItemClassName","useResponsiveStyle","alignItems","key","setKey","useState","uuid","animationProps","prevAnimationProps","useEffect","areBoxAnimationPropsEqual","BackgroundsContainer","cx","display","alignSelf","flexWrap","alignContent","elements","length","map","child","index","GridItem","columns","Element"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAA,cAAeA,iBAAW,sBACxB,IACAC,KACA;AAFA,eAAEC;AAAAA,WAAO;AAAA,MAAT,IAAmBC,wBAAnB,IAAmBA;AAAAA,IAAjBD;AAAAA;AAGF,gFAEQC;IACJ;AAAA,IACA,OAAO;AAAA,MAAEC,YAAYF,OAAO,WAAW;AAAA,IAHzC;AAAA,IAIE,WAAWG,UAAAA,SAAS;AAAA,MAClBC,OAAO;AAAA,MACPC,YAAY;AAAA,MACZC,QAAQ;AAAA,MACRC,SAAS;AAAA,IAAA,CAJQ;AAAA,IAOnB,yCAAA,OAAA;AAAA,MACE,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,OAAO;AAAA,QAAEC,UAAU;AAAA,MAJrB;AAAA,MAME,yCAAA,QAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,QACH,OAAM;AAAA,QACN,QAAO;AAAA,QACP,aAAa;AAAA,QACb,iBAAgB;AAAA,QAChB,MAAK;AAAA,QACL,QAAO;AAAA,QACP,IAAG;AAAA,QACH,IAAG;AAAA,MAAA,CAVL;AAAA,IAAA,CANF;AAAA,EAAA,EAZJ;AAiCD,CArCwB;AC4CnBC,MAAAA,MAAMX,MAAAA,WAAW,cACrB;AAAA,EACEY;AAAAA,EACAC;AAAAA,EACAP;AAAAA,EACAE;AAAAA,EACAM;AAAAA,EACAL;AAAAA,EACAM;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AA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,GACRhF,UAAAA,SAASoE,KAAAA,mBAAmB,CAACjE,MAAD,GAAU,CAAC,CAAC8E,YAAY,YAAa;AAAA,MAAEA;AAAAA,IAAAA,EAAxC,CAAnB,GACRrD,kBANW;AAAA,IAQb;AAAA,IAEA,yCAAA,OAAA;AAAA,MACE,KAAKH;AAAAA,MAEL,WAAWsD,IAAAA,GACT3E,SACAS,WACAH,QACAV,UAAAA,SAAS;AAAA,QAAEgF,SAAS;AAAA,QAAQE,UAAU;AAAA,QAAQjF,OAAO;AAAA,MAAA,CAA7C,GACRD,UAAAA,SACEoE,KAAAA,mBAAmB,CAACnD,aAAD,GAAiB,CAAC,CAACkE,eAAe,kBAAmB;AAAA,QACtEA;AAAAA,MADkC,EAAlB,CADZ,CALG;AAAA,MAYZxE,UAAAA,YAAYA,SAASyE,SAASC,SAAS,IACtC1E,SAASyE,SAASE,IAAI,CAACC,OAAOC,2CAC3BC,MAAAA,UAAD;AAAA,QAEE,WAAWtB;AAAAA,QACX,MAAMxD,SAAS+E;AAAAA,QAAAA,OACfF;AAAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QATF,yCAWGG,cAAD;AAAA,UAAS,SAASJ;AAAAA,QAAAA,CAAlB;AAAA,SAVKA,MAAMjB,GADb,CADF,mCAgBC,aAAD;AAAA,QAAa,MAAMtD;AAAAA,MAAAA,CAAnB;AAAA,OA9BGsD,GAFP;AAAA,EAAA,CAdJ;AAmDD,CA9JqB;;"}
|
package/dist/Box.es.js
CHANGED
|
@@ -32,27 +32,27 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
import { forwardRef, useRef, useCallback, useImperativeHandle, useState, useEffect } from "react";
|
|
33
33
|
import { cx } from "@emotion/css";
|
|
34
34
|
import { v4 } from "uuid";
|
|
35
|
-
import { n as
|
|
35
|
+
import { n as useResponsiveStyle, E as Element } from "./index.es.js";
|
|
36
|
+
import { Z as useStyle } from "./react-page.es.js";
|
|
36
37
|
import { jsx } from "react/jsx-runtime";
|
|
37
38
|
import { a as useBoxAnimation, b as areBoxAnimationPropsEqual, B as BackgroundsContainer, G as GridItem } from "./index.es2.js";
|
|
38
39
|
import { p as parse, c as createBox } from "./box-models.es.js";
|
|
39
40
|
import "use-sync-external-store/shim/with-selector";
|
|
40
41
|
import "next/dynamic";
|
|
41
|
-
import "./react-page.es.js";
|
|
42
|
-
import "redux";
|
|
43
|
-
import "redux-thunk";
|
|
44
42
|
import "./actions.es.js";
|
|
45
|
-
import "./state/breakpoints.es.js";
|
|
46
|
-
import "slate";
|
|
47
|
-
import "is-hotkey";
|
|
48
|
-
import "slate-react";
|
|
49
|
-
import "@emotion/serialize";
|
|
50
|
-
import "@emotion/utils";
|
|
51
43
|
import "./text-input.es.js";
|
|
52
44
|
import "./combobox.es.js";
|
|
45
|
+
import "./select.es.js";
|
|
46
|
+
import "slate";
|
|
53
47
|
import "use-sync-external-store/shim";
|
|
48
|
+
import "redux";
|
|
49
|
+
import "redux-thunk";
|
|
54
50
|
import "./types.es.js";
|
|
51
|
+
import "./deepEqual.es.js";
|
|
52
|
+
import "./state/breakpoints.es.js";
|
|
55
53
|
import "color";
|
|
54
|
+
import "@emotion/serialize";
|
|
55
|
+
import "@emotion/utils";
|
|
56
56
|
import "scroll-into-view-if-needed";
|
|
57
57
|
import "react-dom";
|
|
58
58
|
import "html-react-parser";
|
package/dist/Button.cjs.js
CHANGED
|
@@ -35,26 +35,26 @@ var React = require("react");
|
|
|
35
35
|
var ColorHelper = require("color");
|
|
36
36
|
var next = require("./index.cjs.js");
|
|
37
37
|
var index = require("./index.cjs3.js");
|
|
38
|
+
var reactPage = require("./react-page.cjs.js");
|
|
38
39
|
var css = require("@emotion/css");
|
|
39
40
|
var jsxRuntime = require("react/jsx-runtime");
|
|
40
41
|
require("use-sync-external-store/shim/with-selector");
|
|
41
42
|
require("next/dynamic");
|
|
42
|
-
require("./react-page.cjs.js");
|
|
43
|
-
require("redux");
|
|
44
|
-
require("redux-thunk");
|
|
45
43
|
require("./actions.cjs.js");
|
|
46
|
-
require("./state/breakpoints.cjs.js");
|
|
47
|
-
require("slate");
|
|
48
|
-
require("is-hotkey");
|
|
49
|
-
require("slate-react");
|
|
50
|
-
require("@emotion/serialize");
|
|
51
|
-
require("@emotion/utils");
|
|
52
44
|
require("./text-input.cjs.js");
|
|
53
45
|
require("./combobox.cjs.js");
|
|
46
|
+
require("./select.cjs.js");
|
|
47
|
+
require("slate");
|
|
54
48
|
require("use-sync-external-store/shim");
|
|
49
|
+
require("redux");
|
|
50
|
+
require("redux-thunk");
|
|
55
51
|
require("./types.cjs.js");
|
|
52
|
+
require("./deepEqual.cjs.js");
|
|
53
|
+
require("./state/breakpoints.cjs.js");
|
|
56
54
|
require("./box-models.cjs.js");
|
|
57
55
|
require("css-box-model");
|
|
56
|
+
require("@emotion/serialize");
|
|
57
|
+
require("@emotion/utils");
|
|
58
58
|
require("scroll-into-view-if-needed");
|
|
59
59
|
require("react-dom");
|
|
60
60
|
require("html-react-parser");
|
|
@@ -109,7 +109,7 @@ const Button = React.forwardRef(function Button2(_a, ref) {
|
|
|
109
109
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadProps(__spreadValues({}, restOfProps), {
|
|
110
110
|
ref,
|
|
111
111
|
id,
|
|
112
|
-
className: css.cx(
|
|
112
|
+
className: css.cx(reactPage.useStyle({
|
|
113
113
|
display: "table",
|
|
114
114
|
border: 0,
|
|
115
115
|
outline: 0,
|
|
@@ -118,7 +118,7 @@ const Button = React.forwardRef(function Button2(_a, ref) {
|
|
|
118
118
|
fontFamily: "inherit",
|
|
119
119
|
textDecoration: "none",
|
|
120
120
|
textAlign: "center"
|
|
121
|
-
}),
|
|
121
|
+
}), reactPage.useStyle(next.useResponsiveWidth(width, "auto")), margin, reactPage.useStyle(next.useResponsiveStyle([variant, shape, size, textColor, color], ([variant2 = "flat", shape2 = "rounded", size2 = "medium", textColor2 = {
|
|
122
122
|
swatch: {
|
|
123
123
|
hue: 0,
|
|
124
124
|
saturation: 0,
|
|
@@ -278,7 +278,7 @@ const Button = React.forwardRef(function Button2(_a, ref) {
|
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
}[variant2]);
|
|
281
|
-
})),
|
|
281
|
+
})), reactPage.useStyle(next.useResponsiveTextStyle(textStyle)), className),
|
|
282
282
|
link,
|
|
283
283
|
children: children == null ? "Button Text" : children
|
|
284
284
|
}));
|
package/dist/Button.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs.js","sources":["../src/components/builtin/Button/Button.tsx"],"sourcesContent":["import {\n ComponentPropsWithoutRef,\n ElementRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ReactNode,\n} from 'react'\nimport ColorHelper from 'color'\n\nimport {\n ElementIDValue,\n ResponsiveSelectValue,\n ResponsiveIconRadioGroupValue,\n TextStyleValue,\n LinkValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { Link } from '../../shared/Link'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { ButtonVariant } from './contants'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport {\n useResponsiveStyle,\n useResponsiveTextStyle,\n useResponsiveWidth,\n} from '../../utils/responsive-style'\nimport { cx } from '@emotion/css'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: ElementIDValue\n children?: ReactNode\n link?: LinkValue\n variant?: ResponsiveSelectValue<ButtonVariant>\n shape?: ResponsiveIconRadioGroupValue<'pill' | 'rounded' | 'square'>\n size?: ResponsiveIconRadioGroupValue<'small' | 'medium' | 'large'>\n color?: ResponsiveColor | null\n textColor?: ResponsiveColor | null\n textStyle?: TextStyleValue\n width?: WidthValue\n margin?: string\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<typeof Link>, keyof BaseProps<T>>\n\nconst Button = forwardRef(function Button<T extends ElementType = 'button'>(\n {\n as,\n id,\n children,\n link,\n variant,\n shape,\n size,\n textColor,\n color,\n textStyle,\n width,\n margin,\n className,\n ...restOfProps\n }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? Link\n\n return (\n // @ts-ignore: `ref` prop doesn't match between `Link` and `T`.\n <Component\n {...restOfProps}\n ref={ref}\n id={id}\n className={cx(\n useStyle({\n display: 'table',\n border: 0,\n outline: 0,\n userSelect: 'none',\n cursor: 'pointer',\n fontFamily: 'inherit',\n textDecoration: 'none',\n textAlign: 'center',\n }),\n useStyle(useResponsiveWidth(width, 'auto')),\n margin,\n useStyle(\n useResponsiveStyle(\n [variant, shape, size, textColor, color] as const,\n ([\n variant = 'flat',\n shape = 'rounded',\n size = 'medium',\n textColor = { swatch: { hue: 0, saturation: 0, lightness: 100 }, alpha: 1 },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n const fontSize = {\n value: { small: 12, medium: 14, large: 18 }[size],\n unit: 'px',\n }\n\n return {\n color: colorToString(textColor),\n borderRadius: `${{ square: 0, rounded: 4, pill: 500 }[shape]}px`,\n padding: `${{ small: '8px 12px', medium: '12px 16px', large: '16px 20px' }[size]}`,\n fontSize: `${fontSize.value}${fontSize.unit}`,\n ...{\n flat: {\n background: colorToString(color),\n border: 'none',\n transition: ['color', 'background', 'border', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n background: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n background: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n outline: {\n background: 'transparent',\n boxShadow: `inset 0 0 0 2px ${colorToString(color)}`,\n transition: ['color', 'background', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.1)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.15)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n shadow: {\n background: colorToString(color),\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2)',\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.18s`)\n .join(', '),\n\n ':hover': {\n boxShadow:\n '0 10px 25px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(-1px)',\n },\n\n ':active': {\n boxShadow:\n '0 4px 12px rgba(0, 0, 0, 0.15), 0 4px 6px -3px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(0px)',\n },\n },\n clear: {\n background: 'transparent',\n border: 'none',\n\n ':hover': {\n color: ColorHelper(colorToString(textColor)).alpha(0.5).toString(),\n },\n\n ':active': {\n color: ColorHelper(colorToString(textColor)).alpha(0.6).toString(),\n },\n },\n blocky: {\n background: colorToString(color),\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: ColorHelper(colorToString(color)).darken(0.25).hex(),\n boxShadow: `0 4px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.1s`)\n .join(', '),\n\n ':hover': {\n transform: 'translateY(2px)',\n boxShadow: `0 2px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n\n ':active': {\n transform: 'translateY(4px)',\n boxShadow: `0 0 ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n },\n bubbly: {\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.05).hex()},\n ${ColorHelper(colorToString(color)).darken(0.3).saturate(0.05).hex()}\n )`,\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n borderRadius: 'inherit',\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.2).hex()},\n ${ColorHelper(colorToString(color)).darken(0.2).saturate(0.05).hex()}\n )`,\n opacity: '0',\n transition: 'opacity 0.15s',\n },\n\n ':hover': {\n ':before': {\n opacity: '1',\n },\n },\n\n ':active': {\n ':before': {\n opacity: '0.25',\n },\n },\n } as const,\n skewed: {\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n background: colorToString(color),\n transform: 'skewX(-12deg)',\n borderRadius: 'inherit',\n transition: 'transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75)',\n },\n\n ':hover:before': {\n transform: 'skew(0deg)',\n },\n\n ':active:before': {\n transform: 'skew(-8deg)',\n },\n } as const,\n }[variant],\n }\n },\n ),\n ),\n useStyle(useResponsiveTextStyle(textStyle)),\n className,\n )}\n link={link}\n >\n {children == null ? 'Button Text' : children}\n </Component>\n )\n})\n\nexport default Button\n"],"names":["Button","forwardRef","ref","as","id","children","link","variant","shape","size","textColor","color","textStyle","width","margin","className","restOfProps","Component","Link","cx","useStyle","display","border","outline","userSelect","cursor","fontFamily","textDecoration","textAlign","useResponsiveWidth","useResponsiveStyle","swatch","hue","saturation","lightness","alpha","fontSize","value","small","medium","large","unit","colorToString","borderRadius","square","rounded","pill","padding","flat","background","transition","map","property","join","ColorHelper","darken","hex","boxShadow","shadow","transform","clear","toString","blocky","borderWidth","borderStyle","borderColor","bubbly","lighten","saturate","position","zIndex","content","top","right","bottom","left","opacity","skewed","useResponsiveTextStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDMA,MAAAA,SAASC,MAAAA,WAAW,iBACxB,IAgBAC,KACA;AAjBA,eACEC;AAAAA;AAAAA,IACAC;AAAAA,IACAC;AAAAA,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AA,UACVC,QAAQ;AAAA,UAEG,WAAA;AAAA,YACTD,UAAU;AAAA,YACVE,SAAS;AAAA,YACTC,KAAK;AAAA,YACLC,OAAO;AAAA,YACPC,QAAQ;AAAA,YACRC,MAAM;AAAA,YACNL,QAAQ;AAAA,YACRrB,YAAYP,mBAAc/B,MAAD;AAAA,YACzBgD,WAAW;AAAA,YACXhB,cAAc;AAAA,YACdO,YAAY;AAAA,UAfR;AAAA,UAkBW,iBAAA;AAAA,YACfS,WAAW;AAAA,UAnBP;AAAA,UAsBY,kBAAA;AAAA,YAChBA,WAAW;AAAA,UADK;AAAA,QAtBZ;AAAA,MA0BRpD,EAAAA;AAAAA,IA9JJ,CAdc,CADZ,GAkLRa,KAAAA,SAAS0D,KAAAA,uBAAuBlE,SAAD,CAAvB,GACRG,SAhMW;AAAA,IAkMb;AAAA,IAtMF,UAwMGV,YAAY,OAAO,gBAAgBA;AAAAA,EAAAA,EAxMtC;AA2MH,CAlOwB;;"}
|
|
1
|
+
{"version":3,"file":"Button.cjs.js","sources":["../src/components/builtin/Button/Button.tsx"],"sourcesContent":["import {\n ComponentPropsWithoutRef,\n ElementRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ReactNode,\n} from 'react'\nimport ColorHelper from 'color'\n\nimport {\n ElementIDValue,\n ResponsiveSelectValue,\n ResponsiveIconRadioGroupValue,\n TextStyleValue,\n LinkValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { Link } from '../../shared/Link'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { ButtonVariant } from './contants'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport {\n useResponsiveStyle,\n useResponsiveTextStyle,\n useResponsiveWidth,\n} from '../../utils/responsive-style'\nimport { cx } from '@emotion/css'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n id?: ElementIDValue\n children?: ReactNode\n link?: LinkValue\n variant?: ResponsiveSelectValue<ButtonVariant>\n shape?: ResponsiveIconRadioGroupValue<'pill' | 'rounded' | 'square'>\n size?: ResponsiveIconRadioGroupValue<'small' | 'medium' | 'large'>\n color?: ResponsiveColor | null\n textColor?: ResponsiveColor | null\n textStyle?: TextStyleValue\n width?: WidthValue\n margin?: string\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<typeof Link>, keyof BaseProps<T>>\n\nconst Button = forwardRef(function Button<T extends ElementType = 'button'>(\n {\n as,\n id,\n children,\n link,\n variant,\n shape,\n size,\n textColor,\n color,\n textStyle,\n width,\n margin,\n className,\n ...restOfProps\n }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? Link\n\n return (\n // @ts-ignore: `ref` prop doesn't match between `Link` and `T`.\n <Component\n {...restOfProps}\n ref={ref}\n id={id}\n className={cx(\n useStyle({\n display: 'table',\n border: 0,\n outline: 0,\n userSelect: 'none',\n cursor: 'pointer',\n fontFamily: 'inherit',\n textDecoration: 'none',\n textAlign: 'center',\n }),\n useStyle(useResponsiveWidth(width, 'auto')),\n margin,\n useStyle(\n useResponsiveStyle(\n [variant, shape, size, textColor, color] as const,\n ([\n variant = 'flat',\n shape = 'rounded',\n size = 'medium',\n textColor = { swatch: { hue: 0, saturation: 0, lightness: 100 }, alpha: 1 },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n const fontSize = {\n value: { small: 12, medium: 14, large: 18 }[size],\n unit: 'px',\n }\n\n return {\n color: colorToString(textColor),\n borderRadius: `${{ square: 0, rounded: 4, pill: 500 }[shape]}px`,\n padding: `${{ small: '8px 12px', medium: '12px 16px', large: '16px 20px' }[size]}`,\n fontSize: `${fontSize.value}${fontSize.unit}`,\n ...{\n flat: {\n background: colorToString(color),\n border: 'none',\n transition: ['color', 'background', 'border', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n background: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n background: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n outline: {\n background: 'transparent',\n boxShadow: `inset 0 0 0 2px ${colorToString(color)}`,\n transition: ['color', 'background', 'box-shadow']\n .map(property => `${property} 0.15s ease-in-out`)\n .join(', '),\n\n ':hover': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.1)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.1).hex(),\n },\n\n ':active': {\n boxShadow: `inset 0 0 0 2px ${ColorHelper(colorToString(color))\n .darken(0.15)\n .hex()}`,\n color: ColorHelper(colorToString(color)).darken(0.15).hex(),\n },\n },\n shadow: {\n background: colorToString(color),\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2)',\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.18s`)\n .join(', '),\n\n ':hover': {\n boxShadow:\n '0 10px 25px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(-1px)',\n },\n\n ':active': {\n boxShadow:\n '0 4px 12px rgba(0, 0, 0, 0.15), 0 4px 6px -3px rgba(0, 0, 0, 0.3)',\n transform: 'translateY(0px)',\n },\n },\n clear: {\n background: 'transparent',\n border: 'none',\n\n ':hover': {\n color: ColorHelper(colorToString(textColor)).alpha(0.5).toString(),\n },\n\n ':active': {\n color: ColorHelper(colorToString(textColor)).alpha(0.6).toString(),\n },\n },\n blocky: {\n background: colorToString(color),\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: ColorHelper(colorToString(color)).darken(0.25).hex(),\n boxShadow: `0 4px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n transition: ['transform', 'box-shadow']\n .map(property => `${property} 0.1s`)\n .join(', '),\n\n ':hover': {\n transform: 'translateY(2px)',\n boxShadow: `0 2px ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n\n ':active': {\n transform: 'translateY(4px)',\n boxShadow: `0 0 ${ColorHelper(colorToString(color)).darken(0.25).hex()}`,\n },\n },\n bubbly: {\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.05).hex()},\n ${ColorHelper(colorToString(color)).darken(0.3).saturate(0.05).hex()}\n )`,\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n borderRadius: 'inherit',\n background: `linear-gradient(\n 180deg,\n ${ColorHelper(colorToString(color)).lighten(0.2).hex()},\n ${ColorHelper(colorToString(color)).darken(0.2).saturate(0.05).hex()}\n )`,\n opacity: '0',\n transition: 'opacity 0.15s',\n },\n\n ':hover': {\n ':before': {\n opacity: '1',\n },\n },\n\n ':active': {\n ':before': {\n opacity: '0.25',\n },\n },\n } as const,\n skewed: {\n position: 'relative',\n zIndex: '0',\n\n ':before': {\n position: 'absolute',\n content: '\"\"',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n zIndex: '-1',\n background: colorToString(color),\n transform: 'skewX(-12deg)',\n borderRadius: 'inherit',\n transition: 'transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75)',\n },\n\n ':hover:before': {\n transform: 'skew(0deg)',\n },\n\n ':active:before': {\n transform: 'skew(-8deg)',\n },\n } as const,\n }[variant],\n }\n },\n ),\n ),\n useStyle(useResponsiveTextStyle(textStyle)),\n className,\n )}\n link={link}\n >\n {children == null ? 'Button Text' : children}\n </Component>\n )\n})\n\nexport default Button\n"],"names":["Button","forwardRef","ref","as","id","children","link","variant","shape","size","textColor","color","textStyle","width","margin","className","restOfProps","Component","Link","cx","useStyle","display","border","outline","userSelect","cursor","fontFamily","textDecoration","textAlign","useResponsiveWidth","useResponsiveStyle","swatch","hue","saturation","lightness","alpha","fontSize","value","small","medium","large","unit","colorToString","borderRadius","square","rounded","pill","padding","flat","background","transition","map","property","join","ColorHelper","darken","hex","boxShadow","shadow","transform","clear","toString","blocky","borderWidth","borderStyle","borderColor","bubbly","lighten","saturate","position","zIndex","content","top","right","bottom","left","opacity","skewed","useResponsiveTextStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDMA,MAAAA,SAASC,MAAAA,WAAW,iBACxB,IAgBAC,KACA;AAjBA,eACEC;AAAAA;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,MAbF,IAcKC,wBAdL,IAcKA;AAAAA,IAbHb;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA;AAKF,QAAME,YAAYd,kBAAMe;AAExB,wCAEG,4CACKF;IACJ;AAAA,IACA;AAAA,IACA,WAAWG,OACTC,mBAAS;AAAA,MACPC,SAAS;AAAA,MACTC,QAAQ;AAAA,MACRC,SAAS;AAAA,MACTC,YAAY;AAAA,MACZC,QAAQ;AAAA,MACRC,YAAY;AAAA,MACZC,gBAAgB;AAAA,MAChBC,WAAW;AAAA,IARL,CAAA,GAURR,UAAAA,SAASS,wBAAmBhB,OAAO,MAAR,CAAnB,GACRC,QACAM,UACEU,SAAAA,wBACE,CAACvB,SAASC,OAAOC,MAAMC,WAAWC,KAAlC,GACA,CAAC,CACCJ,WAAU,QACVC,SAAQ,WACRC,QAAO,UACPC,aAAY;AAAA,MAAEqB,QAAQ;AAAA,QAAEC,KAAK;AAAA,QAAGC,YAAY;AAAA,QAAGC,WAAW;AAAA,MAA9C;AAAA,MAAqDC,OAAO;AAAA,OACxExB,SAAQ;AAAA,MA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ca,SAAS,IAAvD,EAA6DZ,IAAM;AAAA;AAAA,YAEvEoB,SAAS;AAAA,YACT1B,YAAY;AAAA,UAxBR;AAAA,UA2BI,UAAA;AAAA,YACG,WAAA;AAAA,cACT0B,SAAS;AAAA,YADA;AAAA,UA5BP;AAAA,UAiCK,WAAA;AAAA,YACE,WAAA;AAAA,cACTA,SAAS;AAAA,YADA;AAAA,UADF;AAAA,QAjCL;AAAA,QAuCRC,QAAQ;AAAA,UACNR,UAAU;AAAA,UACVC,QAAQ;AAAA,UAEG,WAAA;AAAA,YACTD,UAAU;AAAA,YACVE,SAAS;AAAA,YACTC,KAAK;AAAA,YACLC,OAAO;AAAA,YACPC,QAAQ;AAAA,YACRC,MAAM;AAAA,YACNL,QAAQ;AAAA,YACRrB,YAAYP,mBAAc/B,MAAD;AAAA,YACzBgD,WAAW;AAAA,YACXhB,cAAc;AAAA,YACdO,YAAY;AAAA,UAfR;AAAA,UAkBW,iBAAA;AAAA,YACfS,WAAW;AAAA,UAnBP;AAAA,UAsBY,kBAAA;AAAA,YAChBA,WAAW;AAAA,UADK;AAAA,QAtBZ;AAAA,MA0BRpD,EAAAA;AAAAA,IA9JJ,CAdc,CADZ,GAkLRa,UAAAA,SAAS0D,KAAAA,uBAAuBlE,SAAD,CAAvB,GACRG,SAhMW;AAAA,IAkMb;AAAA,IAtMF,UAwMGV,YAAY,OAAO,gBAAgBA;AAAAA,EAAAA,EAxMtC;AA2MH,CAlOwB;;"}
|
package/dist/Button.es.js
CHANGED
|
@@ -31,28 +31,28 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
};
|
|
32
32
|
import { forwardRef } from "react";
|
|
33
33
|
import ColorHelper from "color";
|
|
34
|
-
import {
|
|
34
|
+
import { o as useResponsiveWidth, n as useResponsiveStyle, p as useResponsiveTextStyle, q as colorToString } from "./index.es.js";
|
|
35
35
|
import { L as Link } from "./index.es3.js";
|
|
36
|
+
import { Z as useStyle } from "./react-page.es.js";
|
|
36
37
|
import { cx } from "@emotion/css";
|
|
37
38
|
import { jsx } from "react/jsx-runtime";
|
|
38
39
|
import "use-sync-external-store/shim/with-selector";
|
|
39
40
|
import "next/dynamic";
|
|
40
|
-
import "./react-page.es.js";
|
|
41
|
-
import "redux";
|
|
42
|
-
import "redux-thunk";
|
|
43
41
|
import "./actions.es.js";
|
|
44
|
-
import "./state/breakpoints.es.js";
|
|
45
|
-
import "slate";
|
|
46
|
-
import "is-hotkey";
|
|
47
|
-
import "slate-react";
|
|
48
|
-
import "@emotion/serialize";
|
|
49
|
-
import "@emotion/utils";
|
|
50
42
|
import "./text-input.es.js";
|
|
51
43
|
import "./combobox.es.js";
|
|
44
|
+
import "./select.es.js";
|
|
45
|
+
import "slate";
|
|
52
46
|
import "use-sync-external-store/shim";
|
|
47
|
+
import "redux";
|
|
48
|
+
import "redux-thunk";
|
|
53
49
|
import "./types.es.js";
|
|
50
|
+
import "./deepEqual.es.js";
|
|
51
|
+
import "./state/breakpoints.es.js";
|
|
54
52
|
import "./box-models.es.js";
|
|
55
53
|
import "css-box-model";
|
|
54
|
+
import "@emotion/serialize";
|
|
55
|
+
import "@emotion/utils";
|
|
56
56
|
import "scroll-into-view-if-needed";
|
|
57
57
|
import "react-dom";
|
|
58
58
|
import "html-react-parser";
|
package/dist/Carousel.cjs.js
CHANGED
|
@@ -37,28 +37,28 @@ var react = require("@use-gesture/react");
|
|
|
37
37
|
var popcorn = require("@popmotion/popcorn");
|
|
38
38
|
var next = require("./index.cjs.js");
|
|
39
39
|
require("use-sync-external-store/shim");
|
|
40
|
-
require("./react-page.cjs.js");
|
|
40
|
+
var reactPage = require("./react-page.cjs.js");
|
|
41
41
|
require("slate");
|
|
42
|
-
var state_breakpoints = require("./state/breakpoints.cjs.js");
|
|
43
|
-
require("is-hotkey");
|
|
44
|
-
require("slate-react");
|
|
45
42
|
var useMediaQuery = require("./useMediaQuery.cjs.js");
|
|
46
43
|
var Image = require("./Image.cjs.js");
|
|
47
44
|
var css = require("@emotion/css");
|
|
45
|
+
var state_breakpoints = require("./state/breakpoints.cjs.js");
|
|
48
46
|
var jsxRuntime = require("react/jsx-runtime");
|
|
49
47
|
require("use-sync-external-store/shim/with-selector");
|
|
50
48
|
require("next/dynamic");
|
|
51
49
|
require("./actions.cjs.js");
|
|
52
|
-
require("@emotion/serialize");
|
|
53
|
-
require("@emotion/utils");
|
|
54
50
|
require("./text-input.cjs.js");
|
|
55
51
|
require("./combobox.cjs.js");
|
|
52
|
+
require("./select.cjs.js");
|
|
56
53
|
require("redux");
|
|
57
54
|
require("redux-thunk");
|
|
58
55
|
require("./types.cjs.js");
|
|
56
|
+
require("./deepEqual.cjs.js");
|
|
59
57
|
require("./box-models.cjs.js");
|
|
60
58
|
require("css-box-model");
|
|
61
59
|
require("color");
|
|
60
|
+
require("@emotion/serialize");
|
|
61
|
+
require("@emotion/utils");
|
|
62
62
|
require("scroll-into-view-if-needed");
|
|
63
63
|
require("react-dom");
|
|
64
64
|
require("html-react-parser");
|
|
@@ -194,27 +194,27 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
194
194
|
const intervalId = setInterval(() => isLastPage ? setIndex(0) : paginate(1), delay * 1e3);
|
|
195
195
|
return () => clearInterval(intervalId);
|
|
196
196
|
}, [autoplay, delay, paginate, isLastPage]);
|
|
197
|
-
const clipMaskClassName =
|
|
197
|
+
const clipMaskClassName = reactPage.useStyle({
|
|
198
198
|
overflow: "hidden"
|
|
199
199
|
});
|
|
200
|
-
const pageClassName =
|
|
200
|
+
const pageClassName = reactPage.useStyle({
|
|
201
201
|
position: "relative",
|
|
202
202
|
width: "100%"
|
|
203
203
|
});
|
|
204
|
-
const slideClassName = css.cx(
|
|
204
|
+
const slideClassName = css.cx(reactPage.useStyle({
|
|
205
205
|
display: "flex"
|
|
206
|
-
}),
|
|
206
|
+
}), reactPage.useStyle(next.useResponsiveStyle([responsivePageSize], ([pageSize2 = 1]) => ({
|
|
207
207
|
flexBasis: `${100 / pageSize2}%`,
|
|
208
208
|
maxWidth: `${100 / pageSize2}%`,
|
|
209
209
|
minWidth: `${100 / pageSize2}%`
|
|
210
|
-
}))),
|
|
210
|
+
}))), reactPage.useStyle(next.useResponsiveStyle([slideAlignment], ([alignItems = "center"]) => ({
|
|
211
211
|
alignItems
|
|
212
212
|
}))));
|
|
213
|
-
const reelClassName = css.cx(
|
|
213
|
+
const reelClassName = css.cx(reactPage.useStyle({
|
|
214
214
|
display: "flex",
|
|
215
215
|
position: "relative",
|
|
216
216
|
flexWrap: "nowrap"
|
|
217
|
-
}),
|
|
217
|
+
}), reactPage.useStyle(next.useResponsiveStyle([gap], ([gap2 = {
|
|
218
218
|
value: 0,
|
|
219
219
|
unit: "px"
|
|
220
220
|
}]) => ({
|
|
@@ -223,7 +223,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
223
223
|
padding: `0 ${`${gap2.value / 2}${gap2.unit}`}`
|
|
224
224
|
}
|
|
225
225
|
}))));
|
|
226
|
-
const arrowClassName = css.cx(
|
|
226
|
+
const arrowClassName = css.cx(reactPage.useStyle({
|
|
227
227
|
padding: 10,
|
|
228
228
|
borderRadius: "50%",
|
|
229
229
|
outline: 0,
|
|
@@ -235,7 +235,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
235
235
|
justifyContent: "center",
|
|
236
236
|
cursor: "pointer",
|
|
237
237
|
userSelect: "none"
|
|
238
|
-
}),
|
|
238
|
+
}), reactPage.useStyle(next.useResponsiveStyle([arrowBackground], ([background = {
|
|
239
239
|
swatch: {
|
|
240
240
|
hue: 0,
|
|
241
241
|
saturation: 0,
|
|
@@ -244,13 +244,13 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
244
244
|
alpha: 1
|
|
245
245
|
}]) => ({
|
|
246
246
|
background: next.colorToString(background)
|
|
247
|
-
}))),
|
|
247
|
+
}))), reactPage.useStyle({
|
|
248
248
|
svg: {
|
|
249
249
|
transition: "transform 0.15s",
|
|
250
250
|
stroke: "currentcolor"
|
|
251
251
|
}
|
|
252
252
|
}));
|
|
253
|
-
const slopClassName = css.cx(
|
|
253
|
+
const slopClassName = css.cx(reactPage.useStyle({
|
|
254
254
|
position: "absolute",
|
|
255
255
|
top: 0,
|
|
256
256
|
bottom: 0,
|
|
@@ -261,7 +261,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
261
261
|
alignItems: "center",
|
|
262
262
|
cursor: "pointer",
|
|
263
263
|
zIndex: 2
|
|
264
|
-
}),
|
|
264
|
+
}), reactPage.useStyle(next.useResponsiveStyle([arrowColor], ([color = {
|
|
265
265
|
swatch: {
|
|
266
266
|
hue: 0,
|
|
267
267
|
saturation: 0,
|
|
@@ -271,7 +271,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
271
271
|
}]) => ({
|
|
272
272
|
color: next.colorToString(color)
|
|
273
273
|
}))));
|
|
274
|
-
const leftSlopClassName = css.cx(slopClassName,
|
|
274
|
+
const leftSlopClassName = css.cx(slopClassName, reactPage.useStyle(next.useResponsiveStyle([arrowPosition], ([position = "inside"]) => {
|
|
275
275
|
switch (position) {
|
|
276
276
|
case "inside":
|
|
277
277
|
return {
|
|
@@ -286,7 +286,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
286
286
|
transform: "translateX(calc(-50%))"
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
})),
|
|
289
|
+
})), reactPage.useStyle({
|
|
290
290
|
left: 0,
|
|
291
291
|
[`&:hover > .${arrowClassName}`]: {
|
|
292
292
|
"& > svg": {
|
|
@@ -294,7 +294,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}));
|
|
297
|
-
const rightSlopClassName = css.cx(slopClassName,
|
|
297
|
+
const rightSlopClassName = css.cx(slopClassName, reactPage.useStyle(next.useResponsiveStyle([arrowPosition], ([position = "inside"]) => {
|
|
298
298
|
switch (position) {
|
|
299
299
|
case "inside":
|
|
300
300
|
return {
|
|
@@ -309,7 +309,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
309
309
|
transform: "translateX(calc(50%))"
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
-
})),
|
|
312
|
+
})), reactPage.useStyle({
|
|
313
313
|
right: 0,
|
|
314
314
|
[`&:hover > .${arrowClassName}`]: {
|
|
315
315
|
"& > svg": {
|
|
@@ -317,11 +317,11 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}));
|
|
320
|
-
const dotsClassName = css.cx(
|
|
320
|
+
const dotsClassName = css.cx(reactPage.useStyle({
|
|
321
321
|
display: showDots ? "flex" : "none",
|
|
322
322
|
justifyContent: "center",
|
|
323
323
|
marginTop: 20
|
|
324
|
-
}),
|
|
324
|
+
}), reactPage.useStyle(next.useResponsiveStyle([dotColor], ([color = {
|
|
325
325
|
swatch: {
|
|
326
326
|
hue: 0,
|
|
327
327
|
saturation: 0,
|
|
@@ -333,11 +333,11 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
333
333
|
}))));
|
|
334
334
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
335
335
|
ref,
|
|
336
|
-
className: css.cx(
|
|
336
|
+
className: css.cx(reactPage.useStyle({
|
|
337
337
|
position: "relative",
|
|
338
338
|
display: "flex",
|
|
339
339
|
flexDirection: "column"
|
|
340
|
-
}), width, margin,
|
|
340
|
+
}), width, margin, reactPage.useStyle({
|
|
341
341
|
"&:focus": {
|
|
342
342
|
outline: 0
|
|
343
343
|
}
|
|
@@ -354,7 +354,7 @@ const Carousel = React.forwardRef(function Carousel2({
|
|
|
354
354
|
}
|
|
355
355
|
},
|
|
356
356
|
children: [/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
357
|
-
className:
|
|
357
|
+
className: reactPage.useStyle({
|
|
358
358
|
position: "relative",
|
|
359
359
|
height: "100%"
|
|
360
360
|
}),
|
|
@@ -440,7 +440,7 @@ function Dot(_a) {
|
|
|
440
440
|
"active"
|
|
441
441
|
]);
|
|
442
442
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
443
|
-
className: css.cx(
|
|
443
|
+
className: css.cx(reactPage.useStyle({
|
|
444
444
|
position: "relative",
|
|
445
445
|
margin: "0 6px",
|
|
446
446
|
borderRadius: "50%",
|