@fluidattacks/design 11.11.0 → 11.12.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.
@@ -2,6 +2,8 @@ import { Meta } from '@storybook/react-vite';
2
2
  import { IComboBoxProps } from '.';
3
3
  declare const config: Meta;
4
4
  declare const Default: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
5
+ declare const optionStates: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
6
+ declare const disabledMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
5
7
  declare const multiSelectWithAll: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
6
8
  declare const withEmptyMessage: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
7
9
  declare const withStatusMessage: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
@@ -11,5 +13,5 @@ declare const narrowMultiSelect: import('storybook/internal/csf').AnnotatedStory
11
13
  declare const countLabelMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
12
14
  declare const whiteOptionsMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
13
15
  declare const preselectedMultiSelect: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, IComboBoxProps>;
14
- export { countLabelMultiSelect, Default, multiSelectWithAll, withEmptyMessage, withStatusMessage, withClearButton, groupedMultiSelect, narrowMultiSelect, preselectedMultiSelect, whiteOptionsMultiSelect, };
16
+ export { countLabelMultiSelect, Default, disabledMultiSelect, multiSelectWithAll, optionStates, withEmptyMessage, withStatusMessage, withClearButton, groupedMultiSelect, narrowMultiSelect, preselectedMultiSelect, whiteOptionsMultiSelect, };
15
17
  export default config;
@@ -1,3 +1,3 @@
1
1
  import { IOptionProps } from '../types';
2
- declare const Option: <T extends object>({ allItemKeys, containerRef, countLabel, item, multiSelection, name, popoverRef, setInputValue, setValue, state, tag, watch, }: Readonly<IOptionProps<T>>) => JSX.Element;
2
+ declare const Option: <T extends object>({ allItemKeys, containerRef, countLabel, icon, item, multiSelection, name, popoverRef, setInputValue, setValue, state, tag, watch, }: Readonly<IOptionProps<T>>) => JSX.Element;
3
3
  export { Option };
@@ -1,137 +1,153 @@
1
- import { jsx as l, jsxs as H } from "react/jsx-runtime";
2
- import { useRef as J, useMemo as k, useCallback as f } from "react";
3
- import { useOption as Q } from "../../../../../node_modules/react-aria/dist/private/listbox/useOption.js";
4
- import { useTheme as W } from "styled-components";
5
- import { StyledOption as X } from "../styles.js";
6
- import { describeSelection as Y, toSelection as u } from "../utils.js";
7
- import { Checkbox as D } from "../../../../checkbox/index.js";
8
- import { Icon as Z } from "../../../../icon/index.js";
9
- import { Link as _ } from "../../../../link/index.js";
10
- import { Tag as I } from "../../../../tag/index.js";
1
+ import { jsxs as D, Fragment as X, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as Y, useMemo as f, useCallback as k } from "react";
3
+ import { useOption as Z } from "../../../../../node_modules/react-aria/dist/private/listbox/useOption.js";
4
+ import { useTheme as _ } from "styled-components";
5
+ import { StyledOption as I } from "../styles.js";
6
+ import { describeSelection as V, toSelection as F } from "../utils.js";
7
+ import { Checkbox as w } from "../../../../checkbox/index.js";
8
+ import { Icon as N } from "../../../../icon/index.js";
9
+ import { Link as oo } from "../../../../link/index.js";
10
+ import { Tag as eo } from "../../../../tag/index.js";
11
11
  import "../../../../typography/heading/index.js";
12
12
  import "../../../../typography/span/index.js";
13
- import { Text as V } from "../../../../typography/text/index.js";
14
- import { useClickOutside as oo } from "../../../../../hooks/use-click-outside.js";
15
- import { openUrl as eo } from "../../../../../utils/open-url.js";
16
- const yo = ({
17
- allItemKeys: a,
18
- containerRef: w,
19
- countLabel: $,
13
+ import { Text as ro } from "../../../../typography/text/index.js";
14
+ import { useClickOutside as to } from "../../../../../hooks/use-click-outside.js";
15
+ import { openUrl as io } from "../../../../../utils/open-url.js";
16
+ const bo = ({
17
+ allItemKeys: g,
18
+ containerRef: q,
19
+ countLabel: O,
20
+ icon: $,
20
21
  item: o,
21
22
  multiSelection: s,
22
23
  name: e,
23
- popoverRef: z,
24
- setInputValue: t,
25
- setValue: n,
26
- state: c,
27
- tag: y,
24
+ popoverRef: B,
25
+ setInputValue: c,
26
+ setValue: t,
27
+ state: i,
28
+ tag: A,
28
29
  watch: h
29
30
  }) => {
30
- const F = W(), C = J(null), d = o.props.hrefLang, g = c.disabledKeys, A = a.filter(
31
- (r) => !Array.from(g).includes(r) && r !== "All"
32
- ), { optionProps: q, isSelected: S, isFocused: B, isDisabled: O } = Q(
31
+ const K = _(), b = Y(null), d = o.props.hrefLang, y = i.disabledKeys, m = g.filter(
32
+ (r) => !Array.from(y).includes(r) && r !== "All"
33
+ ), { optionProps: M, isSelected: v, isFocused: P, isDisabled: p } = Z(
33
34
  { key: o.key },
34
- c,
35
- C
36
- ), b = k(() => c.collection.getItem("All")?.rendered?.toString(), [c.collection]), K = [
37
- S ? "selected" : "",
38
- B ? "focused" : "",
39
- O ? "disabled" : ""
40
- ].join(" "), m = f(
35
+ i,
36
+ b
37
+ ), x = f(() => i.collection.getItem("All")?.rendered?.toString(), [i.collection]), R = [
38
+ v ? "selected" : "",
39
+ P ? "focused" : "",
40
+ p ? "disabled" : ""
41
+ ].join(" "), S = k(
41
42
  (r) => {
42
- const { allSelected: i, text: p } = Y(
43
+ const { allSelected: l, text: a } = V(
43
44
  r,
44
- a,
45
45
  g,
46
- b,
47
- $
46
+ y,
47
+ x,
48
+ O
48
49
  );
49
- n?.(`${e}CheckAll`, i ? p : ""), t(p);
50
+ t?.(`${e}CheckAll`, l ? a : ""), c(a);
50
51
  },
51
52
  [
52
- a,
53
- b,
54
- $,
55
53
  g,
54
+ x,
55
+ O,
56
+ y,
56
57
  e,
57
- t,
58
- n
58
+ c,
59
+ t
59
60
  ]
60
- ), M = f(
61
+ ), U = k(
61
62
  (r) => {
62
63
  if (r.target.checked) {
63
- const i = [...A].sort();
64
- n?.(`${e}Options`, i), n?.(`${e}CheckAll`, r.target.value), t(r.target.value);
64
+ const l = [...m].sort();
65
+ t?.(`${e}Options`, l), t?.(`${e}CheckAll`, r.target.value), c(r.target.value);
65
66
  } else
66
- n?.(`${e}Options`, []), n?.(`${e}CheckAll`, ""), t("");
67
+ t?.(`${e}Options`, []), t?.(`${e}CheckAll`, ""), c("");
67
68
  },
68
- [A, e, t, n]
69
- ), N = f(
69
+ [m, e, c, t]
70
+ ), E = k(
70
71
  (r) => {
71
- const i = r.target.value, p = u(h?.(`${e}Options`)), j = r.target.checked ? [...p, i] : p.filter((G) => G !== i);
72
- n?.(`${e}Options`, j), m(j);
72
+ const l = r.target.value, a = F(h?.(`${e}Options`)), z = r.target.checked ? [...a, l] : a.filter((W) => W !== l);
73
+ t?.(`${e}Options`, z), S(z);
73
74
  },
74
- [e, n, h, m]
75
- ), v = h?.(`${e}Options`), x = k(
76
- () => u(v),
77
- [v]
78
- ), P = k(
79
- () => x.includes(o.key.toString()),
80
- [x, o.key]
81
- ), L = h?.(`${e}CheckAll`), R = k(() => !!L, [L]), U = o.key === "All" ? /* @__PURE__ */ l(
82
- D,
75
+ [e, t, h, S]
76
+ ), u = h?.(`${e}Options`), L = f(
77
+ () => F(u),
78
+ [u]
79
+ ), G = f(
80
+ () => L.includes(o.key.toString()),
81
+ [L, o.key]
82
+ ), T = h?.(`${e}CheckAll`), H = f(() => !!T, [T]), C = /* @__PURE__ */ D(X, { children: [
83
+ $ === void 0 ? void 0 : /* @__PURE__ */ n(
84
+ N,
85
+ {
86
+ icon: $,
87
+ iconSize: "lg",
88
+ iconType: "fa-light",
89
+ spanClass: "option-icon"
90
+ }
91
+ ),
92
+ /* @__PURE__ */ n("span", { className: "option-name", children: o.rendered })
93
+ ] }), J = o.key === "All" ? /* @__PURE__ */ n(
94
+ w,
83
95
  {
84
- checked: R,
85
- label: o.rendered?.toString(),
96
+ checked: H,
97
+ "data-testid": o.textValue,
98
+ disabled: p,
99
+ label: C,
86
100
  name: `${e}CheckAll`,
87
- onChange: M,
101
+ onChange: U,
88
102
  value: o.rendered?.toString()
89
103
  }
90
- ) : /* @__PURE__ */ l(
91
- D,
104
+ ) : /* @__PURE__ */ n(
105
+ w,
92
106
  {
93
- checked: P,
94
- label: o.rendered?.toString(),
107
+ checked: G,
108
+ "data-testid": o.textValue,
109
+ disabled: p,
110
+ label: C,
95
111
  name: `${e}Options`,
96
- onChange: N,
112
+ onChange: E,
97
113
  value: o.key.toString()
98
114
  }
99
- ), T = s && !O ? U : /* @__PURE__ */ l(
100
- V,
115
+ ), j = s ? J : /* @__PURE__ */ n(
116
+ ro,
101
117
  {
102
- color: F.palette.gray[800],
118
+ color: K.palette.gray[800],
103
119
  size: "md",
104
120
  textOverflow: "ellipsis",
105
121
  whiteSpace: "nowrap",
106
- children: o.rendered
122
+ children: C
107
123
  }
108
- ), E = f(
124
+ ), Q = k(
109
125
  (r) => {
110
- r.preventDefault(), t(o.rendered?.toString() ?? ""), c.setSelectedKey(o.key), requestAnimationFrame(() => {
111
- c.setOpen(!1);
112
- }), eo(d);
126
+ r.preventDefault(), c(o.rendered?.toString() ?? ""), i.setSelectedKey(o.key), requestAnimationFrame(() => {
127
+ i.setOpen(!1);
128
+ }), io(d);
113
129
  },
114
- [d, o.key, o.rendered, c, t]
130
+ [d, o.key, o.rendered, i, c]
115
131
  );
116
- return oo(z, () => {
117
- s && c.close();
118
- }, [w]), /* @__PURE__ */ H(
119
- X,
132
+ return to(B, () => {
133
+ s && i.close();
134
+ }, [q]), /* @__PURE__ */ D(
135
+ I,
120
136
  {
121
- ...!s && !d ? q : {},
137
+ ...!s && !d ? M : {},
122
138
  $multiSelection: s,
123
- className: K,
139
+ className: R,
124
140
  "data-testid": `${e}-option-${o.key}`,
125
- ref: C,
141
+ ref: b,
126
142
  title: o.textValue,
127
143
  children: [
128
- d ? /* @__PURE__ */ l(_, { href: d, onClick: E, children: T }) : T,
129
- S && !O && !s ? /* @__PURE__ */ l(Z, { icon: "check", iconSize: "sm", iconType: "fa-light" }) : void 0,
130
- y === void 0 ? void 0 : /* @__PURE__ */ l(I, { tagLabel: y, variant: "inactive" })
144
+ d && !p ? /* @__PURE__ */ n(oo, { href: d, onClick: Q, children: j }) : j,
145
+ v && !p && !s ? /* @__PURE__ */ n(N, { icon: "check", iconSize: "sm", iconType: "fa-light" }) : void 0,
146
+ A === void 0 ? void 0 : /* @__PURE__ */ n(eo, { tagLabel: A, variant: "inactive" })
131
147
  ]
132
148
  }
133
149
  );
134
150
  };
135
151
  export {
136
- yo as Option
152
+ bo as Option
137
153
  };
@@ -1,12 +1,13 @@
1
- declare const StyledDropdown: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "$hasStatus" | "$multiSelection" | "$width"> & {
2
- $hasStatus: boolean;
3
- $multiSelection: boolean;
1
+ declare const StyledMenu: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
4
2
  $width: number;
5
- }, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "$hasStatus" | "$multiSelection" | "$width"> & {
6
- $hasStatus: boolean;
7
- $multiSelection: boolean;
3
+ }, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$width"> & {
8
4
  $width: number;
9
5
  }, never>>> & string;
6
+ declare const StyledDropdown: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "$multiSelection"> & {
7
+ $multiSelection: boolean;
8
+ }, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "$multiSelection"> & {
9
+ $multiSelection: boolean;
10
+ }, never>>> & string;
10
11
  declare const StyledOption: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$multiSelection"> & {
11
12
  $multiSelection: boolean;
12
13
  }, never> & Partial<Pick<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "$multiSelection"> & {
@@ -73,5 +74,5 @@ declare const ChevronIconButton: import('styled-components/dist/types').IStyledC
73
74
  forwardedAs?: import('styled-components').WebTarget | undefined;
74
75
  }, never>>> & string;
75
76
  declare const StyledGroupHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>>> & string;
76
- declare const StyledStatusMessage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>>> & string;
77
- export { StyledDropdown, StyledOption, StyledEmptyMessage, StyledGroupHeader, StyledStatusMessage, ChevronIconButton, };
77
+ declare const StyledStatusMessage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
78
+ export { StyledDropdown, StyledMenu, StyledOption, StyledEmptyMessage, StyledGroupHeader, StyledStatusMessage, ChevronIconButton, };
@@ -1,41 +1,45 @@
1
- import { styled as o } from "styled-components";
2
- import { StyledIconButton as l } from "../../../icon-button/styles.js";
3
- const t = o.ul`
4
- ${({ theme: a, $hasStatus: n, $multiSelection: p, $width: i }) => `
1
+ import { styled as n } from "styled-components";
2
+ import { LabelText as i } from "../../../checkbox/styles.js";
3
+ import { StyledIconButton as p } from "../../../icon-button/styles.js";
4
+ const s = n.div`
5
+ ${({ theme: o, $width: a }) => `
5
6
  align-self: center;
6
- background: ${a.palette.white};
7
- border: 1px solid ${a.palette.gray[200]};
8
- border-radius: ${a.spacing[0.25]};
9
- box-shadow: ${a.shadows.md};
7
+ background: ${o.palette.white};
8
+ border: 1px solid ${o.palette.gray[200]};
9
+ border-radius: ${o.spacing[0.5]};
10
+ box-shadow: ${o.shadows.md};
11
+ min-width: ${a < 240 ? a : 240}px;
12
+ padding: ${o.spacing[0.25]} 0;
13
+ width: 95%;
14
+ `}
15
+ `, d = n.ul`
16
+ ${({ theme: o, $multiSelection: a }) => `
10
17
  list-style: none;
11
18
  max-height: 200px;
12
- min-width: ${i < 240 ? i : 240}px;
13
19
  overflow: hidden auto;
14
- padding: ${a.spacing[0.25]} 0 ${n ? "0" : a.spacing[0.25]} 0;
15
- scrollbar-color: ${a.palette.gray[600]} ${a.palette.gray[100]};
16
- scroll-padding: ${a.spacing[0.5]};
17
- width: 95%;
20
+ scrollbar-color: ${o.palette.gray[600]} ${o.palette.gray[100]};
21
+ scroll-padding: ${o.spacing[0.5]};
18
22
 
19
23
  > li:first-child {
20
- border-bottom: ${p ? `1px solid ${a.palette.gray[200]}` : "unset"};
24
+ border-bottom: ${a ? `1px solid ${o.palette.gray[200]}` : "unset"};
21
25
  }
22
26
  `}
23
- `, d = o.li`
24
- ${({ theme: a, $multiSelection: n }) => `
27
+ `, c = n.li`
28
+ ${({ theme: o, $multiSelection: a }) => `
25
29
  align-items: center;
26
- background: ${a.palette.white};
27
- color: ${a.palette.gray[800]};
30
+ background: ${o.palette.white};
31
+ color: ${o.palette.gray[800]};
28
32
  cursor: pointer;
29
33
  display: flex;
30
- gap: ${a.spacing[0.5]};
34
+ gap: ${o.spacing[0.5]};
31
35
  justify-content: space-between;
32
- line-height: ${a.spacing[1.25]};
33
- padding: ${n ? `${a.spacing[0.125]} ${a.spacing[0.75]}` : `${a.spacing[0.25]} ${a.spacing[1]}`};
36
+ line-height: ${o.spacing[1.25]};
37
+ padding: ${a ? `${o.spacing[0.125]} ${o.spacing[0.75]}` : `${o.spacing[0.25]} ${o.spacing[1]}`};
34
38
 
35
39
  a, p, label {
36
40
  display: inline-flex;
37
41
  overflow: hidden;
38
- padding: ${n ? a.spacing[0.25] : "0"};
42
+ padding: ${a ? o.spacing[0.25] : "0"};
39
43
  width: 100%;
40
44
  }
41
45
 
@@ -50,44 +54,56 @@ const t = o.ul`
50
54
  }
51
55
 
52
56
  span {
53
- color: ${a.palette.gray[700]};
57
+ color: ${o.palette.gray[700]};
58
+ }
59
+
60
+ .option-icon {
61
+ color: ${o.palette.gray[800]};
62
+ margin-right: ${o.spacing[0.5]};
63
+ }
64
+
65
+ .option-name {
66
+ color: ${o.palette.gray[800]};
54
67
  }
55
68
 
56
69
  &:hover:not(.disabled, .selected) {
57
- background: ${a.palette.gray[100]};
70
+ background: ${o.palette.gray[50]};
58
71
  }
59
72
 
60
73
  &.selected {
61
- background: ${n ? a.palette.white : a.palette.gray[200]};
74
+ background: ${a ? o.palette.white : o.palette.gray[100]};
62
75
  }
63
76
 
64
77
  &.disabled {
65
- background: ${a.palette.gray[100]};
66
78
  cursor: not-allowed;
67
79
 
68
- p, span {
69
- color: ${a.palette.gray[500]};
80
+ input:disabled ~ ${i} {
81
+ opacity: 1;
82
+ }
83
+
84
+ .option-icon {
85
+ opacity: 0.4;
86
+ }
87
+
88
+ .option-name {
89
+ color: ${o.palette.gray[600]};
90
+ opacity: 0.5;
70
91
  }
71
92
  }
72
93
  `}
73
- `, c = o.li`
74
- ${({ theme: a }) => `
75
- align-items: center;
76
- color: ${a.palette.gray[400]};
77
- display: flex;
78
- gap: ${a.spacing[0.5]};
79
- justify-content: space-between;
80
- line-height: ${a.spacing[1.25]};
81
- padding: ${a.spacing[0.25]} ${a.spacing[1]};
82
- size: 28;
94
+ `, g = n.li`
95
+ ${({ theme: o }) => `
96
+ line-height: ${o.spacing[1.25]};
97
+ padding: ${o.spacing[1]};
98
+ text-align: center;
83
99
  `}
84
- `, g = o(l)`
85
- ${({ disabled: a, theme: n }) => `
100
+ `, e = n(p)`
101
+ ${({ disabled: o, theme: a }) => `
86
102
  position: relative;
87
103
 
88
104
  & .chevron-down span,
89
105
  & .chevron-up span {
90
- ${a ? `color: ${n.palette.gray[300]};` : ""}
106
+ ${o ? `color: ${a.palette.gray[300]};` : ""}
91
107
  }
92
108
 
93
109
  /* CLOSE STATE */
@@ -104,36 +120,40 @@ const t = o.ul`
104
120
  display: none;
105
121
  }
106
122
  `}
107
- `, e = o.li`
108
- ${({ theme: a }) => `
109
- border-top: 1px solid ${a.palette.gray[200]};
110
- color: ${a.palette.gray[400]};
123
+ `, $ = n.li`
124
+ ${({ theme: o }) => `
125
+ border-top: 1px solid ${o.palette.gray[200]};
126
+ color: ${o.palette.gray[400]};
111
127
  cursor: default;
112
128
  font-weight: bold;
113
- line-height: ${a.spacing[1.25]};
114
- margin-bottom: ${a.spacing[0.625]};
115
- margin-top: ${a.spacing[0.625]};
116
- padding: ${a.spacing[0.25]} ${a.spacing[1]};
129
+ line-height: ${o.spacing[1.25]};
130
+ margin-bottom: ${o.spacing[0.625]};
131
+ margin-top: ${o.spacing[0.625]};
132
+ padding: ${o.spacing[0.25]} ${o.spacing[1]};
117
133
  user-select: none;
118
134
  `}
119
- `, $ = o.li`
120
- ${({ theme: a }) => `
121
- background: ${a.palette.white};
122
- border-top: 1px solid ${a.palette.gray[200]};
123
- bottom: 0;
124
- color: ${a.palette.gray[400]};
135
+ `, y = n.div`
136
+ ${({ theme: o }) => `
137
+ border-bottom: 1px solid ${o.palette.gray[200]};
125
138
  cursor: default;
126
- line-height: ${a.spacing[1.25]};
127
- padding: ${a.spacing[0.25]} ${a.spacing[1]};
128
- position: sticky;
139
+ line-height: ${o.spacing[1.25]};
140
+ margin-bottom: ${o.spacing[0.5]};
141
+ padding: ${o.spacing[0.25]} ${o.spacing[1]} ${o.spacing[0.75]};
129
142
  user-select: none;
143
+
144
+ &:has(+ ul:empty) {
145
+ border-bottom: none;
146
+ margin-bottom: 0;
147
+ padding-bottom: ${o.spacing[0.25]};
148
+ }
130
149
  `}
131
150
  `;
132
151
  export {
133
- g as ChevronIconButton,
134
- t as StyledDropdown,
135
- c as StyledEmptyMessage,
136
- e as StyledGroupHeader,
137
- d as StyledOption,
138
- $ as StyledStatusMessage
152
+ e as ChevronIconButton,
153
+ d as StyledDropdown,
154
+ g as StyledEmptyMessage,
155
+ $ as StyledGroupHeader,
156
+ s as StyledMenu,
157
+ c as StyledOption,
158
+ y as StyledStatusMessage
139
159
  };
@@ -1,3 +1,4 @@
1
+ import { IconName } from '@fortawesome/free-solid-svg-icons';
1
2
  import { Key, Node } from '@react-types/shared';
2
3
  import { InputHTMLAttributes, MutableRefObject } from 'react';
3
4
  import { Control, UseFormSetValue, UseFormWatch } from 'react-hook-form';
@@ -8,13 +9,15 @@ import { IOutlineContainerProps } from '../../types';
8
9
  * @interface IItem
9
10
  * @property { string } [group] - Optional group header for the item.
10
11
  * @property { string } [href] - The href of the item.
12
+ * @property { IconName } [icon] - Optional icon shown before the name.
11
13
  * @property { string } name - The name of the item.
12
- * @property { string } [tag] - Optional tag of the item.
14
+ * @property { string } [tag] - Optional tag shown at the end of the item.
13
15
  * @property { string } value - The value of the item.
14
16
  */
15
17
  interface IItem {
16
18
  group?: string;
17
19
  href?: string;
20
+ icon?: IconName;
18
21
  name: string;
19
22
  tag?: string;
20
23
  value: string;
@@ -24,6 +27,7 @@ interface IItem {
24
27
  * @interface IOptionProps
25
28
  * @property { MutableRefObject } containerRef - The ref of the ComboBox container.
26
29
  * @property { string } [countLabel] - Plural noun of the selection summary.
30
+ * @property { IconName } [icon] - Optional icon shown before the name.
27
31
  * @property { IItem } item - The item to be rendered as an option.
28
32
  * @property { boolean } multiSelection - Enable to select more than one option.
29
33
  * @property { string } name - The name of the Select.
@@ -35,6 +39,7 @@ interface IOptionProps<T> {
35
39
  allItemKeys: string[];
36
40
  containerRef: MutableRefObject<HTMLDivElement | null>;
37
41
  countLabel?: string;
42
+ icon?: IconName;
38
43
  item: Node<IItem>;
39
44
  multiSelection: boolean;
40
45
  name: string;
@@ -57,8 +62,8 @@ interface IOptionProps<T> {
57
62
  * @property { Function } [onChange] - The callback to be called on input change.
58
63
  * @property { string } [placeholder] - The placeholder for the input.
59
64
  * @property { string } [emptyMessage] - Message shown when no items are present.
60
- * @property { string } [statusMessage] - Message shown inside the dropdown,
61
- * next to the items it describes.
65
+ * @property { string } [statusMessage] - Message fixed at the top of the
66
+ * dropdown, above the items it describes.
62
67
  * @property { boolean } [clearable] - Whether the clear button is shown.
63
68
  * @property {Function} [onClear] - Called when the clear button is clicked.
64
69
  * @property { string } [countLabel] - Plural noun that summarizes two or
@@ -1,17 +1,17 @@
1
1
  import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { useRef as P, useCallback as y } from "react";
3
- import { useButton as x } from "../../../../node_modules/react-aria/dist/private/button/useButton.js";
2
+ import { useRef as $, useCallback as x } from "react";
3
+ import { useButton as y } from "../../../../node_modules/react-aria/dist/private/button/useButton.js";
4
4
  import { useOverlayTrigger as T } from "../../../../node_modules/react-aria/dist/private/overlays/useOverlayTrigger.js";
5
5
  import { useOverlayTriggerState as v } from "../../../../node_modules/react-stately/dist/private/overlays/useOverlayTriggerState.js";
6
6
  import { MonthPanel as O } from "./panel.js";
7
- import { TriggerButton as S } from "./styles.js";
8
- import { formatPeriod as C } from "./utils.js";
9
- import { OutlineContainer as j } from "../../outline-container/index.js";
10
- import { Dialog as k } from "../../utils/dialog/index.js";
11
- import { Popover as z } from "../../utils/popover/index.js";
12
- import { theme as B } from "../../../colors/index.js";
7
+ import { TriggerButton as S, PeriodText as C } from "./styles.js";
8
+ import { formatPeriod as j } from "./utils.js";
9
+ import { OutlineContainer as k } from "../../outline-container/index.js";
10
+ import { Dialog as z } from "../../utils/dialog/index.js";
11
+ import { Popover as B } from "../../utils/popover/index.js";
12
+ import { theme as D } from "../../../colors/index.js";
13
13
  import { Icon as p } from "../../../icon/index.js";
14
- const L = ({
14
+ const N = ({
15
15
  disabled: t = !1,
16
16
  label: n,
17
17
  maxValue: a,
@@ -20,20 +20,20 @@ const L = ({
20
20
  onChange: s,
21
21
  value: l
22
22
  }) => {
23
- const e = P(null), r = v({}), { close: c } = r, { triggerProps: d, overlayProps: h } = T(
23
+ const e = $(null), r = v({}), { close: c } = r, { triggerProps: d, overlayProps: h } = T(
24
24
  { type: "dialog" },
25
25
  r,
26
26
  e
27
- ), { buttonProps: u } = x(
27
+ ), { buttonProps: u } = y(
28
28
  { ...d, isDisabled: t, onPress: r.toggle },
29
29
  e
30
- ), b = y(
31
- ($) => {
32
- s($), c();
30
+ ), b = x(
31
+ (P) => {
32
+ s(P), c();
33
33
  },
34
34
  [c, s]
35
- ), m = B.palette.gray[t ? 400 : 700];
36
- return /* @__PURE__ */ f(j, { htmlFor: i, label: n, children: [
35
+ ), m = D.palette.gray[t ? 400 : 700];
36
+ return /* @__PURE__ */ f(k, { htmlFor: i, label: n, children: [
37
37
  /* @__PURE__ */ f(S, { ...u, id: i, ref: e, children: [
38
38
  /* @__PURE__ */ o(
39
39
  p,
@@ -44,7 +44,7 @@ const L = ({
44
44
  iconType: "fa-light"
45
45
  }
46
46
  ),
47
- /* @__PURE__ */ o("span", { children: C(l) }),
47
+ /* @__PURE__ */ o(C, { children: j(l) }),
48
48
  /* @__PURE__ */ o(
49
49
  p,
50
50
  {
@@ -56,13 +56,13 @@ const L = ({
56
56
  )
57
57
  ] }),
58
58
  r.isOpen && !t ? /* @__PURE__ */ o(
59
- z,
59
+ B,
60
60
  {
61
61
  offset: 8,
62
62
  placement: "bottom end",
63
63
  state: r,
64
64
  triggerRef: e,
65
- children: /* @__PURE__ */ o(k, { ...h, "aria-label": n ?? i, children: /* @__PURE__ */ o(
65
+ children: /* @__PURE__ */ o(z, { ...h, "aria-label": n ?? i, children: /* @__PURE__ */ o(
66
66
  O,
67
67
  {
68
68
  maxValue: a,
@@ -77,5 +77,5 @@ const L = ({
77
77
  ] });
78
78
  };
79
79
  export {
80
- L as MonthPicker
80
+ N as MonthPicker
81
81
  };
@@ -91,8 +91,6 @@ const D = 0, B = 11, v = (t) => t === void 0 ? void 0 : M(t)?.year, H = (t, e, r
91
91
  t
92
92
  ),
93
93
  onClick: u,
94
- px: 0.5,
95
- py: 0.625,
96
94
  variant: "textLink",
97
95
  children: "Today"
98
96
  }