@nation-a/ui 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +385 -118
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +385 -118
- package/dist/index.js.map +1 -1
- package/dist/styled-system/jsx/aspect-ratio.mjs +3 -2
- package/dist/styled-system/jsx/bleed.mjs +3 -2
- package/dist/styled-system/jsx/box.mjs +3 -2
- package/dist/styled-system/jsx/center.mjs +3 -2
- package/dist/styled-system/jsx/circle.mjs +3 -2
- package/dist/styled-system/jsx/container.mjs +3 -2
- package/dist/styled-system/jsx/cq.mjs +3 -2
- package/dist/styled-system/jsx/divider.mjs +3 -2
- package/dist/styled-system/jsx/flex.mjs +3 -2
- package/dist/styled-system/jsx/float.mjs +3 -2
- package/dist/styled-system/jsx/grid-item.mjs +3 -2
- package/dist/styled-system/jsx/grid.mjs +3 -2
- package/dist/styled-system/jsx/hstack.mjs +3 -2
- package/dist/styled-system/jsx/is-valid-prop.mjs +3 -4
- package/dist/styled-system/jsx/link-overlay.mjs +3 -2
- package/dist/styled-system/jsx/spacer.mjs +3 -2
- package/dist/styled-system/jsx/square.mjs +3 -2
- package/dist/styled-system/jsx/stack.mjs +3 -2
- package/dist/styled-system/jsx/visually-hidden.mjs +3 -2
- package/dist/styled-system/jsx/vstack.mjs +3 -2
- package/dist/styled-system/jsx/wrap.mjs +3 -2
- package/dist/styled-system/styles.css +1850 -1162
- package/dist/styled-system/types/system-types.d.ts +2 -2
- package/dist/types/components/BottomSheet/index.d.ts +8 -8
- package/dist/types/components/Button/index.d.ts +288 -5
- package/dist/types/components/Dialog/dialog.recipe.d.ts +1 -1
- package/dist/types/components/Dialog/index.d.ts +28 -17
- package/dist/types/components/IconButton/index.d.ts +8 -10
- package/dist/types/components/Layout/index.d.ts +42 -0
- package/dist/types/components/Navigation/index.d.ts +9 -15
- package/dist/types/components/Navigation/navigation.recipe.d.ts +1 -1
- package/dist/types/components/Spinner/index.d.ts +3 -19
- package/dist/types/components/Tag/index.d.ts +3 -7
- package/dist/types/components/Tag/tag.recipe.d.ts +1 -1
- package/dist/types/components/Text/index.d.ts +3 -6
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/utils/with-polymorphic-component.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,6 +2,16 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { forwardRef, useMemo, createElement, createContext as createContext$1, useContext, useRef, useLayoutEffect, useEffect, useState, memo as memo$1, Children, isValidElement, cloneElement, useCallback, useId, useSyncExternalStore } from "react";
|
|
4
4
|
import { flushSync, createPortal, unstable_batchedUpdates } from "react-dom";
|
|
5
|
+
function withPolymorphicComponent(Component) {
|
|
6
|
+
const PolymorphicComponent = React.forwardRef(
|
|
7
|
+
(props, ref) => {
|
|
8
|
+
const { as, ...restProps } = props;
|
|
9
|
+
return /* @__PURE__ */ jsx(Component, { as, ref, ...restProps });
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
PolymorphicComponent.displayName = `withPolymorphic(${Component.displayName || "Component"})`;
|
|
13
|
+
return PolymorphicComponent;
|
|
14
|
+
}
|
|
5
15
|
function isObject$1(value) {
|
|
6
16
|
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
7
17
|
}
|
|
@@ -103,8 +113,8 @@ function mapObject(obj, fn) {
|
|
|
103
113
|
}
|
|
104
114
|
function toResponsiveObject(values, breakpoints2) {
|
|
105
115
|
return values.reduce(
|
|
106
|
-
(acc, current,
|
|
107
|
-
const key = breakpoints2[
|
|
116
|
+
(acc, current, index2) => {
|
|
117
|
+
const key = breakpoints2[index2];
|
|
108
118
|
if (current != null) {
|
|
109
119
|
acc[key] = current;
|
|
110
120
|
}
|
|
@@ -440,15 +450,15 @@ function sva(config2) {
|
|
|
440
450
|
getVariantProps
|
|
441
451
|
});
|
|
442
452
|
}
|
|
443
|
-
var userGeneratedStr = "css
|
|
453
|
+
var userGeneratedStr = "css";
|
|
444
454
|
var userGenerated = userGeneratedStr.split(",");
|
|
445
|
-
var cssPropertiesStr = "
|
|
455
|
+
var cssPropertiesStr = "";
|
|
446
456
|
var allCssProperties = cssPropertiesStr.split(",").concat(userGenerated);
|
|
447
457
|
var properties = new Map(allCssProperties.map((prop) => [prop, true]));
|
|
448
458
|
var cssPropertySelectorRegex = /&|@/;
|
|
449
|
-
var isCssProperty =
|
|
459
|
+
var isCssProperty = (prop) => {
|
|
450
460
|
return properties.has(prop) || prop.startsWith("--") || cssPropertySelectorRegex.test(prop);
|
|
451
|
-
}
|
|
461
|
+
};
|
|
452
462
|
const defaultShouldForwardProp = (prop, variantKeys) => !variantKeys.includes(prop) && !isCssProperty(prop);
|
|
453
463
|
const composeShouldForwardProps = (tag, shouldForwardProp2) => tag.__shouldForwardProps__ && shouldForwardProp2 ? (propName) => tag.__shouldForwardProps__(propName) && shouldForwardProp2(propName) : shouldForwardProp2;
|
|
454
464
|
const composeCvaFn = (cvaA, cvaB) => {
|
|
@@ -523,6 +533,124 @@ function createJsxFactory() {
|
|
|
523
533
|
});
|
|
524
534
|
}
|
|
525
535
|
const styled = /* @__PURE__ */ createJsxFactory();
|
|
536
|
+
const boxConfig = {
|
|
537
|
+
transform(props) {
|
|
538
|
+
return props;
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
const getBoxStyle = (styles = {}) => {
|
|
542
|
+
const _styles = getPatternStyles(boxConfig, styles);
|
|
543
|
+
return boxConfig.transform(_styles, patternFns);
|
|
544
|
+
};
|
|
545
|
+
const Box$1 = /* @__PURE__ */ forwardRef(function Box(props, ref) {
|
|
546
|
+
const [patternProps, restProps] = splitProps(props, []);
|
|
547
|
+
const styleProps = getBoxStyle(patternProps);
|
|
548
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
549
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
550
|
+
return createElement(styled.div, mergedProps);
|
|
551
|
+
});
|
|
552
|
+
const flexConfig = {
|
|
553
|
+
transform(props) {
|
|
554
|
+
const { direction, align, justify, wrap: wrap2, basis, grow, shrink, ...rest } = props;
|
|
555
|
+
return {
|
|
556
|
+
display: "flex",
|
|
557
|
+
flexDirection: direction,
|
|
558
|
+
alignItems: align,
|
|
559
|
+
justifyContent: justify,
|
|
560
|
+
flexWrap: wrap2,
|
|
561
|
+
flexBasis: basis,
|
|
562
|
+
flexGrow: grow,
|
|
563
|
+
flexShrink: shrink,
|
|
564
|
+
...rest
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const getFlexStyle = (styles = {}) => {
|
|
569
|
+
const _styles = getPatternStyles(flexConfig, styles);
|
|
570
|
+
return flexConfig.transform(_styles, patternFns);
|
|
571
|
+
};
|
|
572
|
+
const Flex$1 = /* @__PURE__ */ forwardRef(function Flex(props, ref) {
|
|
573
|
+
const [patternProps, restProps] = splitProps(props, ["align", "justify", "direction", "wrap", "basis", "grow", "shrink"]);
|
|
574
|
+
const styleProps = getFlexStyle(patternProps);
|
|
575
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
576
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
577
|
+
return createElement(styled.div, mergedProps);
|
|
578
|
+
});
|
|
579
|
+
const stackConfig = {
|
|
580
|
+
transform(props) {
|
|
581
|
+
const { align, justify, direction, gap, ...rest } = props;
|
|
582
|
+
return {
|
|
583
|
+
display: "flex",
|
|
584
|
+
flexDirection: direction,
|
|
585
|
+
alignItems: align,
|
|
586
|
+
justifyContent: justify,
|
|
587
|
+
gap,
|
|
588
|
+
...rest
|
|
589
|
+
};
|
|
590
|
+
},
|
|
591
|
+
defaultValues: { direction: "column", gap: "10px" }
|
|
592
|
+
};
|
|
593
|
+
const getStackStyle = (styles = {}) => {
|
|
594
|
+
const _styles = getPatternStyles(stackConfig, styles);
|
|
595
|
+
return stackConfig.transform(_styles, patternFns);
|
|
596
|
+
};
|
|
597
|
+
const Stack$1 = /* @__PURE__ */ forwardRef(function Stack(props, ref) {
|
|
598
|
+
const [patternProps, restProps] = splitProps(props, ["align", "justify", "direction", "gap"]);
|
|
599
|
+
const styleProps = getStackStyle(patternProps);
|
|
600
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
601
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
602
|
+
return createElement(styled.div, mergedProps);
|
|
603
|
+
});
|
|
604
|
+
const vstackConfig = {
|
|
605
|
+
transform(props) {
|
|
606
|
+
const { justify, gap, ...rest } = props;
|
|
607
|
+
return {
|
|
608
|
+
display: "flex",
|
|
609
|
+
alignItems: "center",
|
|
610
|
+
justifyContent: justify,
|
|
611
|
+
gap,
|
|
612
|
+
flexDirection: "column",
|
|
613
|
+
...rest
|
|
614
|
+
};
|
|
615
|
+
},
|
|
616
|
+
defaultValues: { gap: "10px" }
|
|
617
|
+
};
|
|
618
|
+
const getVstackStyle = (styles = {}) => {
|
|
619
|
+
const _styles = getPatternStyles(vstackConfig, styles);
|
|
620
|
+
return vstackConfig.transform(_styles, patternFns);
|
|
621
|
+
};
|
|
622
|
+
const VStack$1 = /* @__PURE__ */ forwardRef(function VStack(props, ref) {
|
|
623
|
+
const [patternProps, restProps] = splitProps(props, ["justify", "gap"]);
|
|
624
|
+
const styleProps = getVstackStyle(patternProps);
|
|
625
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
626
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
627
|
+
return createElement(styled.div, mergedProps);
|
|
628
|
+
});
|
|
629
|
+
const hstackConfig = {
|
|
630
|
+
transform(props) {
|
|
631
|
+
const { justify, gap, ...rest } = props;
|
|
632
|
+
return {
|
|
633
|
+
display: "flex",
|
|
634
|
+
alignItems: "center",
|
|
635
|
+
justifyContent: justify,
|
|
636
|
+
gap,
|
|
637
|
+
flexDirection: "row",
|
|
638
|
+
...rest
|
|
639
|
+
};
|
|
640
|
+
},
|
|
641
|
+
defaultValues: { gap: "10px" }
|
|
642
|
+
};
|
|
643
|
+
const getHstackStyle = (styles = {}) => {
|
|
644
|
+
const _styles = getPatternStyles(hstackConfig, styles);
|
|
645
|
+
return hstackConfig.transform(_styles, patternFns);
|
|
646
|
+
};
|
|
647
|
+
const HStack$1 = /* @__PURE__ */ forwardRef(function HStack(props, ref) {
|
|
648
|
+
const [patternProps, restProps] = splitProps(props, ["justify", "gap"]);
|
|
649
|
+
const styleProps = getHstackStyle(patternProps);
|
|
650
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
651
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
652
|
+
return createElement(styled.div, mergedProps);
|
|
653
|
+
});
|
|
526
654
|
const centerConfig = {
|
|
527
655
|
transform(props) {
|
|
528
656
|
const { inline, ...rest } = props;
|
|
@@ -538,12 +666,75 @@ const getCenterStyle = (styles = {}) => {
|
|
|
538
666
|
const _styles = getPatternStyles(centerConfig, styles);
|
|
539
667
|
return centerConfig.transform(_styles, patternFns);
|
|
540
668
|
};
|
|
541
|
-
const Center = /* @__PURE__ */ forwardRef(function
|
|
669
|
+
const Center$1 = /* @__PURE__ */ forwardRef(function Center(props, ref) {
|
|
542
670
|
const [patternProps, restProps] = splitProps(props, ["inline"]);
|
|
543
671
|
const styleProps = getCenterStyle(patternProps);
|
|
544
|
-
const
|
|
672
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
673
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
545
674
|
return createElement(styled.div, mergedProps);
|
|
546
675
|
});
|
|
676
|
+
const gridConfig = {
|
|
677
|
+
transform(props, { map, isCssUnit: isCssUnit2 }) {
|
|
678
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props;
|
|
679
|
+
const getValue = (v2) => isCssUnit2(v2) ? v2 : `token(sizes.${v2}, ${v2})`;
|
|
680
|
+
return {
|
|
681
|
+
display: "grid",
|
|
682
|
+
gridTemplateColumns: columns != null ? map(columns, (v2) => `repeat(${v2}, minmax(0, 1fr))`) : minChildWidth != null ? map(minChildWidth, (v2) => `repeat(auto-fit, minmax(${getValue(v2)}, 1fr))`) : void 0,
|
|
683
|
+
gap,
|
|
684
|
+
columnGap,
|
|
685
|
+
rowGap,
|
|
686
|
+
...rest
|
|
687
|
+
};
|
|
688
|
+
},
|
|
689
|
+
defaultValues(props) {
|
|
690
|
+
return { gap: props.columnGap || props.rowGap ? void 0 : "10px" };
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
const getGridStyle = (styles = {}) => {
|
|
694
|
+
const _styles = getPatternStyles(gridConfig, styles);
|
|
695
|
+
return gridConfig.transform(_styles, patternFns);
|
|
696
|
+
};
|
|
697
|
+
const Grid$1 = /* @__PURE__ */ forwardRef(function Grid(props, ref) {
|
|
698
|
+
const [patternProps, restProps] = splitProps(props, ["gap", "columnGap", "rowGap", "columns", "minChildWidth"]);
|
|
699
|
+
const styleProps = getGridStyle(patternProps);
|
|
700
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
701
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
702
|
+
return createElement(styled.div, mergedProps);
|
|
703
|
+
});
|
|
704
|
+
const gridItemConfig = {
|
|
705
|
+
transform(props, { map }) {
|
|
706
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props;
|
|
707
|
+
const spanFn = (v2) => v2 === "auto" ? v2 : `span ${v2}`;
|
|
708
|
+
return {
|
|
709
|
+
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
|
710
|
+
gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
|
|
711
|
+
gridColumnStart: colStart,
|
|
712
|
+
gridColumnEnd: colEnd,
|
|
713
|
+
gridRowStart: rowStart,
|
|
714
|
+
gridRowEnd: rowEnd,
|
|
715
|
+
...rest
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const getGridItemStyle = (styles = {}) => {
|
|
720
|
+
const _styles = getPatternStyles(gridItemConfig, styles);
|
|
721
|
+
return gridItemConfig.transform(_styles, patternFns);
|
|
722
|
+
};
|
|
723
|
+
const GridItem$1 = /* @__PURE__ */ forwardRef(function GridItem(props, ref) {
|
|
724
|
+
const [patternProps, restProps] = splitProps(props, ["colSpan", "rowSpan", "colStart", "rowStart", "colEnd", "rowEnd"]);
|
|
725
|
+
const styleProps = getGridItemStyle(patternProps);
|
|
726
|
+
const cssProps = { css: mergeCss(styleProps, props.css) };
|
|
727
|
+
const mergedProps = { ref, ...restProps, ...cssProps };
|
|
728
|
+
return createElement(styled.div, mergedProps);
|
|
729
|
+
});
|
|
730
|
+
const Box2 = withPolymorphicComponent(Box$1);
|
|
731
|
+
const Flex2 = withPolymorphicComponent(Flex$1);
|
|
732
|
+
const Grid2 = withPolymorphicComponent(Grid$1);
|
|
733
|
+
const Stack2 = withPolymorphicComponent(Stack$1);
|
|
734
|
+
const VStack2 = withPolymorphicComponent(VStack$1);
|
|
735
|
+
const HStack2 = withPolymorphicComponent(HStack$1);
|
|
736
|
+
const GridItem2 = withPolymorphicComponent(GridItem$1);
|
|
737
|
+
const Center2 = withPolymorphicComponent(Center$1);
|
|
547
738
|
function getErrorMessage(hook, provider) {
|
|
548
739
|
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
|
549
740
|
}
|
|
@@ -1722,9 +1913,9 @@ var layerStack = {
|
|
|
1722
1913
|
},
|
|
1723
1914
|
isBelowPointerBlockingLayer(node) {
|
|
1724
1915
|
var _a;
|
|
1725
|
-
const
|
|
1916
|
+
const index2 = this.indexOf(node);
|
|
1726
1917
|
const highestBlockingIndex = this.topMostPointerBlockingLayer() ? this.indexOf((_a = this.topMostPointerBlockingLayer()) == null ? void 0 : _a.node) : -1;
|
|
1727
|
-
return
|
|
1918
|
+
return index2 < highestBlockingIndex;
|
|
1728
1919
|
},
|
|
1729
1920
|
isTopMost(node) {
|
|
1730
1921
|
const layer = this.layers[this.count() - 1];
|
|
@@ -1747,18 +1938,18 @@ var layerStack = {
|
|
|
1747
1938
|
this.branches.push(node);
|
|
1748
1939
|
},
|
|
1749
1940
|
remove(node) {
|
|
1750
|
-
const
|
|
1751
|
-
if (
|
|
1752
|
-
if (
|
|
1941
|
+
const index2 = this.indexOf(node);
|
|
1942
|
+
if (index2 < 0) return;
|
|
1943
|
+
if (index2 < this.count() - 1) {
|
|
1753
1944
|
const _layers = this.getNestedLayers(node);
|
|
1754
1945
|
_layers.forEach((layer) => layer.dismiss());
|
|
1755
1946
|
}
|
|
1756
|
-
this.layers.splice(
|
|
1947
|
+
this.layers.splice(index2, 1);
|
|
1757
1948
|
node.style.removeProperty("--layer-index");
|
|
1758
1949
|
},
|
|
1759
1950
|
removeBranch(node) {
|
|
1760
|
-
const
|
|
1761
|
-
if (
|
|
1951
|
+
const index2 = this.branches.indexOf(node);
|
|
1952
|
+
if (index2 >= 0) this.branches.splice(index2, 1);
|
|
1762
1953
|
},
|
|
1763
1954
|
indexOf(node) {
|
|
1764
1955
|
return this.layers.findIndex((layer) => layer.node === node);
|
|
@@ -3907,17 +4098,18 @@ const spinnerRecipe = cva({
|
|
|
3907
4098
|
}
|
|
3908
4099
|
});
|
|
3909
4100
|
const Spinner = forwardRef((props, ref) => {
|
|
3910
|
-
const {
|
|
4101
|
+
const { color, ...rest } = props;
|
|
3911
4102
|
const StyledSpinner = styled(ark.div, spinnerRecipe);
|
|
3912
4103
|
return /* @__PURE__ */ jsx(
|
|
3913
4104
|
StyledSpinner,
|
|
3914
4105
|
{
|
|
3915
4106
|
ref,
|
|
3916
4107
|
...rest,
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
4108
|
+
css: {
|
|
4109
|
+
borderColor: "inherit",
|
|
4110
|
+
borderBottomColor: "transparent",
|
|
4111
|
+
borderLeftColor: "transparent"
|
|
4112
|
+
}
|
|
3921
4113
|
}
|
|
3922
4114
|
);
|
|
3923
4115
|
});
|
|
@@ -4370,32 +4562,41 @@ const buttonRecipe = cva({
|
|
|
4370
4562
|
}
|
|
4371
4563
|
]
|
|
4372
4564
|
});
|
|
4373
|
-
const Button =
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4565
|
+
const Button = ({ loading, disabled, loadingText, children, color, variant, size, radius, ...rest }) => {
|
|
4566
|
+
const StyledButton = styled(ark.button, buttonRecipe);
|
|
4567
|
+
return /* @__PURE__ */ jsx(
|
|
4568
|
+
StyledButton,
|
|
4569
|
+
{
|
|
4570
|
+
disabled,
|
|
4571
|
+
color,
|
|
4572
|
+
variant,
|
|
4573
|
+
size,
|
|
4574
|
+
radius,
|
|
4575
|
+
css: { pointerEvents: loading ? "none" : "auto" },
|
|
4576
|
+
...rest,
|
|
4577
|
+
children: loading ? loadingText || /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4578
|
+
/* @__PURE__ */ jsx(
|
|
4579
|
+
Center2,
|
|
4580
|
+
{
|
|
4581
|
+
inline: true,
|
|
4582
|
+
css: {
|
|
4583
|
+
position: "absolute",
|
|
4584
|
+
transform: "translate(-50%, -50%)",
|
|
4585
|
+
top: "50%",
|
|
4586
|
+
insetStart: "50%"
|
|
4587
|
+
},
|
|
4588
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: size === "xs" || size === "sm" ? "sm" : "md" })
|
|
4589
|
+
}
|
|
4590
|
+
),
|
|
4591
|
+
/* @__PURE__ */ jsx(Box2, { as: "span", css: { opacity: 0 }, children })
|
|
4592
|
+
] }) : children
|
|
4593
|
+
}
|
|
4594
|
+
);
|
|
4595
|
+
};
|
|
4596
|
+
const index$1 = withPolymorphicComponent(Button);
|
|
4396
4597
|
const textRecipe = cva({
|
|
4397
4598
|
base: {
|
|
4398
|
-
color: "
|
|
4599
|
+
color: "currentcolor"
|
|
4399
4600
|
},
|
|
4400
4601
|
defaultVariants: {
|
|
4401
4602
|
variant: "body.md"
|
|
@@ -4472,7 +4673,7 @@ const Text = forwardRef((props, ref) => {
|
|
|
4472
4673
|
label: styled("span", textRecipe)
|
|
4473
4674
|
};
|
|
4474
4675
|
const TextComponent = componentMap[textType];
|
|
4475
|
-
return /* @__PURE__ */ jsx(TextComponent, { ref, textStyle: variant, font, ...rest, children });
|
|
4676
|
+
return /* @__PURE__ */ jsx(TextComponent, { ref, css: { textStyle: variant, fontFamily: font }, ...rest, children });
|
|
4476
4677
|
});
|
|
4477
4678
|
Text.displayName = "Text";
|
|
4478
4679
|
const shouldForwardProp = (prop, variantKeys, options = {}) => {
|
|
@@ -4813,17 +5014,30 @@ const IconButton = forwardRef(
|
|
|
4813
5014
|
color,
|
|
4814
5015
|
variant,
|
|
4815
5016
|
size,
|
|
4816
|
-
pointerEvents: loading ? "none" : "auto",
|
|
5017
|
+
css: { pointerEvents: loading ? "none" : "auto" },
|
|
4817
5018
|
...rest,
|
|
4818
5019
|
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4819
|
-
/* @__PURE__ */ jsx(
|
|
4820
|
-
|
|
5020
|
+
/* @__PURE__ */ jsx(
|
|
5021
|
+
Center$1,
|
|
5022
|
+
{
|
|
5023
|
+
inline: true,
|
|
5024
|
+
css: {
|
|
5025
|
+
position: "absolute",
|
|
5026
|
+
transform: "translate(-50%, -50%)",
|
|
5027
|
+
top: "50%",
|
|
5028
|
+
insetStart: "50%"
|
|
5029
|
+
},
|
|
5030
|
+
children: /* @__PURE__ */ jsx(Spinner, { size: size === "lg" ? "md" : "sm" })
|
|
5031
|
+
}
|
|
5032
|
+
),
|
|
5033
|
+
/* @__PURE__ */ jsx(styled.span, { css: { opacity: 0 }, children })
|
|
4821
5034
|
] }) : children
|
|
4822
5035
|
}
|
|
4823
5036
|
);
|
|
4824
5037
|
}
|
|
4825
5038
|
);
|
|
4826
5039
|
IconButton.displayName = "IconButton";
|
|
5040
|
+
const index = withPolymorphicComponent(IconButton);
|
|
4827
5041
|
var updateQueue = makeQueue();
|
|
4828
5042
|
var raf = (fn) => schedule(fn, updateQueue);
|
|
4829
5043
|
var writeQueue = makeQueue();
|
|
@@ -5144,8 +5358,8 @@ function advance(dt) {
|
|
|
5144
5358
|
return currentFrame.length > 0;
|
|
5145
5359
|
}
|
|
5146
5360
|
function findIndex(arr, test) {
|
|
5147
|
-
const
|
|
5148
|
-
return
|
|
5361
|
+
const index2 = arr.findIndex(test);
|
|
5362
|
+
return index2 < 0 ? arr.length : index2;
|
|
5149
5363
|
}
|
|
5150
5364
|
var colors2 = {
|
|
5151
5365
|
transparent: 0,
|
|
@@ -7595,8 +7809,8 @@ var SpringRef = () => {
|
|
|
7595
7809
|
each(current, (ctrl, i) => ctrl.update(this._getProps(props, ctrl, i)));
|
|
7596
7810
|
return this;
|
|
7597
7811
|
};
|
|
7598
|
-
const _getProps = function(arg, ctrl,
|
|
7599
|
-
return is.fun(arg) ? arg(
|
|
7812
|
+
const _getProps = function(arg, ctrl, index2) {
|
|
7813
|
+
return is.fun(arg) ? arg(index2, ctrl) : arg;
|
|
7600
7814
|
};
|
|
7601
7815
|
SpringRef2._getProps = _getProps;
|
|
7602
7816
|
return SpringRef2;
|
|
@@ -8346,22 +8560,25 @@ const BottomSheetFrame = forwardRef(
|
|
|
8346
8560
|
animated.section,
|
|
8347
8561
|
{
|
|
8348
8562
|
ref,
|
|
8349
|
-
className: cx(
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8563
|
+
className: cx(
|
|
8564
|
+
css$1({
|
|
8565
|
+
position: "fixed",
|
|
8566
|
+
touchAction: "pan-y",
|
|
8567
|
+
display: "flex",
|
|
8568
|
+
flexDirection: "column",
|
|
8569
|
+
width: "100%",
|
|
8570
|
+
pointerEvents: "auto",
|
|
8571
|
+
// 제스처 이벤트 허용
|
|
8572
|
+
overflow: "hidden",
|
|
8573
|
+
borderRadius: "40px 40px 0 0",
|
|
8574
|
+
height: "100%",
|
|
8575
|
+
zIndex: 999,
|
|
8576
|
+
backgroundColor: "#ffffff",
|
|
8577
|
+
shadow: "0 -15px 15px 0px rgba(0, 0, 0, 0.05)",
|
|
8578
|
+
willChange: "auto"
|
|
8579
|
+
}),
|
|
8580
|
+
className
|
|
8581
|
+
),
|
|
8365
8582
|
style: {
|
|
8366
8583
|
bottom: `calc(${initialOpenHeightPx}px - 100dvh)`,
|
|
8367
8584
|
transform: springs.transform
|
|
@@ -8371,42 +8588,70 @@ const BottomSheetFrame = forwardRef(
|
|
|
8371
8588
|
);
|
|
8372
8589
|
}
|
|
8373
8590
|
);
|
|
8374
|
-
const Backdrop = forwardRef(
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
animated.div,
|
|
8386
|
-
{
|
|
8387
|
-
className: css$1({
|
|
8388
|
-
zIndex: 99,
|
|
8389
|
-
position: "fixed",
|
|
8390
|
-
top: 0,
|
|
8391
|
-
width: "100%",
|
|
8392
|
-
height: "100dvh",
|
|
8393
|
-
willChange: "opacity",
|
|
8394
|
-
overflow: "hidden",
|
|
8395
|
-
touchAction: "none"
|
|
8591
|
+
const Backdrop = forwardRef(
|
|
8592
|
+
({ onBackdropClick, isBackdropOpen, opacity: bgOpacity }, ref) => {
|
|
8593
|
+
const [springs] = useSpring(
|
|
8594
|
+
() => ({
|
|
8595
|
+
from: { opacity: 0 },
|
|
8596
|
+
to: { opacity: isBackdropOpen ? 1 : 0 },
|
|
8597
|
+
config: {
|
|
8598
|
+
tension: 200,
|
|
8599
|
+
friction: 25,
|
|
8600
|
+
mass: 0.8
|
|
8601
|
+
}
|
|
8396
8602
|
}),
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8603
|
+
[isBackdropOpen]
|
|
8604
|
+
);
|
|
8605
|
+
return /* @__PURE__ */ jsx(
|
|
8606
|
+
animated.div,
|
|
8607
|
+
{
|
|
8608
|
+
className: css$1({
|
|
8609
|
+
zIndex: 99,
|
|
8610
|
+
position: "fixed",
|
|
8611
|
+
top: 0,
|
|
8612
|
+
width: "100%",
|
|
8613
|
+
height: "100dvh",
|
|
8614
|
+
willChange: "opacity",
|
|
8615
|
+
overflow: "hidden",
|
|
8616
|
+
touchAction: "none"
|
|
8617
|
+
}),
|
|
8618
|
+
style: {
|
|
8619
|
+
backgroundColor: springs.opacity.to((o) => `rgba(0, 0, 0, ${o * bgOpacity})`),
|
|
8620
|
+
opacity: springs.opacity,
|
|
8621
|
+
visibility: isBackdropOpen ? "visible" : "hidden"
|
|
8622
|
+
},
|
|
8623
|
+
onClick: () => onBackdropClick(),
|
|
8624
|
+
ref
|
|
8625
|
+
}
|
|
8626
|
+
);
|
|
8627
|
+
}
|
|
8628
|
+
);
|
|
8629
|
+
const BottomSheetHandle = () => /* @__PURE__ */ jsx(
|
|
8630
|
+
"div",
|
|
8631
|
+
{
|
|
8632
|
+
className: css$1({
|
|
8633
|
+
margin: "22px auto",
|
|
8634
|
+
height: 1.5,
|
|
8635
|
+
minHeight: 1.5,
|
|
8636
|
+
width: "45px",
|
|
8637
|
+
borderRadius: 999,
|
|
8638
|
+
background: "#bebebe"
|
|
8639
|
+
})
|
|
8640
|
+
}
|
|
8641
|
+
);
|
|
8408
8642
|
const BottomSheet = (props) => {
|
|
8409
|
-
const {
|
|
8643
|
+
const {
|
|
8644
|
+
isOpen = true,
|
|
8645
|
+
onClose,
|
|
8646
|
+
onOpen,
|
|
8647
|
+
children,
|
|
8648
|
+
className = "",
|
|
8649
|
+
snapPercent,
|
|
8650
|
+
bgBlocking = true,
|
|
8651
|
+
backdropOpacity = DEFAULT_BACKDROP_OPACITY,
|
|
8652
|
+
hideHandle = false,
|
|
8653
|
+
expendOnContentDrag = false
|
|
8654
|
+
} = props;
|
|
8410
8655
|
const { bottomSheetRef, contentRef, snapToMin, springs } = useBottomSheet({
|
|
8411
8656
|
isOpen,
|
|
8412
8657
|
onOpen,
|
|
@@ -8620,18 +8865,18 @@ const tagRecipe = cva({
|
|
|
8620
8865
|
avatar: false
|
|
8621
8866
|
}
|
|
8622
8867
|
});
|
|
8623
|
-
function
|
|
8868
|
+
function P({ size: C = 24, color: n = "currentColor", ...o }) {
|
|
8624
8869
|
return /* @__PURE__ */ jsx(
|
|
8625
8870
|
"svg",
|
|
8626
8871
|
{
|
|
8627
|
-
width:
|
|
8628
|
-
height:
|
|
8872
|
+
width: C,
|
|
8873
|
+
height: C,
|
|
8629
8874
|
viewBox: "0 0 24 24",
|
|
8630
8875
|
fill: "none",
|
|
8631
8876
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8632
8877
|
strokeWidth: "0",
|
|
8633
|
-
color,
|
|
8634
|
-
...
|
|
8878
|
+
color: n,
|
|
8879
|
+
...o,
|
|
8635
8880
|
children: /* @__PURE__ */ jsx(
|
|
8636
8881
|
"path",
|
|
8637
8882
|
{
|
|
@@ -8645,14 +8890,28 @@ function CloseOutlineIcon({ size = 24, color = "currentColor", ...props }) {
|
|
|
8645
8890
|
}
|
|
8646
8891
|
);
|
|
8647
8892
|
}
|
|
8648
|
-
const Tag = forwardRef(
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8893
|
+
const Tag = forwardRef(
|
|
8894
|
+
({ color, background, radius, imageSrc, text, onDeleteClick, ...rest }, ref) => {
|
|
8895
|
+
const StyledTag = styled(ark.div, tagRecipe);
|
|
8896
|
+
return /* @__PURE__ */ jsxs(StyledTag, { color, background, radius, avatar: !!imageSrc, ref, ...rest, children: [
|
|
8897
|
+
imageSrc && /* @__PURE__ */ jsx(
|
|
8898
|
+
styled.img,
|
|
8899
|
+
{
|
|
8900
|
+
src: imageSrc,
|
|
8901
|
+
css: {
|
|
8902
|
+
width: "8",
|
|
8903
|
+
height: "8",
|
|
8904
|
+
borderRadius: "full",
|
|
8905
|
+
overflow: "hidden"
|
|
8906
|
+
},
|
|
8907
|
+
alt: "avatar thumbnail"
|
|
8908
|
+
}
|
|
8909
|
+
),
|
|
8910
|
+
text,
|
|
8911
|
+
onDeleteClick ? /* @__PURE__ */ jsx(P, { size: 12, onClick: onDeleteClick, cursor: "pointer" }) : null
|
|
8912
|
+
] });
|
|
8913
|
+
}
|
|
8914
|
+
);
|
|
8656
8915
|
Tag.displayName = "Tag";
|
|
8657
8916
|
function definePreset(preset2) {
|
|
8658
8917
|
return preset2;
|
|
@@ -8956,14 +9215,22 @@ const preset = definePreset({
|
|
|
8956
9215
|
});
|
|
8957
9216
|
export {
|
|
8958
9217
|
BottomSheet,
|
|
8959
|
-
|
|
9218
|
+
Box2 as Box,
|
|
9219
|
+
index$1 as Button,
|
|
9220
|
+
Center2 as Center,
|
|
8960
9221
|
Dialog,
|
|
8961
|
-
|
|
9222
|
+
Flex2 as Flex,
|
|
9223
|
+
Grid2 as Grid,
|
|
9224
|
+
GridItem2 as GridItem,
|
|
9225
|
+
HStack2 as HStack,
|
|
9226
|
+
index as IconButton,
|
|
8962
9227
|
Navigation,
|
|
8963
9228
|
Portal,
|
|
8964
9229
|
Spinner,
|
|
9230
|
+
Stack2 as Stack,
|
|
8965
9231
|
Tag,
|
|
8966
9232
|
Text,
|
|
9233
|
+
VStack2 as VStack,
|
|
8967
9234
|
preset
|
|
8968
9235
|
};
|
|
8969
9236
|
//# sourceMappingURL=index.js.map
|