@temp-spotwork/ui 1.4.3 → 1.4.5

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,3 +1,5 @@
1
+ import { default as React } from 'react';
2
+
1
3
  export type ContextSearchProps = {
2
4
  /**
3
5
  * value of the input
@@ -15,5 +17,17 @@ export type ContextSearchProps = {
15
17
  * disabled
16
18
  */
17
19
  disabled?: boolean;
20
+ /**
21
+ * class name for the container
22
+ */
23
+ className?: string;
24
+ /**
25
+ * css styles for the input
26
+ */
27
+ style?: React.CSSProperties;
28
+ /**
29
+ * prevent browser suggestions
30
+ */
31
+ preventBrowserSuggestions?: boolean;
18
32
  };
19
- export declare const ContextSearch: ({ value, onChange, placeholder, disabled, }: ContextSearchProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const ContextSearch: ({ value, onChange, placeholder, disabled, className, style, preventBrowserSuggestions, }: ContextSearchProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,52 +1,51 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { useState as p } from "react";
3
- import { Icons as n } from "../../../atoms/icons/icons.js";
1
+ import { jsxs as b, jsx as r } from "react/jsx-runtime";
2
+ import { useState as x } from "react";
3
+ import { Icons as g } from "../../../atoms/icons/icons.js";
4
4
  import "../../../atoms/icons/iconsSVGs/Large/Profile.js";
5
5
  import "../../../atoms/icons/iconsSVGs/Small/Profile.js";
6
6
  import { t as s } from "../../../../bundle-mjs-CAy1p0fn.js";
7
7
  import { outlinedBorder as l } from "../../../styles/defaults/defaults.js";
8
8
  import "../../../../purify.es-eYFoHPwR.js";
9
- import { styleMap as b } from "../../../styles/typography/style.js";
9
+ import { styleMap as v } from "../../../styles/typography/style.js";
10
10
  import "../../../styles/colors/colormap.js";
11
- const w = ({
11
+ const $ = ({
12
12
  value: a,
13
13
  onChange: e,
14
14
  placeholder: i,
15
- disabled: o = !1
15
+ disabled: o = !1,
16
+ className: c,
17
+ style: m,
18
+ preventBrowserSuggestions: u = !1
16
19
  }) => {
17
- const [c, r] = p(!1), m = () => {
18
- r(!0);
19
- }, u = () => {
20
- r(!1);
20
+ const [f, t] = x(!1), p = () => {
21
+ t(!0);
22
+ }, d = () => {
23
+ t(!1);
21
24
  };
22
- return /* @__PURE__ */ d(
25
+ return /* @__PURE__ */ b(
23
26
  "div",
24
27
  {
25
28
  className: s(
26
29
  `h-[3rem] flex items-center gap-xs px-xs bg-surface-default ${l.base} border-bcolor-default `,
27
- c && l.active,
28
- o && "bg-surface-disabled border-bcolor-disabled"
30
+ f && l.active,
31
+ o && "bg-surface-disabled border-bcolor-disabled",
32
+ c
29
33
  ),
34
+ style: m,
30
35
  children: [
31
- /* @__PURE__ */ t(
32
- n,
33
- {
34
- disabled: !0,
35
- icon: "MagnifyingGlassSmall",
36
- color: o ? "disabled" : "active"
37
- }
38
- ),
39
- /* @__PURE__ */ t(
36
+ /* @__PURE__ */ r(g, { disabled: !0, icon: "MagnifyingGlassSmall", color: o ? "disabled" : "active" }),
37
+ /* @__PURE__ */ r(
40
38
  "input",
41
39
  {
42
40
  type: "text",
43
- className: s(`focus:outline-none w-full ${b[1]}`),
41
+ className: s(`focus:outline-none w-full ${v[1]}`),
44
42
  placeholder: i,
45
- onFocus: m,
46
- onBlur: u,
47
- onChange: (f) => e == null ? void 0 : e(f.target.value),
43
+ onFocus: p,
44
+ onBlur: d,
45
+ onChange: (n) => e == null ? void 0 : e(n.target.value),
48
46
  value: a,
49
- disabled: o
47
+ disabled: o,
48
+ autoComplete: u ? "off" : "on"
50
49
  }
51
50
  )
52
51
  ]
@@ -54,5 +53,5 @@ const w = ({
54
53
  );
55
54
  };
56
55
  export {
57
- w as ContextSearch
56
+ $ as ContextSearch
58
57
  };
@@ -19,5 +19,6 @@ export type DropdownFilterProps = {
19
19
  multiselect?: boolean;
20
20
  disabled?: boolean;
21
21
  minWidth?: string | number;
22
+ className?: string;
22
23
  };
23
- export declare const DropdownFilter: ({ onChange, value, placeholder, options, multiselect, disabled, minWidth, }: DropdownFilterProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const DropdownFilter: ({ onChange, value, placeholder, options, multiselect, disabled, minWidth, className, }: DropdownFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,63 +1,64 @@
1
1
  import { jsx as s, jsxs as n } from "react/jsx-runtime";
2
- import { useRef as R, useState as V } from "react";
3
- import { R as P, T as $, I as F, P as K, C as z, V as L, a as M } from "../../../../index-CnWyMXBX.js";
4
- import { c as U } from "../../../../index-fN7hCOo3.js";
5
- import { outlinedBorder as N, border as W } from "../../../styles/defaults/defaults.js";
2
+ import { useRef as V, useState as P } from "react";
3
+ import { R as $, T as F, I as K, P as z, C as L, V as M, a as U } from "../../../../index-CnWyMXBX.js";
4
+ import { c as W } from "../../../../index-fN7hCOo3.js";
5
+ import { outlinedBorder as S, border as Z } from "../../../styles/defaults/defaults.js";
6
6
  import { Typography as g } from "../../../styles/typography/typography.js";
7
- import { filterDropdownStyles as Z, contentStyles as q } from "./styles.js";
8
- import { Badge as S } from "../../../atoms/badge/badge.js";
9
- import { Icons as k } from "../../../atoms/icons/icons.js";
7
+ import { filterDropdownStyles as q, contentStyles as G } from "./styles.js";
8
+ import { Badge as k } from "../../../atoms/badge/badge.js";
9
+ import { Icons as A } from "../../../atoms/icons/icons.js";
10
10
  import "../../../atoms/icons/iconsSVGs/Large/Profile.js";
11
11
  import "../../../atoms/icons/iconsSVGs/Small/Profile.js";
12
- import { CheckboxFilter as G } from "../checkbox/checkbox.js";
13
- import { t as A } from "../../../../bundle-mjs-CAy1p0fn.js";
14
- import { getBorderClasses as H } from "../../../atoms/form/utils-for-forms/state-functions.js";
15
- import { useStickyZIndex as J } from "../../../../hooks/use-sticky-z-index.js";
16
- const fe = ({
17
- onChange: y,
12
+ import { CheckboxFilter as H } from "../checkbox/checkbox.js";
13
+ import { t as y } from "../../../../bundle-mjs-CAy1p0fn.js";
14
+ import { getBorderClasses as J } from "../../../atoms/form/utils-for-forms/state-functions.js";
15
+ import { useStickyZIndex as Q } from "../../../../hooks/use-sticky-z-index.js";
16
+ const me = ({
17
+ onChange: x,
18
18
  value: o,
19
19
  placeholder: C = "Select value",
20
20
  options: f,
21
21
  multiselect: t = !1,
22
22
  disabled: a = !1,
23
- minWidth: D
23
+ minWidth: D,
24
+ className: O
24
25
  }) => {
25
- const x = R(null), O = J(x), [c, i] = V(!1), v = H(c, !1, !1, a), I = a ? `bg-surface-disabled ${N.disabled}` : "bg-surface-default", u = Array.isArray(o) ? o.length - 1 : 0;
26
- function w(e) {
26
+ const u = V(null), v = Q(u), [c, i] = P(!1), I = J(c, !1, !1, a), B = a ? `bg-surface-disabled ${S.disabled}` : "bg-surface-default", w = Array.isArray(o) ? o.length - 1 : 0;
27
+ function b(e) {
27
28
  return Array.isArray(e) && typeof e[0] == "object" && e[0] !== null && "label" in e[0] && "value" in e[0];
28
29
  }
29
- const b = (e, r) => {
30
+ const N = (e, r) => {
30
31
  if (Array.isArray(r)) {
31
32
  if (!r.length) return "";
32
- if (w(e)) {
33
+ if (b(e)) {
33
34
  const l = e.find((p) => p.value === r[0]);
34
35
  return l ? l.label : "";
35
36
  }
36
37
  return r[0];
37
38
  } else {
38
- if (w(e)) {
39
+ if (b(e)) {
39
40
  const l = e.find((p) => p.value === r);
40
41
  return l ? l.label : "";
41
42
  }
42
43
  return r;
43
44
  }
44
- }, d = (e) => typeof e == "string" ? e : e.value, B = (e) => typeof e == "string" ? e : e.label, m = (e) => {
45
+ }, d = (e) => typeof e == "string" ? e : e.value, T = (e) => typeof e == "string" ? e : e.label, m = (e) => {
45
46
  if (t) {
46
47
  let r = [];
47
- Array.isArray(o) && o.includes(e) ? r = [...o.filter((l) => l !== e)] : r = [...o, e], y(r);
48
+ Array.isArray(o) && o.includes(e) ? r = [...o.filter((l) => l !== e)] : r = [...o, e], x(r);
48
49
  } else
49
- y(e);
50
- }, h = f.filter((e) => !e.hide), T = (e, r) => {
50
+ x(e);
51
+ }, h = f.filter((e) => !e.hide), j = (e, r) => {
51
52
  e.key === "Enter" && m(r);
52
- }, j = (e) => {
53
+ }, E = (e) => {
53
54
  e.key === "Escape" && i(!1);
54
- }, E = () => {
55
+ }, R = () => {
55
56
  i(!1);
56
57
  };
57
- return /* @__PURE__ */ s("div", { className: "w-full", children: /* @__PURE__ */ n(
58
- P,
58
+ return /* @__PURE__ */ s("div", { className: y("w-full", O), children: /* @__PURE__ */ n(
59
+ $,
59
60
  {
60
- value: b(f, o),
61
+ value: N(f, o),
61
62
  onValueChange: (e) => !t && m(e),
62
63
  open: c,
63
64
  onOpenChange: (e) => {
@@ -66,10 +67,10 @@ const fe = ({
66
67
  disabled: a,
67
68
  children: [
68
69
  /* @__PURE__ */ n(
69
- $,
70
+ F,
70
71
  {
71
- className: A(Z, I, v),
72
- ref: x,
72
+ className: y(q, B, I),
73
+ ref: u,
73
74
  style: { height: "3rem", padding: "0.75rem", minWidth: D },
74
75
  children: [
75
76
  o && o.length !== 0 ? /* @__PURE__ */ n("div", { className: "min-w-0 flex gap-xxs items-center", children: [
@@ -77,12 +78,12 @@ const fe = ({
77
78
  g,
78
79
  {
79
80
  swStyle: 1,
80
- children: b(f, o),
81
+ children: N(f, o),
81
82
  className: "whitespace-nowrap overflow-hidden text-ellipsis",
82
83
  color: a ? "disabled" : "default"
83
84
  }
84
85
  ),
85
- t && u > 0 && /* @__PURE__ */ s(S, { text: "+" + u, color: "affirmative" })
86
+ t && w > 0 && /* @__PURE__ */ s(k, { text: "+" + w, color: "affirmative" })
86
87
  ] }) : /* @__PURE__ */ s(
87
88
  g,
88
89
  {
@@ -92,8 +93,8 @@ const fe = ({
92
93
  className: "whitespace-nowrap overflow-hidden text-ellipsis"
93
94
  }
94
95
  ),
95
- /* @__PURE__ */ s(F, { className: "flex-shrink-0", children: /* @__PURE__ */ s(
96
- k,
96
+ /* @__PURE__ */ s(K, { className: "flex-shrink-0", children: /* @__PURE__ */ s(
97
+ A,
97
98
  {
98
99
  id: "dropdown-icon",
99
100
  disabled: !0,
@@ -104,44 +105,44 @@ const fe = ({
104
105
  ]
105
106
  }
106
107
  ),
107
- /* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(
108
- z,
108
+ /* @__PURE__ */ s(z, { children: /* @__PURE__ */ s(
109
+ L,
109
110
  {
110
- className: U(
111
- q,
111
+ className: W(
112
+ G,
112
113
  "max-h-[27.3rem]",
113
114
  // to fit 9 items in timesheet filter (with border width)
114
- c ? N.active : W.default
115
+ c ? S.active : Z.default
115
116
  ),
116
117
  position: "popper",
117
118
  side: "bottom",
118
- onPointerDownOutside: E,
119
- onKeyDown: j,
120
- style: { minWidth: "auto", zIndex: O },
121
- children: /* @__PURE__ */ s(L, { children: h == null ? void 0 : h.map((e, r) => /* @__PURE__ */ s(
122
- M,
119
+ onPointerDownOutside: R,
120
+ onKeyDown: E,
121
+ style: { minWidth: "auto", zIndex: v },
122
+ children: /* @__PURE__ */ s(M, { children: h == null ? void 0 : h.map((e, r) => /* @__PURE__ */ s(
123
+ U,
123
124
  {
124
- className: A(
125
+ className: y(
125
126
  "flex flex-row items-center gap-xs py-sm cursor-pointer hover:bg-surface-active hover:outline-none focus:bg-surface-active focus:outline-none",
126
127
  e.hasTopBorder && "border-t border-e-bcolor-subdued",
127
128
  t ? "pr-xs" : "px-md"
128
129
  ),
129
130
  value: d(e),
130
131
  onClick: () => t && m(d(e)),
131
- onKeyDown: (l) => T(l, d(e)),
132
+ onKeyDown: (l) => j(l, d(e)),
132
133
  style: { height: "3rem" },
133
134
  children: /* @__PURE__ */ n("div", { className: "flex items-center", style: { height: "100%" }, children: [
134
135
  t && /* @__PURE__ */ s(
135
- G,
136
+ H,
136
137
  {
137
138
  "data-testid": `checkbox-${r}`,
138
139
  checked: o ? o.includes(d(e)) : !1
139
140
  }
140
141
  ),
141
142
  /* @__PURE__ */ n("div", { className: "flex items-center gap-xxs", children: [
142
- e.icon && /* @__PURE__ */ s(k, { ...e.icon, color: e.color ? e.color : "default" }),
143
+ e.icon && /* @__PURE__ */ s(A, { ...e.icon, color: e.color ? e.color : "default" }),
143
144
  !e.icon && e.badgeText && /* @__PURE__ */ s(
144
- S,
145
+ k,
145
146
  {
146
147
  text: e.badgeText,
147
148
  color: e.color ? e.color : "default"
@@ -151,7 +152,7 @@ const fe = ({
151
152
  g,
152
153
  {
153
154
  swStyle: 1,
154
- children: B(e),
155
+ children: T(e),
155
156
  color: e.color ? e.color : "default",
156
157
  className: "whitespace-nowrap overflow-hidden text-ellipsis"
157
158
  }
@@ -168,5 +169,5 @@ const fe = ({
168
169
  ) });
169
170
  };
170
171
  export {
171
- fe as DropdownFilter
172
+ me as DropdownFilter
172
173
  };
@@ -2,21 +2,21 @@ import { c as e } from "../../../../index-fN7hCOo3.js";
2
2
  const r = e(
3
3
  "px-md h-[4rem] w-full flex flex-row justify-between items-center gap-md"
4
4
  ), s = e(
5
- "px-md h-[4rem] w-auto flex flex-row justify-between items-center gap-xs"
6
- ), n = e(
5
+ "px-md h-[4rem] w-full flex flex-row justify-between items-center gap-xs"
6
+ ), l = e(
7
7
  "overflow-hidden bg-surface-default rounded-lg my-[0.3rem] border-[0.15rem] outline-none"
8
- ), o = "flex flex-row items-center gap-xs py-sm px-md cursor-pointer hover:bg-surface-active hover:outline-none focus:bg-surface-active focus:outline-none ", l = "flex items-center justify-center h-[1.5rem] bg-surface-default text-glyph-active cursor-default", c = "flex items-center gap-xs self-stretch", a = {
8
+ ), n = "flex flex-row items-center gap-xs py-sm px-md cursor-pointer hover:bg-surface-active hover:outline-none focus:bg-surface-active focus:outline-none ", o = "flex items-center justify-center h-[1.5rem] bg-surface-default text-glyph-active cursor-default", c = "flex items-center gap-xs self-stretch", f = {
9
9
  default: "affirmative",
10
10
  warning: "warning",
11
11
  error: "alert",
12
12
  disabled: "disabled"
13
13
  };
14
14
  export {
15
- a as badgeStyleMap,
16
- n as contentStyles,
15
+ f as badgeStyleMap,
16
+ l as contentStyles,
17
17
  s as filterDropdownStyles,
18
18
  c as hintStyles,
19
- o as itemStyles,
20
- l as scrollButtonStyles,
19
+ n as itemStyles,
20
+ o as scrollButtonStyles,
21
21
  r as triggerStyles
22
22
  };
@@ -4,4 +4,11 @@ import { Sidebar } from './';
4
4
  declare const meta: Meta<typeof Sidebar>;
5
5
  export default meta;
6
6
  type Story = StoryObj<typeof meta>;
7
- export declare const Primary: Story;
7
+ export declare const Basic: Story;
8
+ export declare const WithTopAndBottomItems: Story;
9
+ export declare const TopItemsOnly: Story;
10
+ export declare const ManyItems: Story;
11
+ export declare const TransparentOverlay: Story;
12
+ export declare const CustomWidth: Story;
13
+ export declare const SlowTransition: Story;
14
+ export declare const FastTransition: Story;
@@ -1,20 +1,306 @@
1
- import { f as o } from "../../../../index-DfdAzObv.js";
2
- import { Sidebar as r } from "./sidebar.js";
3
- const e = {
4
- title: "@spotwork-ui/Sidebar",
5
- component: r,
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
+ import { useState as r } from "react";
3
+ import { Sidebar as s } from "./sidebar.js";
4
+ import { Button as d } from "../../button/button.js";
5
+ const f = {
6
+ title: "@spotwork-ui/molecules/Sidebar",
7
+ component: s,
6
8
  parameters: {
7
- layout: "centered"
9
+ layout: "fullscreen"
8
10
  },
9
11
  tags: ["autodocs"],
10
12
  argTypes: {
11
- backgroundColor: { control: "color" }
12
- },
13
- args: { onClick: o() }
14
- }, s = {
15
- args: {}
13
+ open: {
14
+ control: "boolean",
15
+ description: "Controls if the sidebar is open or closed"
16
+ },
17
+ width: {
18
+ control: "text",
19
+ description: "Width of the sidebar (can be px, %, rem, etc.)"
20
+ },
21
+ transitionDuration: {
22
+ control: { type: "number", min: 100, max: 2e3, step: 100 },
23
+ description: "Duration of the transition animation in milliseconds"
24
+ },
25
+ overlayTransparent: {
26
+ control: "boolean",
27
+ description: "If true, no overlay is rendered. If false, renders the overlay with background."
28
+ }
29
+ }
30
+ }, m = ({ args: o }) => {
31
+ const [t, i] = r(!1);
32
+ return /* @__PURE__ */ c("div", { className: "p-4", children: [
33
+ /* @__PURE__ */ n(d, { text: "Open Sidebar", onClick: () => i(!0) }),
34
+ /* @__PURE__ */ n(s, { ...o, topItems: [
35
+ {
36
+ icon: "Clock",
37
+ label: "Clock",
38
+ onClick: (l) => {
39
+ console.log("Clicked:", l);
40
+ },
41
+ link: "/clock"
42
+ },
43
+ {
44
+ icon: "Maximize",
45
+ label: "Maximize",
46
+ isActive: !0,
47
+ onClick: (l) => {
48
+ console.log("Clicked:", l);
49
+ },
50
+ link: "/maximize"
51
+ },
52
+ {
53
+ icon: "CalendarSmall",
54
+ label: "Calendar",
55
+ onClick: (l) => {
56
+ console.log("Clicked:", l);
57
+ },
58
+ link: "/calendar"
59
+ }
60
+ ], open: t, setOpen: i })
61
+ ] });
62
+ }, a = ({ args: o }) => {
63
+ const [t, i] = r(!1);
64
+ return /* @__PURE__ */ c("div", { className: "p-4", children: [
65
+ /* @__PURE__ */ n(d, { text: "Open Sidebar with Top & Bottom Items", onClick: () => i(!0) }),
66
+ /* @__PURE__ */ n(s, { ...o, topItems: [
67
+ {
68
+ icon: "Clock",
69
+ label: "Clock",
70
+ onClick: (e) => {
71
+ console.log("Clicked:", e);
72
+ },
73
+ link: "/clock"
74
+ },
75
+ {
76
+ icon: "Maximize",
77
+ label: "Maximize",
78
+ isActive: !0,
79
+ onClick: (e) => {
80
+ console.log("Clicked:", e);
81
+ },
82
+ link: "/maximize"
83
+ },
84
+ {
85
+ icon: "CalendarSmall",
86
+ label: "Calendar",
87
+ onClick: (e) => {
88
+ console.log("Clicked:", e);
89
+ },
90
+ link: "/calendar"
91
+ },
92
+ {
93
+ icon: "Shifts",
94
+ label: "Shifts",
95
+ onClick: (e) => {
96
+ console.log("Clicked:", e);
97
+ },
98
+ link: "/shifts"
99
+ }
100
+ ], bottomItems: [
101
+ {
102
+ icon: "Settings",
103
+ label: "Settings",
104
+ onClick: (e) => {
105
+ console.log("Clicked:", e);
106
+ },
107
+ link: "/settings"
108
+ },
109
+ {
110
+ icon: "Support",
111
+ label: "Help & Support",
112
+ onClick: (e) => {
113
+ console.log("Clicked:", e);
114
+ },
115
+ link: "/help"
116
+ }
117
+ ], open: t, setOpen: i })
118
+ ] });
119
+ }, p = ({ args: o }) => {
120
+ const [t, i] = r(!1);
121
+ return /* @__PURE__ */ c("div", { className: "p-4", children: [
122
+ /* @__PURE__ */ n(d, { text: "Open Sidebar (Top Items Only)", onClick: () => i(!0) }),
123
+ /* @__PURE__ */ n(s, { ...o, topItems: [
124
+ {
125
+ icon: "Clock",
126
+ label: "Clock",
127
+ onClick: (l) => {
128
+ console.log("Clicked:", l);
129
+ },
130
+ link: "/clock"
131
+ },
132
+ {
133
+ icon: "Maximize",
134
+ label: "Maximize",
135
+ onClick: (l) => {
136
+ console.log("Clicked:", l);
137
+ },
138
+ link: "/maximize"
139
+ },
140
+ {
141
+ icon: "CalendarSmall",
142
+ label: "Calendar",
143
+ onClick: (l) => {
144
+ console.log("Clicked:", l);
145
+ },
146
+ link: "/calendar"
147
+ }
148
+ ], open: t, setOpen: i })
149
+ ] });
150
+ }, C = ({ args: o }) => {
151
+ const [t, i] = r(!1);
152
+ return /* @__PURE__ */ c("div", { className: "p-4", children: [
153
+ /* @__PURE__ */ n(d, { text: "Open Sidebar with Many Items", onClick: () => i(!0) }),
154
+ /* @__PURE__ */ n(s, { ...o, topItems: [
155
+ {
156
+ icon: "Clock",
157
+ label: "Clock",
158
+ onClick: (e) => {
159
+ console.log("Clicked:", e);
160
+ },
161
+ link: "/clock"
162
+ },
163
+ {
164
+ icon: "Maximize",
165
+ label: "Maximize",
166
+ isActive: !0,
167
+ onClick: (e) => {
168
+ console.log("Clicked:", e);
169
+ },
170
+ link: "/maximize"
171
+ },
172
+ {
173
+ icon: "CalendarSmall",
174
+ label: "Calendar",
175
+ onClick: (e) => {
176
+ console.log("Clicked:", e);
177
+ },
178
+ link: "/calendar"
179
+ },
180
+ {
181
+ icon: "Shifts",
182
+ label: "Shifts",
183
+ onClick: (e) => {
184
+ console.log("Clicked:", e);
185
+ },
186
+ link: "/shifts"
187
+ },
188
+ {
189
+ icon: "Jobs",
190
+ label: "Jobs",
191
+ onClick: (e) => {
192
+ console.log("Clicked:", e);
193
+ },
194
+ link: "/jobs"
195
+ },
196
+ {
197
+ icon: "Contact",
198
+ label: "Contacts",
199
+ onClick: (e) => {
200
+ console.log("Clicked:", e);
201
+ },
202
+ link: "/contacts"
203
+ },
204
+ {
205
+ icon: "File",
206
+ label: "Files",
207
+ onClick: (e) => {
208
+ console.log("Clicked:", e);
209
+ },
210
+ link: "/files"
211
+ }
212
+ ], bottomItems: [
213
+ {
214
+ icon: "Settings",
215
+ label: "Settings",
216
+ onClick: (e) => {
217
+ console.log("Clicked:", e);
218
+ },
219
+ link: "/settings"
220
+ },
221
+ {
222
+ icon: "Support",
223
+ label: "Help & Support",
224
+ onClick: (e) => {
225
+ console.log("Clicked:", e);
226
+ },
227
+ link: "/help"
228
+ },
229
+ {
230
+ icon: "Feedback",
231
+ label: "Feedback",
232
+ onClick: (e) => {
233
+ console.log("Clicked:", e);
234
+ },
235
+ link: "/feedback"
236
+ }
237
+ ], open: t, setOpen: i })
238
+ ] });
239
+ }, S = {
240
+ render: (o) => /* @__PURE__ */ n(m, { args: o }),
241
+ args: {
242
+ width: "22.5rem",
243
+ transitionDuration: 300,
244
+ overlayTransparent: !1
245
+ }
246
+ }, I = {
247
+ render: (o) => /* @__PURE__ */ n(a, { args: o }),
248
+ args: {
249
+ width: "22.5rem",
250
+ transitionDuration: 300,
251
+ overlayTransparent: !1
252
+ }
253
+ }, x = {
254
+ render: (o) => /* @__PURE__ */ n(p, { args: o }),
255
+ args: {
256
+ width: "22.5rem",
257
+ transitionDuration: 300,
258
+ overlayTransparent: !1
259
+ }
260
+ }, y = {
261
+ render: (o) => /* @__PURE__ */ n(C, { args: o }),
262
+ args: {
263
+ width: "22.5rem",
264
+ transitionDuration: 300,
265
+ overlayTransparent: !1
266
+ }
267
+ }, O = {
268
+ render: (o) => /* @__PURE__ */ n(a, { args: o }),
269
+ args: {
270
+ width: "22.5rem",
271
+ transitionDuration: 300,
272
+ overlayTransparent: !0
273
+ }
274
+ }, T = {
275
+ render: (o) => /* @__PURE__ */ n(a, { args: o }),
276
+ args: {
277
+ width: "30rem",
278
+ transitionDuration: 300,
279
+ overlayTransparent: !1
280
+ }
281
+ }, v = {
282
+ render: (o) => /* @__PURE__ */ n(a, { args: o }),
283
+ args: {
284
+ width: "22.5rem",
285
+ transitionDuration: 1e3,
286
+ overlayTransparent: !1
287
+ }
288
+ }, w = {
289
+ render: (o) => /* @__PURE__ */ n(a, { args: o }),
290
+ args: {
291
+ width: "22.5rem",
292
+ transitionDuration: 150,
293
+ overlayTransparent: !1
294
+ }
16
295
  };
17
296
  export {
18
- s as Primary,
19
- e as default
297
+ S as Basic,
298
+ T as CustomWidth,
299
+ w as FastTransition,
300
+ y as ManyItems,
301
+ v as SlowTransition,
302
+ x as TopItemsOnly,
303
+ O as TransparentOverlay,
304
+ I as WithTopAndBottomItems,
305
+ f as default
20
306
  };
@@ -14,9 +14,13 @@ export type SidebarProps = {
14
14
  */
15
15
  setOpen?: (state: boolean) => void;
16
16
  /**
17
- * Navigation items
17
+ * Navigation items displayed at the top of the sidebar
18
18
  */
19
- items: SidebarItemProps[];
19
+ topItems: SidebarItemProps[];
20
+ /**
21
+ * Navigation items displayed at the bottom of the sidebar
22
+ */
23
+ bottomItems?: SidebarItemProps[];
20
24
  /**
21
25
  * Sidebar width in rem
22
26
  */
@@ -30,4 +34,4 @@ export type SidebarProps = {
30
34
  */
31
35
  overlayTransparent?: boolean;
32
36
  };
33
- export declare function Sidebar({ open, setOpen, items, transitionDuration, width, overlayTransparent, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function Sidebar({ open, setOpen, topItems, bottomItems, transitionDuration, width, overlayTransparent, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,47 +1,51 @@
1
- import { jsx as e, jsxs as t, Fragment as u } from "react/jsx-runtime";
2
- import { NavigationItem as p } from "../../../atoms/navigation/navigation-item/navigation-item.js";
3
- import { u as h, a as n } from "../../../../react-spring_web.modern-BLL8Qmtg.js";
4
- import { R as b, P as v, O as g, C as y, T as N, D as x } from "../../../../index-C0ZrzaoZ.js";
1
+ import { jsx as e, jsxs as o, Fragment as h } from "react/jsx-runtime";
2
+ import { NavigationItem as t } from "../../../atoms/navigation/navigation-item/navigation-item.js";
3
+ import { u as g, a as s } from "../../../../react-spring_web.modern-BLL8Qmtg.js";
4
+ import { R as v, P as x, O as b, C as N, T as y, D as k } from "../../../../index-C0ZrzaoZ.js";
5
5
  import "../../../styles/colors/colors.js";
6
- import { surface as k } from "../../../styles/colors/colormap.js";
7
- function w({
8
- open: o,
9
- setOpen: s,
10
- items: l,
11
- transitionDuration: c = 300,
12
- width: d = "22.5rem",
13
- overlayTransparent: a = !1
6
+ import { surface as C } from "../../../styles/colors/colormap.js";
7
+ function z({
8
+ open: a,
9
+ setOpen: c,
10
+ topItems: d,
11
+ bottomItems: l = [],
12
+ transitionDuration: m = 300,
13
+ width: f = "22.5rem",
14
+ overlayTransparent: i = !1
14
15
  }) {
15
- const m = h(o, {
16
+ const u = g(a, {
16
17
  from: { opacity: 0, transform: "translateX(-100%)" },
17
18
  enter: { opacity: 1, transform: "translateX(0%)" },
18
19
  leave: { opacity: 1 },
19
20
  config: {
20
- duration: c
21
+ duration: m
21
22
  }
22
23
  });
23
- return /* @__PURE__ */ e(b, { open: o, onOpenChange: s, modal: !a, children: /* @__PURE__ */ e(v, { children: m(
24
- (i, f) => f ? /* @__PURE__ */ t(u, { children: [
25
- !a && /* @__PURE__ */ e(n.div, { style: { opacity: i.opacity }, children: /* @__PURE__ */ e(
26
- g,
24
+ return /* @__PURE__ */ e(v, { open: a, onOpenChange: c, modal: !i, children: /* @__PURE__ */ e(x, { children: u(
25
+ (n, p) => p ? /* @__PURE__ */ o(h, { children: [
26
+ !i && /* @__PURE__ */ e(s.div, { style: { opacity: n.opacity }, children: /* @__PURE__ */ e(
27
+ b,
27
28
  {
28
29
  forceMount: !0,
29
30
  className: "DialogOverlay fixed inset-0 top-[6rem] z-50",
30
31
  style: {
31
- background: k.subduedInverted,
32
+ background: C.subduedInverted,
32
33
  opacity: "50%"
33
34
  }
34
35
  }
35
36
  ) }),
36
- /* @__PURE__ */ t(y, { forceMount: !0, "data-state": o ? "open" : "close", children: [
37
- /* @__PURE__ */ e(N, { className: "sr-only", children: "Navigation Sidebar" }),
38
- /* @__PURE__ */ e(x, { className: "sr-only", children: "Navigation menu with links to different sections" }),
39
- /* @__PURE__ */ e(
40
- n.div,
37
+ /* @__PURE__ */ o(N, { forceMount: !0, "data-state": a ? "open" : "close", children: [
38
+ /* @__PURE__ */ e(y, { className: "sr-only", children: "Navigation Sidebar" }),
39
+ /* @__PURE__ */ e(k, { className: "sr-only", children: "Navigation menu with links to different sections" }),
40
+ /* @__PURE__ */ o(
41
+ s.div,
41
42
  {
42
- style: { transform: i.transform, width: d },
43
- className: `fixed top-[6rem] left-0 h-screen z-50 bg-surface-default focus:outline-none ${a ? "border-[0.1rem] border-bcolor-divider" : "shadow-[0rem_1rem_1rem_0rem_#B0B0B0] border-t-[0.1rem] border-bcolor-divider"}`,
44
- children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-xs p-md", children: l.map((r) => /* @__PURE__ */ e("div", { onClick: () => r.onClick(r.link), children: /* @__PURE__ */ e(p, { ...r, isNavigation: !0 }) }, r.label)) })
43
+ style: { transform: n.transform, width: f },
44
+ className: `fixed top-[6rem] left-0 h-screen z-50 bg-surface-default focus:outline-none flex flex-col ${i ? "border-[0.1rem] border-bcolor-divider" : "shadow-[0rem_1rem_1rem_0rem_#B0B0B0] border-t-[0.1rem] border-bcolor-divider"}`,
45
+ children: [
46
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-xs p-md flex-1", children: d.map((r) => /* @__PURE__ */ e("div", { onClick: () => r.onClick(r.link), children: /* @__PURE__ */ e(t, { ...r, isNavigation: !0 }) }, r.label)) }),
47
+ l.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-lg p-md", children: l.map((r) => /* @__PURE__ */ e("div", { onClick: () => r.onClick(r.link), children: /* @__PURE__ */ e(t, { ...r, isNavigation: !0 }) }, r.label)) })
48
+ ]
45
49
  }
46
50
  )
47
51
  ] })
@@ -49,5 +53,5 @@ function w({
49
53
  ) }) });
50
54
  }
51
55
  export {
52
- w as Sidebar
56
+ z as Sidebar
53
57
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@temp-spotwork/ui",
3
3
  "private": false,
4
- "version": "1.4.3",
4
+ "version": "1.4.5",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",