@vygruppen/spor-react 12.24.15 → 12.24.16

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.24.15 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.24.16 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx, src/icons/index.tsx
@@ -11,18 +11,18 @@
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
- CJS dist/index.cjs 360.22 KB
14
+ CJS dist/index.cjs 367.03 KB
15
15
  CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/index.cjs.map 708.58 KB
16
+ CJS dist/index.cjs.map 722.10 KB
17
17
  CJS dist/icons/index.cjs.map 157.00 B
18
- CJS ⚡️ Build success in 2636ms
19
- ESM dist/index.mjs 336.04 KB
18
+ CJS ⚡️ Build success in 2628ms
19
+ ESM dist/index.mjs 342.22 KB
20
20
  ESM dist/icons/index.mjs 110.00 B
21
+ ESM dist/index.mjs.map 722.10 KB
21
22
  ESM dist/icons/index.mjs.map 157.00 B
22
- ESM dist/index.mjs.map 708.58 KB
23
- ESM ⚡️ Build success in 2638ms
24
- DTS ⚡️ Build success in 20314ms
23
+ ESM ⚡️ Build success in 2628ms
24
+ DTS ⚡️ Build success in 20149ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 147.61 KB
26
+ DTS dist/index.d.ts 150.61 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 147.61 KB
28
+ DTS dist/index.d.cts 150.61 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@12.24.15 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@12.24.16 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
5
  [dotenv@17.3.1] injecting env (0) from .env -- tip: ⚙️ enable debug logging with { debug: true }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 12.24.16
4
+
5
+ ### Patch Changes
6
+
7
+ - b90fd20: Design adjustments to the menu component
8
+ - 80a1fda: Add new menu-component
9
+
3
10
  ## 12.24.15
4
11
 
5
12
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -4095,6 +4095,127 @@ function ListBoxSection({ section, state }) {
4095
4095
  ) })
4096
4096
  ] }) });
4097
4097
  }
4098
+ var CustomMenuContext = React20.createContext({
4099
+ variant: "core"
4100
+ });
4101
+ var useMenuContext = () => React20.useContext(CustomMenuContext);
4102
+ var Menu = ({ children, ...props }) => {
4103
+ return /* @__PURE__ */ jsxRuntime.jsx(
4104
+ CustomMenuContext.Provider,
4105
+ {
4106
+ value: {
4107
+ variant: props.variant
4108
+ },
4109
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Root, { ...props, children })
4110
+ }
4111
+ );
4112
+ };
4113
+ var MenuContent = React20.forwardRef(
4114
+ ({ children, ...props }, ref) => {
4115
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Content, { ref, ...props, children }) }) });
4116
+ }
4117
+ );
4118
+ MenuContent.displayName = "MenuContent";
4119
+ var MenuTrigger = React20.forwardRef(
4120
+ ({ icon, size, children, ...props }, ref) => {
4121
+ const { variant } = useMenuContext();
4122
+ const { open } = react.useMenuContext();
4123
+ const ChevronIcon = size === "sm" ? spor_icon_react_star.DropdownDownFill18Icon : spor_icon_react_star.DropdownDownFill24Icon;
4124
+ const getButtonVariant = () => {
4125
+ if (variant === "floating")
4126
+ return "floating";
4127
+ if (variant === "accent")
4128
+ return "secondary";
4129
+ return "tertiary";
4130
+ };
4131
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Trigger, { asChild: true, ref, children: /* @__PURE__ */ jsxRuntime.jsx(
4132
+ Button,
4133
+ {
4134
+ leftIcon: icon,
4135
+ variant: getButtonVariant(),
4136
+ size,
4137
+ ...props,
4138
+ rightIcon: /* @__PURE__ */ jsxRuntime.jsx(
4139
+ ChevronIcon,
4140
+ {
4141
+ transform: open ? "rotate(180deg)" : void 0,
4142
+ transition: "transform 0.3s"
4143
+ }
4144
+ ),
4145
+ children
4146
+ }
4147
+ ) });
4148
+ }
4149
+ );
4150
+ MenuTrigger.displayName = "MenuTrigger";
4151
+ var MenuItem = React20.forwardRef(
4152
+ ({ itemCommand, children, value, leftIcon, rightIcon, ...props }, ref) => {
4153
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.Item, { value, ...props, ref, children: [
4154
+ leftIcon,
4155
+ children,
4156
+ itemCommand && /* @__PURE__ */ jsxRuntime.jsx(react.Menu.ItemCommand, { children: itemCommand }),
4157
+ rightIcon
4158
+ ] });
4159
+ }
4160
+ );
4161
+ MenuItem.displayName = "MenuItem";
4162
+ var MenuTriggerItem = React20.forwardRef(
4163
+ ({ children, leftIcon, rightIcon, ...props }, ref) => {
4164
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.TriggerItem, { ...props, ref, children: [
4165
+ leftIcon,
4166
+ children,
4167
+ rightIcon
4168
+ ] });
4169
+ }
4170
+ );
4171
+ MenuTriggerItem.displayName = "MenuTriggerItem";
4172
+ var MenuRadioItemGroup = React20.forwardRef(({ children, ...props }) => {
4173
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Menu.RadioItemGroup, { ...props, children });
4174
+ });
4175
+ MenuRadioItemGroup.displayName = "MenuRadioItemGroup";
4176
+ var MenuRadioItem = React20.forwardRef(
4177
+ ({ children, ...props }, ref) => {
4178
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.RadioItem, { ...props, ref, children: [
4179
+ children,
4180
+ /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { w: "1.25rem", justify: "center", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.ItemIndicator, {}) })
4181
+ ] });
4182
+ }
4183
+ );
4184
+ MenuRadioItem.displayName = "MenuRadioItem";
4185
+ var MenuItemGroup = React20.forwardRef(
4186
+ ({ children, label, ...props }, ref) => {
4187
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.ItemGroup, { ...props, ref, children: [
4188
+ label && /* @__PURE__ */ jsxRuntime.jsx(react.Menu.ItemGroupLabel, { children: label }),
4189
+ children
4190
+ ] });
4191
+ }
4192
+ );
4193
+ MenuItemGroup.displayName = "MenuItemGroup";
4194
+ var MenuCheckboxItem = React20.forwardRef(({ children, closeOnSelect = false, ...props }, ref) => {
4195
+ return /* @__PURE__ */ jsxRuntime.jsx(
4196
+ react.Menu.CheckboxItem,
4197
+ {
4198
+ ...props,
4199
+ ref,
4200
+ closeOnSelect,
4201
+ checked: props.checked,
4202
+ onCheckedChange: props.onCheckedChange,
4203
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4204
+ Checkbox,
4205
+ {
4206
+ checked: props.checked,
4207
+ onCheckedChange: () => props.onCheckedChange,
4208
+ children
4209
+ }
4210
+ )
4211
+ }
4212
+ );
4213
+ });
4214
+ MenuCheckboxItem.displayName = "MenuCheckboxItem";
4215
+ var MenuSeparator = React20.forwardRef(({ ...props }) => {
4216
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Separator, { ...props });
4217
+ });
4218
+ MenuSeparator.displayName = "MenuSeparator";
4098
4219
  var NativeSelect = React20__namespace.forwardRef(function NativeSelect2(props, ref) {
4099
4220
  const {
4100
4221
  children,
@@ -7602,6 +7723,19 @@ var comboboxAnatomy = react$1.comboboxAnatomy.extendWith(
7602
7723
  "indicatorGroup",
7603
7724
  "empty"
7604
7725
  );
7726
+ var menuAnatomy = anatomy.createAnatomy("menu").parts(
7727
+ "trigger",
7728
+ "content",
7729
+ "item",
7730
+ "itemGroup",
7731
+ "triggerItem",
7732
+ "itemCommand",
7733
+ "itemGroupLabel",
7734
+ "separator",
7735
+ "radioItem",
7736
+ "triggerItem",
7737
+ "checkboxItem"
7738
+ );
7605
7739
 
7606
7740
  // src/theme/slot-recipes/accordion.ts
7607
7741
  var accordionSlotRecipe = react.defineSlotRecipe({
@@ -9890,6 +10024,107 @@ var mediaControllerSlotRecipe = react.defineSlotRecipe({
9890
10024
  }
9891
10025
  ]
9892
10026
  });
10027
+ var menuSlotRecipe = react.defineSlotRecipe({
10028
+ className: "menu",
10029
+ slots: menuAnatomy.keys(),
10030
+ base: {
10031
+ content: {
10032
+ bg: "bg",
10033
+ borderRadius: "sm",
10034
+ boxShadow: "sm",
10035
+ width: "fit-content",
10036
+ padding: "1",
10037
+ display: "flex",
10038
+ flexDirection: "column",
10039
+ gap: "0.5",
10040
+ zIndex: "dropdown",
10041
+ _open: {
10042
+ animationStyle: "slide-fade-in",
10043
+ animationDuration: "fast",
10044
+ zIndex: "popover",
10045
+ outline: "none"
10046
+ }
10047
+ },
10048
+ itemGroup: {
10049
+ display: "flex",
10050
+ flexDirection: "column",
10051
+ gap: "0.5"
10052
+ },
10053
+ item: {
10054
+ borderRadius: "9px",
10055
+ padding: "2",
10056
+ display: "flex",
10057
+ justifyContent: "space-between",
10058
+ gap: 1.5,
10059
+ _hover: {
10060
+ backgroundColor: "accent.surface.hover"
10061
+ },
10062
+ "&:active": {
10063
+ backgroundColor: "accent.surface.active"
10064
+ },
10065
+ _checked: {
10066
+ backgroundColor: "accent.surface"
10067
+ },
10068
+ _highlighted: {
10069
+ backgroundColor: "ghost.surface.hover"
10070
+ }
10071
+ },
10072
+ itemGroupLabel: {
10073
+ paddingY: "1",
10074
+ fontWeight: "bold",
10075
+ fontSize: "xs"
10076
+ },
10077
+ itemCommand: {
10078
+ fontSize: "2xs"
10079
+ },
10080
+ separator: {
10081
+ color: "outline"
10082
+ },
10083
+ radioItem: {
10084
+ display: "flex",
10085
+ justifyContent: "space-between",
10086
+ gap: 2
10087
+ },
10088
+ triggerItem: {
10089
+ display: "flex",
10090
+ justifyContent: "space-between",
10091
+ gap: 1.5,
10092
+ alignItems: "center"
10093
+ },
10094
+ checkboxItem: {
10095
+ display: "flex",
10096
+ gap: 2,
10097
+ alignItems: "center",
10098
+ width: "full"
10099
+ }
10100
+ },
10101
+ variants: {
10102
+ variant: {
10103
+ core: {
10104
+ content: {
10105
+ border: "1px solid",
10106
+ borderColor: "core.outline"
10107
+ }
10108
+ },
10109
+ accent: {
10110
+ content: {
10111
+ border: "1px solid",
10112
+ borderColor: "core.outline"
10113
+ }
10114
+ },
10115
+ floating: {
10116
+ content: {
10117
+ border: "sm",
10118
+ borderColor: "floating.outline",
10119
+ boxShadow: "lg"
10120
+ }
10121
+ }
10122
+ }
10123
+ },
10124
+ defaultVariants: {
10125
+ variant: "core"
10126
+ }
10127
+ });
9893
10128
  var _a5, _b4;
9894
10129
  var nativeSelectSlotRecipe = react.defineSlotRecipe({
9895
10130
  slots: NativeSelectAnatomy.keys(),
@@ -11253,7 +11488,8 @@ var slotRecipes = {
11253
11488
  toast: toastSlotRecipe,
11254
11489
  checkboxCard: choiceChipSlotRecipe,
11255
11490
  collapsible: collapsibleSlotRecipe,
11256
- tooltip: popoverSlotRecipe
11491
+ tooltip: popoverSlotRecipe,
11492
+ menu: menuSlotRecipe
11257
11493
  };
11258
11494
  var animations = react.defineTokens.animations({
11259
11495
  spin: {
@@ -12441,6 +12677,16 @@ exports.List = List;
12441
12677
  exports.ListBox = ListBox;
12442
12678
  exports.ListIndicator = ListIndicator;
12443
12679
  exports.ListItem = ListItem2;
12680
+ exports.Menu = Menu;
12681
+ exports.MenuCheckboxItem = MenuCheckboxItem;
12682
+ exports.MenuContent = MenuContent;
12683
+ exports.MenuItem = MenuItem;
12684
+ exports.MenuItemGroup = MenuItemGroup;
12685
+ exports.MenuRadioItem = MenuRadioItem;
12686
+ exports.MenuRadioItemGroup = MenuRadioItemGroup;
12687
+ exports.MenuSeparator = MenuSeparator;
12688
+ exports.MenuTrigger = MenuTrigger;
12689
+ exports.MenuTriggerItem = MenuTriggerItem;
12444
12690
  exports.NativeSelect = NativeSelect;
12445
12691
  exports.Nudge = Nudge;
12446
12692
  exports.NudgeActions = NudgeActions;
@@ -12521,6 +12767,7 @@ exports.themes = themes;
12521
12767
  exports.useCalendar = useCalendar;
12522
12768
  exports.useColorMode = useColorMode;
12523
12769
  exports.useColorModeValue = useColorModeValue;
12770
+ exports.useMenuContext = useMenuContext;
12524
12771
  exports.useTableSort = useTableSort;
12525
12772
  exports.useTranslation = useTranslation;
12526
12773
  //# sourceMappingURL=out.js.map