@blakesteve/roster 5.0.1 → 5.1.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.
Files changed (53) hide show
  1. package/README.md +54 -7
  2. package/dist/components/atoms/Chip/Chip.cjs +1 -1
  3. package/dist/components/atoms/Chip/Chip.js +27 -27
  4. package/dist/components/atoms/Disclosure/Disclosure.cjs +1 -1
  5. package/dist/components/atoms/Disclosure/Disclosure.js +42 -44
  6. package/dist/components/atoms/Stat/Stat.cjs +1 -1
  7. package/dist/components/atoms/Stat/Stat.d.ts +27 -2
  8. package/dist/components/atoms/Stat/Stat.js +38 -13
  9. package/dist/components/atoms/Switch/Switch.cjs +1 -1
  10. package/dist/components/atoms/Switch/Switch.d.ts +11 -1
  11. package/dist/components/atoms/Switch/Switch.js +38 -36
  12. package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
  13. package/dist/components/atoms/Switch/switch-variants.js +1 -1
  14. package/dist/components/molecules/LiquidTabs/LiquidNav.cjs +1 -0
  15. package/dist/components/molecules/LiquidTabs/LiquidNav.d.ts +62 -0
  16. package/dist/components/molecules/LiquidTabs/LiquidNav.js +78 -0
  17. package/dist/components/molecules/LiquidTabs/LiquidTabs.cjs +1 -0
  18. package/dist/components/molecules/LiquidTabs/LiquidTabs.d.ts +69 -0
  19. package/dist/components/molecules/LiquidTabs/LiquidTabs.js +92 -0
  20. package/dist/components/molecules/LiquidTabs/liquid-pill.cjs +1 -0
  21. package/dist/components/molecules/LiquidTabs/liquid-pill.d.ts +56 -0
  22. package/dist/components/molecules/LiquidTabs/liquid-pill.js +129 -0
  23. package/dist/components/molecules/LiquidTabs/liquid-tab-id.cjs +1 -0
  24. package/dist/components/molecules/LiquidTabs/liquid-tab-id.d.ts +12 -0
  25. package/dist/components/molecules/LiquidTabs/liquid-tab-id.js +6 -0
  26. package/dist/components/molecules/Toast/Toaster.cjs +1 -1
  27. package/dist/components/molecules/Toast/Toaster.d.ts +7 -0
  28. package/dist/components/molecules/Toast/Toaster.js +67 -45
  29. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  30. package/dist/components/organisms/Dialog/Dialog.js +102 -79
  31. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  32. package/dist/components/organisms/Navbar/Navbar.js +157 -157
  33. package/dist/components/organisms/Sheet/Sheet.cjs +1 -0
  34. package/dist/components/organisms/Sheet/Sheet.d.ts +82 -0
  35. package/dist/components/organisms/Sheet/Sheet.js +303 -0
  36. package/dist/components/organisms/Sheet/sheet-drag.cjs +1 -0
  37. package/dist/components/organisms/Sheet/sheet-drag.d.ts +40 -0
  38. package/dist/components/organisms/Sheet/sheet-drag.js +22 -0
  39. package/dist/index.d.ts +4 -1
  40. package/dist/internal/motion.cjs +1 -0
  41. package/dist/internal/motion.d.ts +12 -0
  42. package/dist/internal/motion.js +21 -0
  43. package/dist/internal/page-inert.cjs +1 -0
  44. package/dist/internal/page-inert.d.ts +51 -0
  45. package/dist/internal/page-inert.js +36 -0
  46. package/dist/meta.json +3 -3
  47. package/dist/roster.cjs +1 -1
  48. package/dist/roster.css +1 -1
  49. package/dist/roster.js +128 -122
  50. package/package.json +1 -1
  51. package/dist/components/atoms/LiquidTabs/LiquidTabs.cjs +0 -1
  52. package/dist/components/atoms/LiquidTabs/LiquidTabs.d.ts +0 -39
  53. package/dist/components/atoms/LiquidTabs/LiquidTabs.js +0 -120
package/dist/roster.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Avatar as e } from "./components/atoms/Avatar/Avatar.js";
3
3
  import { avatarVariants as p } from "./components/atoms/Avatar/avatar-variants.js";
4
4
  import { Badge as m } from "./components/atoms/Badge/Badge.js";
5
- import { badgeVariants as n } from "./components/atoms/Badge/badge-variants.js";
5
+ import { badgeVariants as f } from "./components/atoms/Badge/badge-variants.js";
6
6
  import { Button as s } from "./components/atoms/Button/Button.js";
7
7
  import { buttonVariants as V } from "./components/atoms/Button/button-variants.js";
8
8
  import { Card as b } from "./components/atoms/Card/Card.js";
@@ -10,14 +10,14 @@ import { cardVariants as u } from "./components/atoms/Card/card-variants.js";
10
10
  import { Checkbox as C } from "./components/atoms/Checkbox/Checkbox.js";
11
11
  import { checkboxVariants as S } from "./components/atoms/Checkbox/checkbox-variants.js";
12
12
  import { Disclosure as w } from "./components/atoms/Disclosure/Disclosure.js";
13
- import { disclosureContentVariants as A, disclosureTriggerVariants as B } from "./components/atoms/Disclosure/disclosure-variants.js";
14
- import { Input as O } from "./components/atoms/Input/Input.js";
15
- import { iconVariants as y, inputVariants as E } from "./components/atoms/Input/input-variants.js";
13
+ import { disclosureContentVariants as v, disclosureTriggerVariants as A } from "./components/atoms/Disclosure/disclosure-variants.js";
14
+ import { Input as D } from "./components/atoms/Input/Input.js";
15
+ import { iconVariants as q, inputVariants as y } from "./components/atoms/Input/input-variants.js";
16
16
  import { Link as I } from "./components/atoms/Link/Link.js";
17
- import { linkVariants as P } from "./components/atoms/Link/link-variants.js";
17
+ import { linkVariants as G } from "./components/atoms/Link/link-variants.js";
18
18
  import { PasswordInput as H } from "./components/atoms/PasswordInput/PasswordInput.js";
19
- import { Combobox as F } from "./components/atoms/Combobox/Combobox.js";
20
- import { Chip as N } from "./components/atoms/Chip/Chip.js";
19
+ import { Combobox as R } from "./components/atoms/Combobox/Combobox.js";
20
+ import { Chip as M } from "./components/atoms/Chip/Chip.js";
21
21
  import { chipVariants as _ } from "./components/atoms/Chip/chip-variants.js";
22
22
  import { Pill as X } from "./components/atoms/Pill/Pill.js";
23
23
  import { pillDotVariants as z, pillVariants as J } from "./components/atoms/Pill/pill-variants.js";
@@ -28,157 +28,163 @@ import { inlineCodeVariants as tr } from "./components/atoms/InlineCode/inline-c
28
28
  import { LabeledDivider as ar } from "./components/atoms/LabeledDivider/LabeledDivider.js";
29
29
  import { Stat as ir } from "./components/atoms/Stat/Stat.js";
30
30
  import { statValueVariants as xr } from "./components/atoms/Stat/stat-variants.js";
31
- import { ThemeToggle as fr } from "./components/atoms/ThemeToggle/ThemeToggle.js";
31
+ import { ThemeToggle as nr } from "./components/atoms/ThemeToggle/ThemeToggle.js";
32
32
  import { MultiSelect as lr } from "./components/atoms/MultiSelect/MultiSelect.js";
33
33
  import { Select as cr } from "./components/atoms/Select/Select.js";
34
34
  import { selectOptionVariants as dr, selectTriggerVariants as ur } from "./components/atoms/Select/select-variants.js";
35
35
  import { Spinner as Cr } from "./components/atoms/Spinner/Spinner.js";
36
36
  import { Switch as Sr } from "./components/atoms/Switch/Switch.js";
37
37
  import { switchThumbVariants as wr, switchTrackVariants as kr } from "./components/atoms/Switch/switch-variants.js";
38
- import { Textarea as Br } from "./components/atoms/Textarea/Textarea.js";
39
- import { textareaVariants as Or } from "./components/atoms/Textarea/textarea-variants.js";
40
- import { AvatarStrip as yr } from "./components/atoms/AvatarStrip/AvatarStrip.js";
41
- import { LiquidTabs as Gr } from "./components/atoms/LiquidTabs/LiquidTabs.js";
42
- import { Tooltip as Lr } from "./components/atoms/Tooltip/Tooltip.js";
43
- import { CollapsibleSection as qr } from "./components/atoms/CollapsibleSection/CollapsibleSection.js";
44
- import { SegmentBar as Rr } from "./components/atoms/SegmentBar/SegmentBar.js";
45
- import { Toast as Mr } from "./components/molecules/Toast/Toast.js";
46
- import { toastVariants as Kr } from "./components/molecules/Toast/toast-variants.js";
47
- import { Toaster as Wr } from "./components/molecules/Toast/Toaster.js";
48
- import { TONE_PREFIX as jr, toast as zr } from "./components/molecules/Toast/toast-api.js";
49
- import { Alert as Qr } from "./components/molecules/Alert/Alert.js";
50
- import { alertVariants as Yr } from "./components/molecules/Alert/alert-variants.js";
51
- import { Accordion as $r } from "./components/molecules/Accordion/Accordion.js";
52
- import { DescriptionList as oo } from "./components/molecules/DescriptionList/DescriptionList.js";
53
- import { descriptionListVariants as eo } from "./components/molecules/DescriptionList/description-list-variants.js";
54
- import { Pullquote as po } from "./components/molecules/Pullquote/Pullquote.js";
55
- import { pullquoteVariants as mo } from "./components/molecules/Pullquote/pullquote-variants.js";
56
- import { CheckboxGroup as no } from "./components/molecules/CheckboxGroup/CheckboxGroup.js";
57
- import { checkboxGroupOptionsVariants as so, checkboxGroupPanelVariants as lo } from "./components/molecules/CheckboxGroup/checkbox-group-variants.js";
58
- import { RadioGroup as co } from "./components/molecules/RadioGroup/RadioGroup.js";
59
- import { radioDotVariants as uo, radioGroupOptionsVariants as To, radioOptionVariants as Co, radioVariants as ho } from "./components/molecules/RadioGroup/radio-group-variants.js";
60
- import { Breadcrumbs as go } from "./components/molecules/Breadcrumbs/Breadcrumbs.js";
61
- import { breadcrumbVariants as ko } from "./components/molecules/Breadcrumbs/breadcrumb-variants.js";
62
- import { CallToAction as Bo } from "./components/molecules/CallToAction/CallToAction.js";
63
- import { ctaVariants as Oo } from "./components/molecules/CallToAction/call-to-action-variants.js";
64
- import { EmptyState as yo } from "./components/molecules/EmptyState/EmptyState.js";
65
- import { emptyStateVariants as Go } from "./components/molecules/EmptyState/empty-state-variants.js";
66
- import { ErrorState as Lo } from "./components/molecules/ErrorState/ErrorState.js";
67
- import { errorStateVariants as qo } from "./components/molecules/ErrorState/error-state-variants.js";
68
- import { MatchupCard as Ro } from "./components/molecules/MatchupCard/MatchupCard.js";
69
- import { ActionBar as Mo } from "./components/organisms/ActionBar/ActionBar.js";
70
- import { actionBarVariants as Ko } from "./components/organisms/ActionBar/action-bar-variants.js";
71
- import { Countdown as Wo } from "./components/organisms/Countdown/Countdown.js";
72
- import { Dialog as jo } from "./components/organisms/Dialog/Dialog.js";
73
- import { Footer as Jo } from "./components/organisms/Footer/Footer.js";
74
- import { Navbar as Uo } from "./components/organisms/Navbar/Navbar.js";
75
- import { navbarVariants as Zo } from "./components/organisms/Navbar/navbar-variants.js";
76
- import { Table as rt, TableBody as ot, TableCaption as tt, TableCell as et, TableFooter as at, TableHead as pt, TableHeader as it, TableRow as mt } from "./components/organisms/Table/Table.js";
77
- import { tableCellVariants as nt, tableHeadVariants as ft, tableHeaderVariants as st, tableRowVariants as lt, tableVariants as Vt, tableWrapperVariants as ct } from "./components/organisms/Table/table-variants.js";
78
- import { useCountdown as dt } from "./hooks/useCountdown.js";
79
- import { KONAMI_CODE as Tt, useKeySequence as Ct } from "./hooks/useKeySequence.js";
80
- import { cn as St } from "./lib/utils.js";
38
+ import { Textarea as Ar } from "./components/atoms/Textarea/Textarea.js";
39
+ import { textareaVariants as Dr } from "./components/atoms/Textarea/textarea-variants.js";
40
+ import { AvatarStrip as qr } from "./components/atoms/AvatarStrip/AvatarStrip.js";
41
+ import { Tooltip as Er } from "./components/atoms/Tooltip/Tooltip.js";
42
+ import { CollapsibleSection as Lr } from "./components/atoms/CollapsibleSection/CollapsibleSection.js";
43
+ import { SegmentBar as Pr } from "./components/atoms/SegmentBar/SegmentBar.js";
44
+ import { Toast as Nr } from "./components/molecules/Toast/Toast.js";
45
+ import { toastVariants as Fr } from "./components/molecules/Toast/toast-variants.js";
46
+ import { Toaster as Kr } from "./components/molecules/Toast/Toaster.js";
47
+ import { TONE_PREFIX as Wr, toast as Xr } from "./components/molecules/Toast/toast-api.js";
48
+ import { Alert as zr } from "./components/molecules/Alert/Alert.js";
49
+ import { alertVariants as Qr } from "./components/molecules/Alert/alert-variants.js";
50
+ import { Accordion as Yr } from "./components/molecules/Accordion/Accordion.js";
51
+ import { DescriptionList as $r } from "./components/molecules/DescriptionList/DescriptionList.js";
52
+ import { descriptionListVariants as oo } from "./components/molecules/DescriptionList/description-list-variants.js";
53
+ import { Pullquote as eo } from "./components/molecules/Pullquote/Pullquote.js";
54
+ import { pullquoteVariants as po } from "./components/molecules/Pullquote/pullquote-variants.js";
55
+ import { CheckboxGroup as mo } from "./components/molecules/CheckboxGroup/CheckboxGroup.js";
56
+ import { checkboxGroupOptionsVariants as fo, checkboxGroupPanelVariants as no } from "./components/molecules/CheckboxGroup/checkbox-group-variants.js";
57
+ import { RadioGroup as lo } from "./components/molecules/RadioGroup/RadioGroup.js";
58
+ import { radioDotVariants as co, radioGroupOptionsVariants as bo, radioOptionVariants as uo, radioVariants as To } from "./components/molecules/RadioGroup/radio-group-variants.js";
59
+ import { Breadcrumbs as ho } from "./components/molecules/Breadcrumbs/Breadcrumbs.js";
60
+ import { breadcrumbVariants as go } from "./components/molecules/Breadcrumbs/breadcrumb-variants.js";
61
+ import { LiquidTabs as ko } from "./components/molecules/LiquidTabs/LiquidTabs.js";
62
+ import { LiquidNav as Ao } from "./components/molecules/LiquidTabs/LiquidNav.js";
63
+ import { liquidTabId as Do } from "./components/molecules/LiquidTabs/liquid-tab-id.js";
64
+ import { CallToAction as qo } from "./components/molecules/CallToAction/CallToAction.js";
65
+ import { ctaVariants as Eo } from "./components/molecules/CallToAction/call-to-action-variants.js";
66
+ import { EmptyState as Lo } from "./components/molecules/EmptyState/EmptyState.js";
67
+ import { emptyStateVariants as Po } from "./components/molecules/EmptyState/empty-state-variants.js";
68
+ import { ErrorState as No } from "./components/molecules/ErrorState/ErrorState.js";
69
+ import { errorStateVariants as Fo } from "./components/molecules/ErrorState/error-state-variants.js";
70
+ import { MatchupCard as Ko } from "./components/molecules/MatchupCard/MatchupCard.js";
71
+ import { ActionBar as Wo } from "./components/organisms/ActionBar/ActionBar.js";
72
+ import { actionBarVariants as jo } from "./components/organisms/ActionBar/action-bar-variants.js";
73
+ import { Countdown as Jo } from "./components/organisms/Countdown/Countdown.js";
74
+ import { Dialog as Uo } from "./components/organisms/Dialog/Dialog.js";
75
+ import { Footer as Zo } from "./components/organisms/Footer/Footer.js";
76
+ import { Navbar as rt } from "./components/organisms/Navbar/Navbar.js";
77
+ import { navbarVariants as tt } from "./components/organisms/Navbar/navbar-variants.js";
78
+ import { Sheet as at } from "./components/organisms/Sheet/Sheet.js";
79
+ import { Table as it, TableBody as mt, TableCaption as xt, TableCell as ft, TableFooter as nt, TableHead as st, TableHeader as lt, TableRow as Vt } from "./components/organisms/Table/Table.js";
80
+ import { tableCellVariants as bt, tableHeadVariants as dt, tableHeaderVariants as ut, tableRowVariants as Tt, tableVariants as Ct, tableWrapperVariants as ht } from "./components/organisms/Table/table-variants.js";
81
+ import { useCountdown as gt } from "./hooks/useCountdown.js";
82
+ import { KONAMI_CODE as kt, useKeySequence as vt } from "./hooks/useKeySequence.js";
83
+ import { cn as Bt } from "./lib/utils.js";
81
84
  export {
82
- $r as Accordion,
83
- Mo as ActionBar,
84
- Qr as Alert,
85
+ Yr as Accordion,
86
+ Wo as ActionBar,
87
+ zr as Alert,
85
88
  e as Avatar,
86
- yr as AvatarStrip,
89
+ qr as AvatarStrip,
87
90
  m as Badge,
88
- go as Breadcrumbs,
91
+ ho as Breadcrumbs,
89
92
  s as Button,
90
- Bo as CallToAction,
93
+ qo as CallToAction,
91
94
  b as Card,
92
95
  C as Checkbox,
93
- no as CheckboxGroup,
94
- N as Chip,
95
- qr as CollapsibleSection,
96
- F as Combobox,
97
- Wo as Countdown,
98
- oo as DescriptionList,
99
- jo as Dialog,
96
+ mo as CheckboxGroup,
97
+ M as Chip,
98
+ Lr as CollapsibleSection,
99
+ R as Combobox,
100
+ Jo as Countdown,
101
+ $r as DescriptionList,
102
+ Uo as Dialog,
100
103
  w as Disclosure,
101
- yo as EmptyState,
102
- Lo as ErrorState,
104
+ Lo as EmptyState,
105
+ No as ErrorState,
103
106
  U as Eyebrow,
104
- Jo as Footer,
107
+ Zo as Footer,
105
108
  rr as InlineCode,
106
- O as Input,
107
- Tt as KONAMI_CODE,
109
+ D as Input,
110
+ kt as KONAMI_CODE,
108
111
  ar as LabeledDivider,
109
112
  I as Link,
110
- Gr as LiquidTabs,
111
- Ro as MatchupCard,
113
+ Ao as LiquidNav,
114
+ ko as LiquidTabs,
115
+ Ko as MatchupCard,
112
116
  lr as MultiSelect,
113
- Uo as Navbar,
117
+ rt as Navbar,
114
118
  H as PasswordInput,
115
119
  X as Pill,
116
- po as Pullquote,
117
- co as RadioGroup,
118
- Rr as SegmentBar,
120
+ eo as Pullquote,
121
+ lo as RadioGroup,
122
+ Pr as SegmentBar,
119
123
  cr as Select,
124
+ at as Sheet,
120
125
  Cr as Spinner,
121
126
  ir as Stat,
122
127
  Sr as Switch,
123
- jr as TONE_PREFIX,
124
- rt as Table,
125
- ot as TableBody,
126
- tt as TableCaption,
127
- et as TableCell,
128
- at as TableFooter,
129
- pt as TableHead,
130
- it as TableHeader,
131
- mt as TableRow,
132
- Br as Textarea,
133
- fr as ThemeToggle,
134
- Mr as Toast,
135
- Wr as Toaster,
136
- Lr as Tooltip,
137
- Ko as actionBarVariants,
138
- Yr as alertVariants,
128
+ Wr as TONE_PREFIX,
129
+ it as Table,
130
+ mt as TableBody,
131
+ xt as TableCaption,
132
+ ft as TableCell,
133
+ nt as TableFooter,
134
+ st as TableHead,
135
+ lt as TableHeader,
136
+ Vt as TableRow,
137
+ Ar as Textarea,
138
+ nr as ThemeToggle,
139
+ Nr as Toast,
140
+ Kr as Toaster,
141
+ Er as Tooltip,
142
+ jo as actionBarVariants,
143
+ Qr as alertVariants,
139
144
  p as avatarVariants,
140
- n as badgeVariants,
141
- ko as breadcrumbVariants,
145
+ f as badgeVariants,
146
+ go as breadcrumbVariants,
142
147
  V as buttonVariants,
143
148
  u as cardVariants,
144
- so as checkboxGroupOptionsVariants,
145
- lo as checkboxGroupPanelVariants,
149
+ fo as checkboxGroupOptionsVariants,
150
+ no as checkboxGroupPanelVariants,
146
151
  S as checkboxVariants,
147
152
  _ as chipVariants,
148
- St as cn,
149
- Oo as ctaVariants,
150
- eo as descriptionListVariants,
151
- A as disclosureContentVariants,
152
- B as disclosureTriggerVariants,
153
- Go as emptyStateVariants,
154
- qo as errorStateVariants,
153
+ Bt as cn,
154
+ Eo as ctaVariants,
155
+ oo as descriptionListVariants,
156
+ v as disclosureContentVariants,
157
+ A as disclosureTriggerVariants,
158
+ Po as emptyStateVariants,
159
+ Fo as errorStateVariants,
155
160
  Z as eyebrowVariants,
156
- y as iconVariants,
161
+ q as iconVariants,
157
162
  tr as inlineCodeVariants,
158
- E as inputVariants,
159
- P as linkVariants,
160
- Zo as navbarVariants,
163
+ y as inputVariants,
164
+ G as linkVariants,
165
+ Do as liquidTabId,
166
+ tt as navbarVariants,
161
167
  z as pillDotVariants,
162
168
  J as pillVariants,
163
- mo as pullquoteVariants,
164
- uo as radioDotVariants,
165
- To as radioGroupOptionsVariants,
166
- Co as radioOptionVariants,
167
- ho as radioVariants,
169
+ po as pullquoteVariants,
170
+ co as radioDotVariants,
171
+ bo as radioGroupOptionsVariants,
172
+ uo as radioOptionVariants,
173
+ To as radioVariants,
168
174
  dr as selectOptionVariants,
169
175
  ur as selectTriggerVariants,
170
176
  xr as statValueVariants,
171
177
  wr as switchThumbVariants,
172
178
  kr as switchTrackVariants,
173
- nt as tableCellVariants,
174
- ft as tableHeadVariants,
175
- st as tableHeaderVariants,
176
- lt as tableRowVariants,
177
- Vt as tableVariants,
178
- ct as tableWrapperVariants,
179
- Or as textareaVariants,
180
- zr as toast,
181
- Kr as toastVariants,
182
- dt as useCountdown,
183
- Ct as useKeySequence
179
+ bt as tableCellVariants,
180
+ dt as tableHeadVariants,
181
+ ut as tableHeaderVariants,
182
+ Tt as tableRowVariants,
183
+ Ct as tableVariants,
184
+ ht as tableWrapperVariants,
185
+ Dr as textareaVariants,
186
+ Xr as toast,
187
+ Fr as toastVariants,
188
+ gt as useCountdown,
189
+ vt as useKeySequence
184
190
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blakesteve/roster",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "A production-grade atomic component library: accessible, theme-aware, and documented in Storybook. React 19, TypeScript, Tailwind CSS v4.",
5
5
  "keywords": [
6
6
  "react",
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),r=require("react"),c=require("../../../lib/utils.cjs");function C({tabs:g,activeTab:l,onChange:x,variant:R="pill",fullWidth:b=!1,className:v}){const w=r.useRef(null),a=r.useRef(null),f=r.useRef(null),o=r.useRef(null),m=r.useRef(!1),h=R==="filled",i=r.useCallback(t=>{const e=w.current;if(!e)return null;const s=e.querySelector(`[data-tab-id="${t}"]`);if(!s)return null;const n=e.getBoundingClientRect(),d=s.getBoundingClientRect();return{left:d.left-n.left,width:d.width}},[]),u=r.useCallback((t,e,s)=>{const n=a.current;n&&(n.style.transition=e,n.style.left=`${t.left}px`,n.style.width=`${t.width}px`,n.style.transform=`scaleY(${s})`)},[]);r.useEffect(()=>{const t=i(l);t&&(f.current=t,u(t,"none",1),a.current&&(a.current.style.opacity="1"),m.current=!0)},[]),r.useEffect(()=>{if(!m.current||o.current!==null)return;const t=i(l);t&&(f.current=t,u(t,"none",1))},[l,i,u]);const q=r.useCallback(t=>{if(t===l||(x(t),!m.current))return;o.current&&clearTimeout(o.current);const e=f.current??i(l),s=i(t);if(!e||!s)return;const n=Math.min(e.left,s.left),d=Math.max(e.left+e.width,s.left+s.width)-n;u({left:n,width:d},"left 130ms ease-out, width 130ms ease-out, transform 130ms ease-out",.55),o.current=setTimeout(()=>{const y=i(t)??s;f.current=y,u(y,"left 160ms ease-in, width 160ms ease-in, transform 160ms ease-in",1),o.current=null},130)},[l,i,x,u]);return r.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),p.jsxs("div",{ref:w,role:"tablist","data-testid":"liquid-tabs",style:{background:"var(--roster-lt-bg)",borderColor:"var(--roster-lt-border)"},className:c.cn("rst:font-ui rst:relative rst:flex rst:border",h?"rst:w-full rst:overflow-hidden rst:rounded-lg":c.cn("rst:gap-1 rst:rounded-xl rst:p-1",b?"rst:w-full":"rst:w-fit"),v),children:[p.jsx("div",{ref:a,"aria-hidden":!0,"data-testid":"liquid-tabs-pill",className:c.cn("rst:absolute rst:rounded-lg",h?"rst:top-0 rst:bottom-0":"rst:top-1 rst:bottom-1"),style:{opacity:0,left:0,width:0,background:"var(--roster-lt-pill)"}}),g.map(t=>{const e=t.id===l;return p.jsx("button",{role:"tab","aria-selected":e,"data-tab-id":t.id,"data-testid":`liquid-tab-${t.id}`,onClick:()=>q(t.id),className:c.cn("rst:relative rst:z-10 rst:text-sm rst:font-medium rst:transition-colors rst:cursor-pointer",h?c.cn("rst:flex-1 rst:py-2",e?"rst:text-white":"rst:text-(--roster-lt-text-inactive) rst:hover:text-(--roster-lt-text-hover)"):c.cn("rst:rounded-lg rst:py-1.5",b?"rst:flex-1":"rst:px-4",e?"rst:text-white":"rst:text-(--roster-lt-text-inactive) rst:hover:text-(--roster-lt-text-hover)")),children:typeof t.label=="function"?t.label(e):t.label},t.id)})]})}exports.LiquidTabs=C;
@@ -1,39 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface TabItem {
3
- id: string;
4
- /** Static label, or a render function that receives whether this tab is active. */
5
- label: ReactNode | ((isActive: boolean) => ReactNode);
6
- }
7
- export interface LiquidTabsProps {
8
- tabs: TabItem[];
9
- /** The `id` of the currently active tab. */
10
- activeTab: string;
11
- /** Called with the new tab `id` when the user selects a different tab. */
12
- onChange: (id: string) => void;
13
- /**
14
- * `"pill"` (default) — floating pill inside a padded container.
15
- * Width is `w-fit` by default; use `fullWidth` to stretch it.
16
- * Liquid feel via scaleY squash during the stretch phase.
17
- *
18
- * `"filled"` — active tab fills its entire cell; container is always `w-full`.
19
- * Liquid feel via border-radius morphing (oval during stretch) so the
20
- * full-height pill never gaps at the container edges.
21
- */
22
- variant?: "pill" | "filled";
23
- /** Stretch the `pill` variant container to full width with `flex-1` buttons. */
24
- fullWidth?: boolean;
25
- /** Extra classes applied to the outer container. */
26
- className?: string;
27
- }
28
- /**
29
- * Controlled tab strip with a liquid sliding indicator.
30
- *
31
- * The pill animation is driven by direct DOM ref manipulation (no setState)
32
- * to avoid re-renders during the transition. Two-phase motion:
33
- * 1. Stretch — pill expands to span the gap between old and new tab (130 ms ease-out).
34
- * 2. Contract — pill snaps to the target tab (160 ms ease-in).
35
- *
36
- * `getBoundingClientRect` is used to measure tab positions, so the component
37
- * must be rendered in a document with a real layout engine to animate.
38
- */
39
- export declare function LiquidTabs({ tabs, activeTab, onChange, variant, fullWidth, className, }: LiquidTabsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,120 +0,0 @@
1
- "use client";
2
- import { jsxs as k, jsx as v } from "react/jsx-runtime";
3
- import { useRef as c, useCallback as h, useEffect as x } from "react";
4
- import { cn as u } from "../../../lib/utils.js";
5
- function B({
6
- tabs: R,
7
- activeTab: n,
8
- onChange: w,
9
- variant: q = "pill",
10
- fullWidth: y = !1,
11
- className: C
12
- }) {
13
- const g = c(null), d = c(null), a = c(null), l = c(null), m = c(!1), p = q === "filled", o = h((t) => {
14
- const r = g.current;
15
- if (!r) return null;
16
- const e = r.querySelector(`[data-tab-id="${t}"]`);
17
- if (!e) return null;
18
- const s = r.getBoundingClientRect(), f = e.getBoundingClientRect();
19
- return { left: f.left - s.left, width: f.width };
20
- }, []), i = h((t, r, e) => {
21
- const s = d.current;
22
- s && (s.style.transition = r, s.style.left = `${t.left}px`, s.style.width = `${t.width}px`, s.style.transform = `scaleY(${e})`);
23
- }, []);
24
- x(() => {
25
- const t = o(n);
26
- t && (a.current = t, i(t, "none", 1), d.current && (d.current.style.opacity = "1"), m.current = !0);
27
- }, []), x(() => {
28
- if (!m.current || l.current !== null) return;
29
- const t = o(n);
30
- t && (a.current = t, i(t, "none", 1));
31
- }, [n, o, i]);
32
- const $ = h(
33
- (t) => {
34
- if (t === n || (w(t), !m.current)) return;
35
- l.current && clearTimeout(l.current);
36
- const r = a.current ?? o(n), e = o(t);
37
- if (!r || !e) return;
38
- const s = Math.min(r.left, e.left), f = Math.max(r.left + r.width, e.left + e.width) - s;
39
- i(
40
- { left: s, width: f },
41
- "left 130ms ease-out, width 130ms ease-out, transform 130ms ease-out",
42
- 0.55
43
- ), l.current = setTimeout(() => {
44
- const b = o(t) ?? e;
45
- a.current = b, i(
46
- b,
47
- "left 160ms ease-in, width 160ms ease-in, transform 160ms ease-in",
48
- 1
49
- ), l.current = null;
50
- }, 130);
51
- },
52
- [n, o, w, i]
53
- );
54
- return x(
55
- () => () => {
56
- l.current && clearTimeout(l.current);
57
- },
58
- []
59
- ), /* @__PURE__ */ k(
60
- "div",
61
- {
62
- ref: g,
63
- role: "tablist",
64
- "data-testid": "liquid-tabs",
65
- style: { background: "var(--roster-lt-bg)", borderColor: "var(--roster-lt-border)" },
66
- className: u(
67
- "rst:font-ui rst:relative rst:flex rst:border",
68
- p ? "rst:w-full rst:overflow-hidden rst:rounded-lg" : u(
69
- "rst:gap-1 rst:rounded-xl rst:p-1",
70
- y ? "rst:w-full" : "rst:w-fit"
71
- ),
72
- C
73
- ),
74
- children: [
75
- /* @__PURE__ */ v(
76
- "div",
77
- {
78
- ref: d,
79
- "aria-hidden": !0,
80
- "data-testid": "liquid-tabs-pill",
81
- className: u(
82
- "rst:absolute rst:rounded-lg",
83
- p ? "rst:top-0 rst:bottom-0" : "rst:top-1 rst:bottom-1"
84
- ),
85
- style: { opacity: 0, left: 0, width: 0, background: "var(--roster-lt-pill)" }
86
- }
87
- ),
88
- R.map((t) => {
89
- const r = t.id === n;
90
- return /* @__PURE__ */ v(
91
- "button",
92
- {
93
- role: "tab",
94
- "aria-selected": r,
95
- "data-tab-id": t.id,
96
- "data-testid": `liquid-tab-${t.id}`,
97
- onClick: () => $(t.id),
98
- className: u(
99
- "rst:relative rst:z-10 rst:text-sm rst:font-medium rst:transition-colors rst:cursor-pointer",
100
- p ? u(
101
- "rst:flex-1 rst:py-2",
102
- r ? "rst:text-white" : "rst:text-(--roster-lt-text-inactive) rst:hover:text-(--roster-lt-text-hover)"
103
- ) : u(
104
- "rst:rounded-lg rst:py-1.5",
105
- y ? "rst:flex-1" : "rst:px-4",
106
- r ? "rst:text-white" : "rst:text-(--roster-lt-text-inactive) rst:hover:text-(--roster-lt-text-hover)"
107
- )
108
- ),
109
- children: typeof t.label == "function" ? t.label(r) : t.label
110
- },
111
- t.id
112
- );
113
- })
114
- ]
115
- }
116
- );
117
- }
118
- export {
119
- B as LiquidTabs
120
- };