@nation-a/ui 0.16.5 → 0.16.7

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.js CHANGED
@@ -280,7 +280,7 @@ function normalizeHTMLProps(props) {
280
280
  return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
281
281
  }
282
282
  normalizeHTMLProps.keys = htmlProps;
283
- const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_collapsed,_off,_on,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base";
283
+ const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_collapsed,_off,_on,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,base";
284
284
  const conditions$1 = new Set(conditionsStr.split(","));
285
285
  const conditionRegex = /^@|&|&$/;
286
286
  function isCondition(value) {
@@ -326,7 +326,7 @@ const context = {
326
326
  conditions: {
327
327
  shift: sortConditions,
328
328
  finalize: finalizeConditions,
329
- breakpoints: { keys: ["base", "sm", "md", "lg", "xl", "2xl"] }
329
+ breakpoints: { keys: ["base", "xs", "sm", "md", "lg", "xl", "2xl"] }
330
330
  },
331
331
  utility: {
332
332
  transform: (prop, value) => {
@@ -784,7 +784,7 @@ const Spinner = forwardRef(({ className, size: size2, color: color2, ...props },
784
784
  setLottieComponent(() => mod.default);
785
785
  });
786
786
  }, []);
787
- return /* @__PURE__ */ jsx(Box2, { ref, ...props, className: cx(spinnerRecipe({ size: size2 }), css$1({ color: color2 }), className), children: LottieComponent && /* @__PURE__ */ jsx(
787
+ return /* @__PURE__ */ jsx(Box2, { ref, id: "spinner", ...props, className: cx(spinnerRecipe({ size: size2 }), css$1({ color: color2 }), className), children: LottieComponent && /* @__PURE__ */ jsx(
788
788
  LottieComponent,
789
789
  {
790
790
  options: {
@@ -7668,6 +7668,12 @@ const SelectContent = forwardRef((props, ref) => {
7668
7668
  return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });
7669
7669
  });
7670
7670
  SelectContent.displayName = "SelectContent";
7671
+ const SelectControl = forwardRef((props, ref) => {
7672
+ const select = useSelectContext();
7673
+ const mergedProps = mergeProps(select.getControlProps(), props);
7674
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
7675
+ });
7676
+ SelectControl.displayName = "SelectControl";
7671
7677
  const [SelectItemProvider, useSelectItemContext] = createContext({
7672
7678
  name: "SelectItemContext",
7673
7679
  hookName: "useSelectItemContext",
@@ -7692,6 +7698,16 @@ const SelectLabel = forwardRef((props, ref) => {
7692
7698
  return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });
7693
7699
  });
7694
7700
  SelectLabel.displayName = "SelectLabel";
7701
+ const SelectPositioner = forwardRef((props, ref) => {
7702
+ const select = useSelectContext();
7703
+ const mergedProps = mergeProps(select.getPositionerProps(), props);
7704
+ const presence = usePresenceContext();
7705
+ if (presence.unmounted) {
7706
+ return null;
7707
+ }
7708
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
7709
+ });
7710
+ SelectPositioner.displayName = "SelectPositioner";
7695
7711
  var anatomy$2 = createAnatomy("select").parts(
7696
7712
  "label",
7697
7713
  "positioner",
@@ -9934,7 +9950,18 @@ const TabsRoot = forwardRef((props, ref) => {
9934
9950
  return /* @__PURE__ */ jsx(TabsProvider, { value: tabs, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });
9935
9951
  });
9936
9952
  TabsRoot.displayName = "TabsRoot";
9937
- const Button = ({ loading, disabled, loadingText, children, color: color2, variant, size: size2, radius, ...rest }) => {
9953
+ const Button = ({
9954
+ loading,
9955
+ disabled,
9956
+ loadingText,
9957
+ children,
9958
+ color: color2,
9959
+ variant,
9960
+ size: size2,
9961
+ radius,
9962
+ onClick,
9963
+ ...rest
9964
+ }) => {
9938
9965
  const StyledButton = styled(ark.button, buttonRecipe);
9939
9966
  return /* @__PURE__ */ jsx(
9940
9967
  StyledButton,
@@ -9945,6 +9972,7 @@ const Button = ({ loading, disabled, loadingText, children, color: color2, varia
9945
9972
  size: size2,
9946
9973
  radius,
9947
9974
  css: { pointerEvents: loading ? "none" : "auto" },
9975
+ onClick: disabled || loading ? void 0 : onClick,
9948
9976
  ...rest,
9949
9977
  children: loading ? loadingText || /* @__PURE__ */ jsxs(Fragment, { children: [
9950
9978
  /* @__PURE__ */ jsx(
@@ -10185,7 +10213,7 @@ const Trigger$3 = withContext$7(DialogTrigger, "trigger");
10185
10213
  const Content$4 = withContext$7(DialogContent, "content");
10186
10214
  const Title = withContext$7(DialogTitle, "title");
10187
10215
  const Description$2 = withContext$7(DialogDescription, "description");
10188
- const Positioner = withContext$7(DialogPositioner, "positioner");
10216
+ const Positioner$1 = withContext$7(DialogPositioner, "positioner");
10189
10217
  const Header$1 = withContext$7(ark.header, "header");
10190
10218
  const Footer = withContext$7(
10191
10219
  ({ orientation = "horizontal", className, ...props }) => {
@@ -10214,7 +10242,7 @@ const Dialog = {
10214
10242
  Content: Content$4,
10215
10243
  Title,
10216
10244
  Description: Description$2,
10217
- Positioner,
10245
+ Positioner: Positioner$1,
10218
10246
  Header: Header$1,
10219
10247
  Footer,
10220
10248
  Body,
@@ -20762,7 +20790,7 @@ Toast.error = (description, option) => {
20762
20790
  };
20763
20791
  const selectRecipe = sva({
20764
20792
  className: "select",
20765
- slots: ["root", "trigger", "content", "item", "label", "valueText", "description"],
20793
+ slots: [...anatomy$2.keys(), "description"],
20766
20794
  base: {
20767
20795
  root: {
20768
20796
  display: "flex",
@@ -20771,6 +20799,7 @@ const selectRecipe = sva({
20771
20799
  width: "100%"
20772
20800
  },
20773
20801
  trigger: {
20802
+ position: "relative",
20774
20803
  display: "flex",
20775
20804
  alignItems: "center",
20776
20805
  justifyContent: "space-between",
@@ -20786,11 +20815,18 @@ const selectRecipe = sva({
20786
20815
  },
20787
20816
  content: {
20788
20817
  backgroundColor: "background.neutral.default",
20789
- mt: 2,
20790
20818
  padding: 2,
20791
20819
  borderRadius: 16,
20792
20820
  overflowY: "auto",
20793
- zIndex: "dropdown"
20821
+ zIndex: "dropdown",
20822
+ display: "flex",
20823
+ flexDirection: "column",
20824
+ _open: {
20825
+ animation: "fadeIn 0.2s ease-in"
20826
+ },
20827
+ _closed: {
20828
+ animation: "fadeOut 0.2s ease-out"
20829
+ }
20794
20830
  },
20795
20831
  item: {
20796
20832
  display: "flex",
@@ -20800,8 +20836,10 @@ const selectRecipe = sva({
20800
20836
  cursor: "pointer",
20801
20837
  color: "content.neutral.default",
20802
20838
  textStyle: "label.md",
20803
- "&:hover": {
20804
- backgroundColor: "background.neutral.hover"
20839
+ rounded: "sm",
20840
+ transition: "all 0.2s ease",
20841
+ _hover: {
20842
+ backgroundColor: "background.neutral.selected"
20805
20843
  }
20806
20844
  },
20807
20845
  label: {
@@ -20870,12 +20908,20 @@ const Trigger = withContext$4(({ description, ...props }) => {
20870
20908
  description && /* @__PURE__ */ jsx(Description, { text: description })
20871
20909
  ] });
20872
20910
  }, "trigger");
20911
+ const Control$2 = withContext$4(
20912
+ SelectControl,
20913
+ "control"
20914
+ );
20873
20915
  const ValueText = withContext$4(SelectValueText, "valueText");
20874
20916
  const Description = withContext$4(({ className, text, ...props }) => {
20875
20917
  return /* @__PURE__ */ jsx(Text, { className, ...props, children: text });
20876
20918
  }, "description");
20877
20919
  const Content = withContext$4(SelectContent, "content");
20878
20920
  const Item$2 = withContext$4(SelectItem, "item");
20921
+ const Positioner = withContext$4(
20922
+ SelectPositioner,
20923
+ "positioner"
20924
+ );
20879
20925
  const Select = {
20880
20926
  Root: Root$4,
20881
20927
  Label: Label$2,
@@ -20883,7 +20929,9 @@ const Select = {
20883
20929
  Content,
20884
20930
  Item: Item$2,
20885
20931
  ValueText,
20886
- Description
20932
+ Description,
20933
+ Positioner,
20934
+ Control: Control$2
20887
20935
  };
20888
20936
  const radioGroupRecipe = sva({
20889
20937
  className: "radioGroup",
@@ -21572,6 +21620,7 @@ const conditions = {
21572
21620
  }
21573
21621
  };
21574
21622
  const breakpoints = {
21623
+ xs: "480px",
21575
21624
  sm: "640px",
21576
21625
  md: "768px",
21577
21626
  lg: "1024px",
@@ -21609,6 +21658,9 @@ const animations = defineTokens.animations({
21609
21658
  "fade-in": {
21610
21659
  value: "fade-in 400ms {easings.emphasized-in}"
21611
21660
  },
21661
+ "fade-out": {
21662
+ value: "fade-out 200ms {easings.emphasized-out}"
21663
+ },
21612
21664
  "collapse-in": {
21613
21665
  value: "collapse-in 250ms {easings.emphasized-in}"
21614
21666
  },