@gebeta/ui 0.0.0-stage → 0.3.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.
- package/LICENSE +21 -0
- package/README.md +20 -2
- package/dist/components/Badge/Badge.d.ts +25 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +26 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/Badge.module.js +9 -0
- package/dist/components/Badge/Badge.module.js.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +32 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +39 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.module.js +9 -0
- package/dist/components/Button/Button.module.js.map +1 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +13 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +65 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.js +13 -0
- package/dist/components/Checkbox/Checkbox.module.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +52 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +78 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/Dialog.module.js +15 -0
- package/dist/components/Dialog/Dialog.module.js.map +1 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +22 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +40 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/Spinner/Spinner.module.js +13 -0
- package/dist/components/Spinner/Spinner.module.js.map +1 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +17 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +27 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/Switch.module.js +11 -0
- package/dist/components/Switch/Switch.module.js.map +1 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/TextField/TextField.d.ts +37 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/TextField.js +59 -0
- package/dist/components/TextField/TextField.js.map +1 -0
- package/dist/components/TextField/TextField.module.js +15 -0
- package/dist/components/TextField/TextField.module.js.map +1 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextField/index.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +31 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +29 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.module.js +10 -0
- package/dist/components/Tooltip/Tooltip.module.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/docs/components/Badge.md +45 -0
- package/dist/docs/components/Button.md +60 -0
- package/dist/docs/components/Checkbox.md +65 -0
- package/dist/docs/components/Dialog.md +161 -0
- package/dist/docs/components/Spinner.md +33 -0
- package/dist/docs/components/Switch.md +59 -0
- package/dist/docs/components/TextField.md +65 -0
- package/dist/docs/components/Tooltip.md +63 -0
- package/dist/docs/index.md +58 -0
- package/dist/docs/tokens.md +33 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/styles.css +2 -0
- package/dist/utils/class-names.d.ts +8 -0
- package/dist/utils/class-names.d.ts.map +1 -0
- package/dist/utils/class-names.js +10 -0
- package/dist/utils/class-names.js.map +1 -0
- package/package.json +76 -3
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Dialog
|
|
2
|
+
|
|
3
|
+
> Modal dialog with focus trap, Esc/outside-click close and header/body/footer layout.
|
|
4
|
+
|
|
5
|
+
`import { Dialog } from '@gebeta/ui';` · built on Base UI · @gebeta/ui 0.3.0
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
- Compound API: `Dialog.Root` › `Dialog.Trigger` + `Dialog.Content` › `Dialog.Header` (`Title`, `Description`), `Dialog.Body`, `Dialog.Footer`.
|
|
10
|
+
- Always include `Dialog.Title` (it names the dialog for screen readers).
|
|
11
|
+
- Make our `Button` the trigger/close with `render`: `<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>`.
|
|
12
|
+
- Controlled: `open` + `onOpenChange(open)` on `Dialog.Root` (e.g. close after a form submits).
|
|
13
|
+
- `Dialog.Content` props: `size` (`sm` | `md` | `lg`), `showCloseButton` (default true), `closeLabel`.
|
|
14
|
+
- Focus returns to the trigger on close automatically; don't manage focus yourself.
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { Button, Dialog } from '@gebeta/ui';
|
|
20
|
+
|
|
21
|
+
<Dialog.Root>
|
|
22
|
+
<Dialog.Trigger render={<Button variant="danger" />}>Delete route</Dialog.Trigger>
|
|
23
|
+
<Dialog.Content size="sm">
|
|
24
|
+
<Dialog.Header>
|
|
25
|
+
<Dialog.Title>Delete route?</Dialog.Title>
|
|
26
|
+
<Dialog.Description>This can’t be undone.</Dialog.Description>
|
|
27
|
+
</Dialog.Header>
|
|
28
|
+
<Dialog.Footer>
|
|
29
|
+
<Dialog.Close render={<Button variant="secondary" />}>Cancel</Dialog.Close>
|
|
30
|
+
<Button variant="danger">Delete</Button>
|
|
31
|
+
</Dialog.Footer>
|
|
32
|
+
</Dialog.Content>
|
|
33
|
+
</Dialog.Root>;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { useState } from 'react';
|
|
38
|
+
import { Button, Dialog, TextField } from '@gebeta/ui';
|
|
39
|
+
|
|
40
|
+
export function AddDriverDialog() {
|
|
41
|
+
const [open, setOpen] = useState(false);
|
|
42
|
+
return (
|
|
43
|
+
<Dialog.Root open={open} onOpenChange={setOpen}>
|
|
44
|
+
<Dialog.Trigger render={<Button />}>Add driver</Dialog.Trigger>
|
|
45
|
+
<Dialog.Content>
|
|
46
|
+
<form
|
|
47
|
+
onSubmit={(e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
setOpen(false);
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
<Dialog.Header>
|
|
53
|
+
<Dialog.Title>Add driver</Dialog.Title>
|
|
54
|
+
</Dialog.Header>
|
|
55
|
+
<Dialog.Body>
|
|
56
|
+
<TextField label="Full name" name="name" required />
|
|
57
|
+
</Dialog.Body>
|
|
58
|
+
<Dialog.Footer>
|
|
59
|
+
<Dialog.Close render={<Button variant="secondary" />}>Cancel</Dialog.Close>
|
|
60
|
+
<Button type="submit">Save</Button>
|
|
61
|
+
</Dialog.Footer>
|
|
62
|
+
</form>
|
|
63
|
+
</Dialog.Content>
|
|
64
|
+
</Dialog.Root>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Behaviour details (Base UI 1.9.0)
|
|
70
|
+
|
|
71
|
+
Keyboard, focus, ARIA, events and `data-*` state attributes come from Base UI. Its docs ship in the installed
|
|
72
|
+
`@base-ui/react` package (see "Base UI docs" in index.md to locate it):
|
|
73
|
+
|
|
74
|
+
- `@base-ui/react/docs/react/components/dialog.md` (~180 KB)
|
|
75
|
+
|
|
76
|
+
These files are large. List headings first (`grep -n '^##' <file>`), then read only the section you need,
|
|
77
|
+
e.g. the `Root Data Attributes` table for styling states like `[data-checked]`.
|
|
78
|
+
|
|
79
|
+
## Props
|
|
80
|
+
|
|
81
|
+
All parts also accept `className` (string or `(state) => string`), `style`, `render` (swap the element) and the native HTML attributes of the rendered element.
|
|
82
|
+
|
|
83
|
+
### Dialog.Root
|
|
84
|
+
|
|
85
|
+
From Base UI:
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default | Description |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
| open | `boolean` | | Whether the dialog is currently open. |
|
|
90
|
+
| defaultOpen | `boolean` | `false` | Whether the dialog is initially open. |
|
|
91
|
+
| modal | `boolean \| "trap-focus"` | `true` | Determines if the dialog enters a modal state when open. |
|
|
92
|
+
| onOpenChange | `((open: boolean, eventDetails: DialogRootChangeEventDetails) => void)` | | Event handler called when the dialog is opened or closed. |
|
|
93
|
+
| onOpenChangeComplete | `((open: boolean) => void)` | | Event handler called after any animations complete when the dialog is opened or closed. |
|
|
94
|
+
| disablePointerDismissal | `boolean` | `false` | Whether to prevent the dialog from closing on outside presses. |
|
|
95
|
+
| actionsRef | `RefObject<DialogRootActions \| null>` | | A ref to imperative actions. |
|
|
96
|
+
| handle | `DialogHandle<Payload>` | | A handle to associate the dialog with a trigger. |
|
|
97
|
+
| children | `ReactNode \| PayloadChildRenderFunction<Payload>` | | The content of the dialog. |
|
|
98
|
+
| triggerId | `string \| null` | | ID of the trigger that the dialog is associated with. |
|
|
99
|
+
| defaultTriggerId | `string \| null` | | ID of the trigger that the dialog is associated with. |
|
|
100
|
+
|
|
101
|
+
### Dialog.Trigger
|
|
102
|
+
|
|
103
|
+
From Base UI:
|
|
104
|
+
|
|
105
|
+
| Prop | Type | Default | Description |
|
|
106
|
+
| --- | --- | --- | --- |
|
|
107
|
+
| handle | `DialogHandle<Payload>` | | A handle to associate the trigger with a dialog. |
|
|
108
|
+
| payload | `Payload` | | A payload to pass to the dialog when it is opened. |
|
|
109
|
+
| id | `string` | | ID of the trigger. |
|
|
110
|
+
| nativeButton | `boolean` | `true` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. |
|
|
111
|
+
|
|
112
|
+
### Dialog.Close
|
|
113
|
+
|
|
114
|
+
From Base UI:
|
|
115
|
+
|
|
116
|
+
| Prop | Type | Default | Description |
|
|
117
|
+
| --- | --- | --- | --- |
|
|
118
|
+
| nativeButton | `boolean` | `true` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. |
|
|
119
|
+
|
|
120
|
+
### Dialog.Content
|
|
121
|
+
|
|
122
|
+
Portal + backdrop + popup in one. Consumers never have to remember the
|
|
123
|
+
|
|
124
|
+
| Prop | Type | Default | Description |
|
|
125
|
+
| --- | --- | --- | --- |
|
|
126
|
+
| size | `"sm" \| "md" \| "lg"` | `md` | |
|
|
127
|
+
| showCloseButton | `boolean` | `true` | Render the × button in the corner. |
|
|
128
|
+
| closeLabel | `string` | `Close` | Accessible label for the × button. |
|
|
129
|
+
|
|
130
|
+
From Base UI:
|
|
131
|
+
|
|
132
|
+
| Prop | Type | Default | Description |
|
|
133
|
+
| --- | --- | --- | --- |
|
|
134
|
+
| initialFocus | `boolean \| RefObject<HTMLElement \| null> \| ((openType: InteractionType) => boolean \|…` | | Determines the element to focus when the dialog is opened. |
|
|
135
|
+
| finalFocus | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => boolean \…` | | Determines the element to focus when the dialog is closed. |
|
|
136
|
+
|
|
137
|
+
### Dialog.Header
|
|
138
|
+
|
|
139
|
+
Top band: put `Dialog.Title` and `Dialog.Description` here.
|
|
140
|
+
|
|
141
|
+
Accepts the standard HTML attributes of its element.
|
|
142
|
+
|
|
143
|
+
### Dialog.Body
|
|
144
|
+
|
|
145
|
+
Main content (form fields, text…).
|
|
146
|
+
|
|
147
|
+
Accepts the standard HTML attributes of its element.
|
|
148
|
+
|
|
149
|
+
### Dialog.Title
|
|
150
|
+
|
|
151
|
+
Accepts the standard HTML attributes of its element.
|
|
152
|
+
|
|
153
|
+
### Dialog.Description
|
|
154
|
+
|
|
155
|
+
Accepts the standard HTML attributes of its element.
|
|
156
|
+
|
|
157
|
+
### Dialog.Footer
|
|
158
|
+
|
|
159
|
+
Bottom band with right-aligned actions.
|
|
160
|
+
|
|
161
|
+
Accepts the standard HTML attributes of its element.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
> Indeterminate loading indicator that inherits the text color.
|
|
4
|
+
|
|
5
|
+
`import { Spinner } from '@gebeta/ui';` · custom Gebeta component · @gebeta/ui 0.3.0
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
- Announces "Loading" to screen readers (`role="status"`); change it with `label`.
|
|
10
|
+
- Use `decorative` when the surrounding element already says it's busy (e.g. inside a button — but prefer `Button loading`).
|
|
11
|
+
- Color comes from `currentColor`; size `sm` | `md` | `lg`.
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Spinner } from '@gebeta/ui';
|
|
17
|
+
|
|
18
|
+
<Spinner />
|
|
19
|
+
<Spinner size="lg" label="Loading routes" />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
All parts also accept `className` (string or `(state) => string`), `style`, `render` (swap the element) and the native HTML attributes of the rendered element.
|
|
26
|
+
|
|
27
|
+
### Spinner
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default | Description |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
| size | `"sm" \| "md" \| "lg"` | `md` | |
|
|
32
|
+
| label | `string` | `Loading` | Text announced to screen readers. |
|
|
33
|
+
| decorative | `boolean` | `false` | Hide from assistive tech — use when the surrounding element already communicates the busy state (e.g. |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
> On/off toggle for settings that apply immediately.
|
|
4
|
+
|
|
5
|
+
`import { Switch } from '@gebeta/ui';` · built on Base UI · @gebeta/ui 0.3.0
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
- Use when the change takes effect immediately (no Save button). For form choices use `Checkbox`.
|
|
10
|
+
- Pass `label` or `aria-label`. Controlled: `checked` + `onCheckedChange(checked: boolean)`.
|
|
11
|
+
- Sizes: `md` (default, 32×18) and `sm`.
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Switch } from '@gebeta/ui';
|
|
17
|
+
|
|
18
|
+
<Switch label="Share live location" defaultChecked />
|
|
19
|
+
<Switch size="sm" aria-label="Notifications" onCheckedChange={(on) => console.log(on)} />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Behaviour details (Base UI 1.9.0)
|
|
23
|
+
|
|
24
|
+
Keyboard, focus, ARIA, events and `data-*` state attributes come from Base UI. Its docs ship in the installed
|
|
25
|
+
`@base-ui/react` package (see "Base UI docs" in index.md to locate it):
|
|
26
|
+
|
|
27
|
+
- `@base-ui/react/docs/react/components/switch.md` (~21 KB)
|
|
28
|
+
|
|
29
|
+
These files are large. List headings first (`grep -n '^##' <file>`), then read only the section you need,
|
|
30
|
+
e.g. the `Root Data Attributes` table for styling states like `[data-checked]`.
|
|
31
|
+
|
|
32
|
+
## Props
|
|
33
|
+
|
|
34
|
+
All parts also accept `className` (string or `(state) => string`), `style`, `render` (swap the element) and the native HTML attributes of the rendered element.
|
|
35
|
+
|
|
36
|
+
### Switch
|
|
37
|
+
|
|
38
|
+
| Prop | Type | Default | Description |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| label | `ReactNode` | | Visible label. |
|
|
41
|
+
| size | `"sm" \| "md"` | `md` | |
|
|
42
|
+
|
|
43
|
+
From Base UI:
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| defaultChecked | `boolean` | `false` | Whether the switch is initially active. |
|
|
48
|
+
| form | `string` | | Identifies the form that owns the hidden input. |
|
|
49
|
+
| id | `string` | | The id of the hidden input element. |
|
|
50
|
+
| checked | `boolean` | | Whether the switch is currently active. |
|
|
51
|
+
| disabled | `boolean` | `false` | Whether the component should ignore user interaction. |
|
|
52
|
+
| inputRef | `Ref<HTMLInputElement>` | | A ref to access the hidden `<input>` element. |
|
|
53
|
+
| name | `string` | | Identifies the field when a form is submitted. |
|
|
54
|
+
| onCheckedChange | `((checked: boolean, eventDetails: { reason: "none"; event: Event; cancel: () => void; a…` | | Event handler called when the switch is activated or deactivated. |
|
|
55
|
+
| readOnly | `boolean` | `false` | Whether the user should be unable to activate or deactivate the switch. |
|
|
56
|
+
| required | `boolean` | `false` | Whether the user must activate the switch before submitting a form. |
|
|
57
|
+
| value | `string` | | The value submitted with the form when the switch is on. |
|
|
58
|
+
| uncheckedValue | `string` | | The value submitted with the form when the switch is off. |
|
|
59
|
+
| nativeButton | `boolean` | `false` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. |
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# TextField
|
|
2
|
+
|
|
3
|
+
> Labelled text input with description, error and adornments; native + custom validation.
|
|
4
|
+
|
|
5
|
+
`import { TextField } from '@gebeta/ui';` · built on Base UI · @gebeta/ui 0.3.0
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
- `label` is required. Input props (`name`, `type`, `placeholder`, `value`, `onChange`, `required`…) go straight to the `<input>`; `ref` points at the `<input>`.
|
|
10
|
+
- `description` = help text under the input. `error` = message from your own validation (react-hook-form, server); it marks the field invalid.
|
|
11
|
+
- Native constraints (`required`, `type="email"`, `minLength`) show the browser message automatically when inside a Base UI `<Form>` (`import { Form } from '@base-ui/react/form'`) or a regular `<form>`.
|
|
12
|
+
- Custom rules: `validate={(value) => 'message' | null}` with `validationMode="onBlur" | "onChange" | "onSubmit"`.
|
|
13
|
+
- `startAdornment` / `endAdornment` for units or icons inside the box (e.g. `ETB`).
|
|
14
|
+
- `className` goes on the outer wrapper, not the input.
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { TextField } from '@gebeta/ui';
|
|
20
|
+
|
|
21
|
+
<TextField label="Email" name="email" type="email" required placeholder="you@gebeta.app" />
|
|
22
|
+
<TextField label="Phone" description="Include country code" error="Number already registered" />
|
|
23
|
+
<TextField label="Delivery fee" startAdornment="ETB" inputMode="decimal" />
|
|
24
|
+
<TextField
|
|
25
|
+
label="Username"
|
|
26
|
+
validationMode="onBlur"
|
|
27
|
+
validate={(v) => (String(v).length < 3 ? 'At least 3 characters' : null)}
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Behaviour details (Base UI 1.9.0)
|
|
32
|
+
|
|
33
|
+
Keyboard, focus, ARIA, events and `data-*` state attributes come from Base UI. Its docs ship in the installed
|
|
34
|
+
`@base-ui/react` package (see "Base UI docs" in index.md to locate it):
|
|
35
|
+
|
|
36
|
+
- `@base-ui/react/docs/react/components/field.md` (~41 KB)
|
|
37
|
+
- `@base-ui/react/docs/react/components/input.md` (~9 KB)
|
|
38
|
+
|
|
39
|
+
These files are large. List headings first (`grep -n '^##' <file>`), then read only the section you need,
|
|
40
|
+
e.g. the `Root Data Attributes` table for styling states like `[data-checked]`.
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
All parts also accept `className` (string or `(state) => string`), `style`, `render` (swap the element) and the native HTML attributes of the rendered element.
|
|
45
|
+
|
|
46
|
+
### TextField
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| size | `"sm" \| "md" \| "lg"` | `md` | |
|
|
51
|
+
| **label** | `ReactNode` | | Visible label. |
|
|
52
|
+
| description | `ReactNode` | | Helper text shown under the input. |
|
|
53
|
+
| error | `ReactNode` | | Error message from your own validation (e.g. |
|
|
54
|
+
| startAdornment | `ReactNode` | | Content inside the input box, before the text (icon, currency…). |
|
|
55
|
+
| endAdornment | `ReactNode` | | Content inside the input box, after the text. |
|
|
56
|
+
| validate | `((value: unknown, formValues: Record<string, any>) => string \| void \| string[] \| Pro…` | | Base UI per-field validation function. |
|
|
57
|
+
| validationMode | `"onChange" \| "onBlur" \| "onSubmit"` | `'onSubmit'` | When validation runs. |
|
|
58
|
+
|
|
59
|
+
From Base UI:
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Description |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| defaultValue | `string \| number \| readonly string[]` | | The default value of the input. |
|
|
64
|
+
| value | `string \| number \| readonly string[]` | | The value of the input. |
|
|
65
|
+
| onValueChange | `((value: string, eventDetails: { reason: "none"; event: Event; cancel: () => void; allo…` | | Callback fired when the `value` changes. |
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
> Short hint on hover and keyboard focus, for icon buttons and truncated text.
|
|
4
|
+
|
|
5
|
+
`import { Tooltip } from '@gebeta/ui';` · built on Base UI · @gebeta/ui 0.3.0
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
- Wrap the app once in `TooltipProvider` (see setup in index.md).
|
|
10
|
+
- `children` must be ONE element that accepts a ref (a DOM element or one of our components). No wrapper is added.
|
|
11
|
+
- Text only, short. Never put links, buttons or essential info in a tooltip (touch users can't hover).
|
|
12
|
+
- An icon-only button still needs its own `aria-label`; the tooltip is a visual hint.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Button, Tooltip } from '@gebeta/ui';
|
|
18
|
+
|
|
19
|
+
<Tooltip content="Copy tracking link">
|
|
20
|
+
<Button variant="ghost" size="icon" aria-label="Copy tracking link"><svg aria-hidden /></Button>
|
|
21
|
+
</Tooltip>
|
|
22
|
+
<Tooltip content="Shown on the right" side="right">
|
|
23
|
+
<Button variant="secondary">Hover me</Button>
|
|
24
|
+
</Tooltip>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Behaviour details (Base UI 1.9.0)
|
|
28
|
+
|
|
29
|
+
Keyboard, focus, ARIA, events and `data-*` state attributes come from Base UI. Its docs ship in the installed
|
|
30
|
+
`@base-ui/react` package (see "Base UI docs" in index.md to locate it):
|
|
31
|
+
|
|
32
|
+
- `@base-ui/react/docs/react/components/tooltip.md` (~140 KB)
|
|
33
|
+
|
|
34
|
+
These files are large. List headings first (`grep -n '^##' <file>`), then read only the section you need,
|
|
35
|
+
e.g. the `Root Data Attributes` table for styling states like `[data-checked]`.
|
|
36
|
+
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
All parts also accept `className` (string or `(state) => string`), `style`, `render` (swap the element) and the native HTML attributes of the rendered element.
|
|
40
|
+
|
|
41
|
+
### Tooltip
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Description |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
|
+
| **content** | `ReactNode` | | Tooltip text. |
|
|
46
|
+
| **children** | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | | The trigger. |
|
|
47
|
+
| side | `"top" \| "bottom" \| "left" \| "right"` | `top` | |
|
|
48
|
+
| sideOffset | `number` | `8` | Distance from the trigger in px. |
|
|
49
|
+
| delay | `number` | | Hover delay in ms. |
|
|
50
|
+
| open | `boolean` | | |
|
|
51
|
+
| defaultOpen | `boolean` | | |
|
|
52
|
+
| onOpenChange | `((open: boolean) => void)` | | |
|
|
53
|
+
| disabled | `boolean` | | Disable the tooltip without removing it. |
|
|
54
|
+
|
|
55
|
+
### Tooltip.Provider
|
|
56
|
+
|
|
57
|
+
From Base UI:
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
| --- | --- | --- | --- |
|
|
61
|
+
| delay | `number` | | How long to wait before opening the tooltip on hover. |
|
|
62
|
+
| closeDelay | `number` | | How long to wait before closing a tooltip. |
|
|
63
|
+
| timeout | `number` | `400` | Another tooltip will open instantly if the previous tooltip is closed within this timeout. |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @gebeta/ui — docs for humans and AI agents
|
|
2
|
+
|
|
3
|
+
Version-matched docs: this folder ships inside the npm package, so it always describes the installed version.
|
|
4
|
+
|
|
5
|
+
## Setup (once per app)
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
// app entry: main.tsx or app/layout.tsx
|
|
9
|
+
import '@gebeta/ui/styles.css';
|
|
10
|
+
import { TooltipProvider } from '@gebeta/ui';
|
|
11
|
+
|
|
12
|
+
<TooltipProvider>{/* app */}</TooltipProvider>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- Dark mode: `class="dark"` or `data-theme="dark"` on `<html>`.
|
|
16
|
+
- Tailwind apps: import `@gebeta/ui/styles.css` BEFORE `tailwindcss`, so utilities can override.
|
|
17
|
+
Tailwind v4: `@import '@gebeta/tokens/tailwind.css'` → `bg-gb-primary`, `text-gb-fg-muted`, `rounded-gb-lg`.
|
|
18
|
+
Tailwind v3: `presets: [require('@gebeta/tokens/tailwind-preset')]`.
|
|
19
|
+
- Works with React 18 and 19, Vite and Next.js (all components are client components).
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
1. Use a component from the list below before building your own button/input/dialog/etc.
|
|
24
|
+
2. Never hardcode colors, shadows or radii. Use tokens (`tokens.md`): `var(--gb-color-fg-muted)` or Tailwind `text-gb-fg-muted`.
|
|
25
|
+
3. Every component accepts `className` (merged, never replaces our styles) and most accept `render` to change the element.
|
|
26
|
+
4. Our CSS is in `@layer gebeta`, so a plain class in your app always wins — no `!important`.
|
|
27
|
+
5. Icon-only buttons need `aria-label`. Every form control needs a visible `label` (or `aria-label`).
|
|
28
|
+
6. Missing something? Don't fork a component — ask the design-system team / open an issue.
|
|
29
|
+
|
|
30
|
+
## Files
|
|
31
|
+
|
|
32
|
+
- `components/<Name>.md` — usage rules, examples and props for one component. Read only the ones you need.
|
|
33
|
+
- `tokens.md` — every design token (colors, shadows, spacing, radius, text sizes).
|
|
34
|
+
|
|
35
|
+
## Base UI docs (behaviour details)
|
|
36
|
+
|
|
37
|
+
Most components wrap [Base UI](https://base-ui.com). For keyboard/focus behaviour, events and `data-*` state
|
|
38
|
+
attributes, each component file links the exact Base UI doc. They ship inside the installed `@base-ui/react`
|
|
39
|
+
(a dependency of `@gebeta/ui`, so its version always matches). Locate them — works with pnpm, npm and yarn:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node -p "const p=require('path');p.join(p.dirname(require.resolve('@base-ui/react/package.json',{paths:[p.dirname(require.resolve('@gebeta/ui/package.json'))]})),'docs/react')"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
They're large (up to ~180 KB): `grep -n '^##' <file>` first, then read only the section you need.
|
|
46
|
+
|
|
47
|
+
## Components (@gebeta/ui 0.3.0)
|
|
48
|
+
|
|
49
|
+
| Component | What | Kind |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| [Badge](components/Badge.md) | Small status/category label (Tag). Semantic and hue tones, optional dot. | custom |
|
|
52
|
+
| [Button](components/Button.md) | Action trigger. Pill shape, 8 variants, 6 sizes, built-in loading state. | base-ui |
|
|
53
|
+
| [Checkbox](components/Checkbox.md) | Checkbox with optional label and description; supports indeterminate. | base-ui |
|
|
54
|
+
| [Dialog](components/Dialog.md) | Modal dialog with focus trap, Esc/outside-click close and header/body/footer layout. | base-ui |
|
|
55
|
+
| [Spinner](components/Spinner.md) | Indeterminate loading indicator that inherits the text color. | custom |
|
|
56
|
+
| [Switch](components/Switch.md) | On/off toggle for settings that apply immediately. | base-ui |
|
|
57
|
+
| [TextField](components/TextField.md) | Labelled text input with description, error and adornments; native + custom validation. | base-ui |
|
|
58
|
+
| [Tooltip](components/Tooltip.md) | Short hint on hover and keyboard focus, for icon buttons and truncated text. | base-ui |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Design tokens (@gebeta/tokens)
|
|
2
|
+
|
|
3
|
+
Use these instead of raw values. All are CSS variables available once `@gebeta/ui/styles.css` is imported.
|
|
4
|
+
Light/dark switch automatically. Tailwind v4: `--gb-color-fg-muted` → `text-gb-fg-muted`, `--gb-shadow-card` → `shadow-gb-card`, `--gb-radius-lg` → `rounded-gb-lg`.
|
|
5
|
+
|
|
6
|
+
Text contrast: `fg` > `fg-soft` > `fg-muted` are fine for text. `fg-subtle` is for icons/placeholders only.
|
|
7
|
+
Amber `primary` is for the main action only — don't use it for decoration.
|
|
8
|
+
|
|
9
|
+
## Colors
|
|
10
|
+
|
|
11
|
+
**Text & surfaces:** `--gb-color-bg` `--gb-color-fg` `--gb-color-fg-soft` `--gb-color-fg-muted` `--gb-color-fg-subtle` `--gb-color-surface` `--gb-color-surface-muted` `--gb-color-popover` `--gb-color-raised` `--gb-color-raised-hover` `--gb-color-hover` `--gb-color-border` `--gb-color-border-strong` `--gb-color-ring` `--gb-color-track` `--gb-color-overlay`
|
|
12
|
+
|
|
13
|
+
**Actions:** `--gb-color-primary` `--gb-color-primary-hover` `--gb-color-primary-fg` `--gb-color-ink` `--gb-color-ink-hover` `--gb-color-ink-fg` `--gb-color-secondary` `--gb-color-secondary-fg`
|
|
14
|
+
|
|
15
|
+
**Status:** `--gb-color-danger` `--gb-color-danger-subtle` `--gb-color-danger-fg` `--gb-color-success` `--gb-color-warning`
|
|
16
|
+
|
|
17
|
+
**Tag hues (bg / border / fg):** `--gb-color-tag-blue-bg` `--gb-color-tag-blue-border` `--gb-color-tag-blue-fg` `--gb-color-tag-purple-bg` `--gb-color-tag-purple-border` `--gb-color-tag-purple-fg` `--gb-color-tag-green-bg` `--gb-color-tag-green-border` `--gb-color-tag-green-fg` `--gb-color-tag-red-bg` `--gb-color-tag-red-border` `--gb-color-tag-red-fg` `--gb-color-tag-orange-bg` `--gb-color-tag-orange-border` `--gb-color-tag-orange-fg` `--gb-color-tag-amber-bg` `--gb-color-tag-amber-border` `--gb-color-tag-amber-fg` `--gb-color-tag-teal-bg` `--gb-color-tag-teal-border` `--gb-color-tag-teal-fg` `--gb-color-tag-yellow-bg` `--gb-color-tag-yellow-border` `--gb-color-tag-yellow-fg` `--gb-color-tag-neutral-bg` `--gb-color-tag-neutral-border` `--gb-color-tag-neutral-fg`
|
|
18
|
+
|
|
19
|
+
## Shadows
|
|
20
|
+
|
|
21
|
+
`--gb-shadow-sm` `--gb-shadow-overlay` `--gb-shadow-btn-primary` `--gb-shadow-btn-ink` `--gb-shadow-btn` `--gb-shadow-btn-subtle` `--gb-shadow-card` `--gb-shadow-badge`
|
|
22
|
+
|
|
23
|
+
## Spacing (4px grid: space-4 = 16px)
|
|
24
|
+
|
|
25
|
+
`--gb-space-0` `--gb-space-1` `--gb-space-2` `--gb-space-3` `--gb-space-4` `--gb-space-5` `--gb-space-6` `--gb-space-8` `--gb-space-10` `--gb-space-12` `--gb-space-16` `--gb-space-0_5` `--gb-space-1_5` `--gb-space-2_5`
|
|
26
|
+
|
|
27
|
+
## Radius
|
|
28
|
+
|
|
29
|
+
`--gb-radius-none` `--gb-radius-sm` `--gb-radius-md` `--gb-radius-lg` `--gb-radius-xl` `--gb-radius-full`
|
|
30
|
+
|
|
31
|
+
## Text sizes
|
|
32
|
+
|
|
33
|
+
`--gb-text-xs` (0.75rem) `--gb-text-sm` (0.875rem) `--gb-text-md` (0.9375rem) `--gb-text-lg` (1rem) `--gb-text-xl` (1.25rem) `--gb-text-2xl` (1.5rem)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @gebeta/ui public API.
|
|
3
|
+
*
|
|
4
|
+
* Rule: anything not exported here is private and may change in any release.
|
|
5
|
+
* Adding an export = minor bump. Removing/renaming one = major bump.
|
|
6
|
+
*/
|
|
7
|
+
import './styles/index.css';
|
|
8
|
+
export * from './components/Button';
|
|
9
|
+
export * from './components/TextField';
|
|
10
|
+
export * from './components/Checkbox';
|
|
11
|
+
export * from './components/Switch';
|
|
12
|
+
export * from './components/Dialog';
|
|
13
|
+
export * from './components/Tooltip';
|
|
14
|
+
export * from './components/Spinner';
|
|
15
|
+
export * from './components/Badge';
|
|
16
|
+
export { cx } from './utils/class-names';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,oBAAoB,CAAC;AAG5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { cx as e } from "./utils/class-names.js";
|
|
4
|
+
import { Spinner as t } from "./components/Spinner/Spinner.js";
|
|
5
|
+
import { Button as n } from "./components/Button/Button.js";
|
|
6
|
+
import { TextField as r } from "./components/TextField/TextField.js";
|
|
7
|
+
import { Checkbox as i } from "./components/Checkbox/Checkbox.js";
|
|
8
|
+
import { Switch as a } from "./components/Switch/Switch.js";
|
|
9
|
+
import { Dialog as o } from "./components/Dialog/Dialog.js";
|
|
10
|
+
import { Tooltip as s, TooltipProvider as c } from "./components/Tooltip/Tooltip.js";
|
|
11
|
+
import { Badge as l } from "./components/Badge/Badge.js";
|
|
12
|
+
export { l as Badge, n as Button, i as Checkbox, o as Dialog, t as Spinner, a as Switch, r as TextField, s as Tooltip, c as TooltipProvider, e as cx };
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer gebeta.base{.gb-root{isolation:isolate}}@layer gebeta.components{.gb-spinner{color:currentColor;inline-size:var(--size);block-size:var(--size);flex-shrink:0;display:inline-flex}.gb-spinner[data-size=sm]{--size:1rem}.gb-spinner[data-size=md]{--size:1.5rem}.gb-spinner[data-size=lg]{--size:2.25rem}.gb-spinner-svg{block-size:100%;inline-size:100%;animation:.7s linear infinite gb-spinner-spin}.gb-spinner-track{stroke:currentColor;opacity:.2}.gb-spinner-arc{stroke:currentColor}.gb-spinner-label{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;margin:-1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.gb-spinner-svg{animation-duration:2s}}@keyframes gb-spinner-spin{to{transform:rotate(360deg)}}.gb-button{--bg:transparent;--bg-hover:var(--bg);--fg:var(--gb-color-fg);--fg-hover:var(--fg);--shadow:none;--icon:.875rem;box-sizing:border-box;justify-content:center;align-items:center;gap:var(--gb-space-1_5);padding:var(--pad-y) var(--pad-x);border-radius:var(--gb-radius-full);background:var(--bg);color:var(--fg);box-shadow:var(--shadow);font-family:var(--gb-font-sans);font-size:var(--font-size);font-weight:var(--gb-weight-medium);line-height:var(--gb-leading-none);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition-property:background-color,color,box-shadow;transition-duration:var(--gb-duration-fast);transition-timing-function:var(--gb-ease-standard);border:0;outline:none;flex-shrink:0;margin:0;text-decoration:none;display:inline-flex}.gb-button svg{inline-size:var(--icon);block-size:var(--icon);flex-shrink:0}@media (hover:hover){.gb-button:hover:not([data-disabled]){background:var(--bg-hover);color:var(--fg-hover)}}.gb-button:focus-visible{outline:2px solid color-mix(in srgb, var(--gb-color-ring) 60%, transparent);outline-offset:1px}.gb-button[data-disabled]{cursor:not-allowed;opacity:.5}.gb-button[data-loading]{cursor:progress;opacity:1}.gb-button[data-full-width]{inline-size:100%}.gb-button[data-size=sm]{--pad-y:.5625rem;--pad-x:.5625rem;--font-size:var(--gb-text-xs)}.gb-button[data-size=md]{--pad-y:var(--gb-space-2);--pad-x:var(--gb-space-3);--font-size:var(--gb-text-sm)}.gb-button[data-size=lg]{--pad-y:var(--gb-space-2_5);--pad-x:var(--gb-space-4);--font-size:var(--gb-text-sm)}.gb-button[data-size=xl]{--pad-y:var(--gb-space-3);--pad-x:var(--gb-space-5);--font-size:var(--gb-text-md);--icon:1rem}.gb-button[data-size=icon],.gb-button[data-size=icon-sm]{--pad-y:0;--pad-x:0;--font-size:var(--gb-text-sm);inline-size:var(--box);block-size:var(--box)}.gb-button[data-size=icon]{--box:1.875rem}.gb-button[data-size=icon-sm]{--box:1.5rem}.gb-button[data-variant=primary]{--bg:var(--gb-color-primary);--bg-hover:var(--gb-color-primary-hover);--fg:var(--gb-color-primary-fg);--shadow:var(--gb-shadow-btn-primary)}.gb-button[data-variant=secondary],.gb-button[data-variant=outline]{--bg:var(--gb-color-secondary);--bg-hover:var(--gb-color-surface-muted);--fg:var(--gb-color-secondary-fg);--shadow:var(--gb-shadow-btn)}.gb-button[data-variant=ink]{--bg:var(--gb-color-ink);--bg-hover:var(--gb-color-ink-hover);--fg:var(--gb-color-ink-fg);--shadow:var(--gb-shadow-btn-ink)}.gb-button[data-variant=muted]{--bg:var(--gb-color-surface-muted);--bg-hover:var(--gb-color-raised-hover);--shadow:var(--gb-shadow-btn)}.gb-button[data-variant=subtle]{--bg:var(--gb-color-raised);--bg-hover:var(--gb-color-surface-muted);--shadow:var(--gb-shadow-btn-subtle)}.gb-button[data-variant=danger]{--bg:var(--gb-color-secondary);--bg-hover:var(--gb-color-danger-subtle);--fg:var(--gb-color-danger);--shadow:var(--gb-shadow-btn)}.gb-button[data-variant=ghost]{--bg-hover:var(--gb-color-hover);--fg:var(--gb-color-fg-muted);--fg-hover:var(--gb-color-fg)}.gb-button[data-variant=link]{--pad-x:0;--pad-y:0;--fg-hover:var(--gb-color-fg-soft);text-underline-offset:2px;border-radius:0;text-decoration:underline;text-decoration-thickness:from-font}.gb-button-label{align-items:center;display:inline-flex}.gb-text-field{gap:var(--gb-space-2);font-family:var(--gb-font-sans);flex-direction:column;display:flex}.gb-text-field[data-size=sm]{--height:2rem}.gb-text-field[data-size=md]{--height:2.25rem}.gb-text-field[data-size=lg]{--height:2.5rem}.gb-text-field-label{font-size:var(--gb-text-xs);line-height:var(--gb-leading-none);color:var(--gb-color-fg-soft);-webkit-user-select:none;user-select:none}.gb-text-field-required{color:var(--gb-color-fg-subtle)}.gb-text-field-control{box-sizing:border-box;align-items:center;gap:var(--gb-space-2);block-size:var(--height);padding-inline:var(--gb-space-3);border:1px solid var(--gb-color-border-strong);border-radius:var(--gb-radius-lg);background:var(--gb-color-secondary);transition:border-color var(--gb-duration-fast) var(--gb-ease-standard);display:flex}.gb-text-field-control:has(.gb-text-field-input:focus-visible){border-color:var(--gb-color-ring)}.gb-text-field-control:has(.gb-text-field-input[data-invalid]){border-color:var(--gb-color-danger)}.gb-text-field-control:has(.gb-text-field-input[data-disabled]){cursor:not-allowed;opacity:.5}.gb-text-field-input{block-size:100%;min-inline-size:0;color:var(--gb-color-fg);font:inherit;font-size:var(--gb-text-sm);line-height:var(--gb-leading-none);background:0 0;border:0;outline:0;flex:1;padding:0}.gb-text-field-input::placeholder{color:var(--gb-color-fg-subtle)}.gb-text-field-input[data-disabled]{cursor:not-allowed}.gb-text-field-adornment{color:var(--gb-color-fg-muted);font-size:var(--gb-text-sm);display:inline-flex}.gb-text-field-adornment svg{block-size:.875rem;inline-size:.875rem;color:var(--gb-color-fg-subtle)}.gb-text-field-description{font-size:var(--gb-text-xs);color:var(--gb-color-fg-muted);margin:0;line-height:1.3}.gb-text-field-error{font-size:var(--gb-text-xs);color:var(--gb-color-danger);line-height:1.3}.gb-checkbox{align-items:flex-start;gap:var(--gb-space-2);font-family:var(--gb-font-sans);cursor:pointer;display:inline-flex}.gb-checkbox[data-disabled]{cursor:not-allowed;opacity:.5}.gb-checkbox-box{box-sizing:border-box;border:1px solid var(--gb-color-border-strong);border-radius:var(--gb-radius-sm);background:var(--gb-color-secondary);block-size:1rem;inline-size:1rem;color:var(--gb-color-primary-fg);cursor:pointer;transition-property:background-color,border-color;transition-duration:var(--gb-duration-fast);transition-timing-function:var(--gb-ease-standard);outline:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.gb-checkbox-box:hover:not([data-disabled]){border-color:var(--gb-color-ring)}.gb-checkbox-box[data-checked],.gb-checkbox-box[data-indeterminate]{border-color:var(--gb-color-primary);background:var(--gb-color-primary)}.gb-checkbox-box:focus-visible{outline:2px solid color-mix(in srgb, var(--gb-color-ring) 60%, transparent);outline-offset:1px}.gb-checkbox-box[data-invalid]{border-color:var(--gb-color-danger)}.gb-checkbox-box[data-disabled]{cursor:not-allowed}.gb-checkbox-indicator{display:flex}.gb-checkbox-indicator svg{block-size:.75rem;inline-size:.75rem}.gb-checkbox-text{gap:var(--gb-space-1);display:grid}.gb-checkbox-label{font-size:var(--gb-text-sm);line-height:var(--gb-leading-none);color:var(--gb-color-fg)}.gb-checkbox-description{font-size:var(--gb-text-xs);color:var(--gb-color-fg-muted);line-height:1.3}.gb-switch{align-items:center;gap:var(--gb-space-2);font-family:var(--gb-font-sans);cursor:pointer;display:inline-flex}.gb-switch[data-disabled]{cursor:not-allowed;opacity:.5}.gb-switch-track{--pad:.125rem;box-sizing:border-box;inline-size:var(--w);block-size:var(--h);padding:var(--pad);border-radius:var(--gb-radius-full);background:var(--gb-color-track);box-shadow:var(--gb-shadow-btn);cursor:inherit;transition:background-color var(--gb-duration-fast) var(--gb-ease-standard);border:0;outline:none;flex-shrink:0;align-items:center;display:inline-flex}.gb-switch-track[data-size=sm]{--w:1.625rem;--h:.875rem}.gb-switch-track[data-size=md]{--w:2rem;--h:1.125rem}.gb-switch-track[data-checked]{background:var(--gb-color-primary)}.gb-switch-track:focus-visible{outline:2px solid color-mix(in srgb, var(--gb-color-ring) 60%, transparent);outline-offset:1px}.gb-switch-thumb{--thumb:calc(var(--h) - var(--pad) * 2);inline-size:var(--thumb);block-size:var(--thumb);border-radius:var(--gb-radius-full);box-shadow:var(--gb-shadow-btn);pointer-events:none;transition:translate var(--gb-duration-fast) var(--gb-ease-standard);background:#fff;display:block}.gb-switch-thumb[data-checked]{translate:calc(var(--w) - var(--thumb) - var(--pad) * 2) 0}.gb-switch-label{font-size:var(--gb-text-sm);line-height:var(--gb-leading-none);color:var(--gb-color-fg)}@media (prefers-reduced-motion:reduce){.gb-switch-track,.gb-switch-thumb{transition:none}}.gb-dialog-backdrop{z-index:var(--gb-z-overlay);background:var(--gb-color-overlay);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transition:opacity var(--gb-duration-normal) var(--gb-ease-standard);position:fixed;inset:0}.gb-dialog-backdrop[data-starting-style],.gb-dialog-backdrop[data-ending-style]{opacity:0}.gb-dialog-backdrop[data-ending-style]{transition-duration:.2s;transition-timing-function:var(--gb-ease-in)}.gb-dialog-popup{box-sizing:border-box;z-index:var(--gb-z-modal);inline-size:calc(100% - 2rem);max-inline-size:var(--width);border:1px solid var(--gb-color-border-strong);border-radius:var(--gb-radius-xl);background:var(--gb-color-popover);max-block-size:calc(100dvh - 2rem);color:var(--gb-color-fg);box-shadow:var(--gb-shadow-overlay);font-family:var(--gb-font-sans);transition-property:opacity,scale;transition-duration:var(--gb-duration-normal);transition-timing-function:var(--gb-ease-standard);outline:none;flex-direction:column;display:flex;position:fixed;inset-block-start:50%;inset-inline-start:50%;overflow-y:auto;translate:-50% -50%}.gb-dialog-popup[data-size=sm]{--width:25rem}.gb-dialog-popup[data-size=md]{--width:30rem}.gb-dialog-popup[data-size=lg]{--width:40rem}.gb-dialog-popup[data-starting-style],.gb-dialog-popup[data-ending-style]{opacity:0;scale:.95}.gb-dialog-popup[data-ending-style]{transition-duration:.2s;transition-timing-function:var(--gb-ease-in)}.gb-dialog-header{gap:var(--gb-space-2);padding:var(--gb-space-6) var(--gb-space-12) 0 var(--gb-space-6);flex-direction:column;display:flex}.gb-dialog-body{gap:var(--gb-space-4);padding:var(--gb-space-5) var(--gb-space-6) 0;flex-direction:column;display:flex}.gb-dialog-footer{justify-content:flex-end;align-items:center;gap:var(--gb-space-2);padding:var(--gb-space-6);flex-wrap:wrap;display:flex}.gb-dialog-title{font-size:var(--gb-text-lg);font-weight:var(--gb-weight-semibold);line-height:var(--gb-leading-none);margin:0}.gb-dialog-description{font-size:var(--gb-text-xs);line-height:var(--gb-leading-snug);color:var(--gb-color-fg-soft);margin:0}.gb-dialog-close{position:absolute;inset-block-start:var(--gb-space-4);inset-inline-end:var(--gb-space-4)}@media (prefers-reduced-motion:reduce){.gb-dialog-backdrop,.gb-dialog-popup{transition:none}}.gb-tooltip-positioner{z-index:var(--gb-z-tooltip)}.gb-tooltip-popup{box-sizing:border-box;max-inline-size:18rem;padding:var(--gb-space-1_5) var(--gb-space-2);border-radius:var(--gb-radius-md);background:var(--gb-color-ink);color:var(--gb-color-ink-fg);box-shadow:var(--gb-shadow-overlay);font-family:var(--gb-font-sans);font-size:var(--gb-text-xs);line-height:var(--gb-leading-snug);transform-origin:var(--transform-origin);transition-property:opacity,scale;transition-duration:var(--gb-duration-fast);transition-timing-function:var(--gb-ease-standard)}.gb-tooltip-popup[data-starting-style],.gb-tooltip-popup[data-ending-style]{opacity:0;scale:.96}.gb-tooltip-popup[data-instant]{transition-duration:0s}.gb-tooltip-arrow{background:var(--gb-color-ink);clip-path:polygon(0 0,100% 0,50% 100%);block-size:5px;inline-size:10px}.gb-tooltip-arrow[data-side=top]{inset-block-end:-5px}.gb-tooltip-arrow[data-side=bottom]{inset-block-start:-5px;rotate:180deg}.gb-tooltip-arrow[data-side=left]{inset-inline-end:-7px;rotate:-90deg}.gb-tooltip-arrow[data-side=right]{inset-inline-start:-7px;rotate:90deg}.gb-badge{box-sizing:border-box;justify-content:center;align-items:center;gap:var(--gb-space-1);border:1px solid var(--border);border-radius:var(--gb-radius-full);background:var(--bg);block-size:1.375rem;color:var(--fg);font-family:var(--gb-font-sans);font-size:var(--gb-text-xs);font-weight:var(--gb-weight-regular);line-height:var(--gb-leading-none);white-space:nowrap;flex-shrink:0;display:inline-flex}.gb-badge svg{flex-shrink:0;block-size:.75rem;inline-size:.75rem}.gb-badge[data-size=sm]{padding-inline:var(--gb-space-1_5)}.gb-badge[data-size=md]{padding-inline:var(--gb-space-2)}.gb-badge[data-tone=neutral]{--bg:var(--gb-color-tag-neutral-bg);--border:var(--gb-color-tag-neutral-border);--fg:var(--gb-color-tag-neutral-fg)}.gb-badge[data-tone=blue],.gb-badge[data-tone=info]{--bg:var(--gb-color-tag-blue-bg);--border:var(--gb-color-tag-blue-border);--fg:var(--gb-color-tag-blue-fg)}.gb-badge[data-tone=purple]{--bg:var(--gb-color-tag-purple-bg);--border:var(--gb-color-tag-purple-border);--fg:var(--gb-color-tag-purple-fg)}.gb-badge[data-tone=green],.gb-badge[data-tone=success]{--bg:var(--gb-color-tag-green-bg);--border:var(--gb-color-tag-green-border);--fg:var(--gb-color-tag-green-fg)}.gb-badge[data-tone=red],.gb-badge[data-tone=danger]{--bg:var(--gb-color-tag-red-bg);--border:var(--gb-color-tag-red-border);--fg:var(--gb-color-tag-red-fg)}.gb-badge[data-tone=orange]{--bg:var(--gb-color-tag-orange-bg);--border:var(--gb-color-tag-orange-border);--fg:var(--gb-color-tag-orange-fg)}.gb-badge[data-tone=amber],.gb-badge[data-tone=warning]{--bg:var(--gb-color-tag-amber-bg);--border:var(--gb-color-tag-amber-border);--fg:var(--gb-color-tag-amber-fg)}.gb-badge[data-tone=teal]{--bg:var(--gb-color-tag-teal-bg);--border:var(--gb-color-tag-teal-border);--fg:var(--gb-color-tag-teal-fg)}.gb-badge[data-tone=yellow]{--bg:var(--gb-color-tag-yellow-bg);--border:var(--gb-color-tag-yellow-border);--fg:var(--gb-color-tag-yellow-fg)}.gb-badge[data-tone=primary]{--bg:var(--gb-color-primary);--border:var(--gb-color-primary);--fg:var(--gb-color-primary-fg)}a.gb-badge:hover{text-decoration:underline}.gb-badge-dot{border-radius:var(--gb-radius-full);background:currentColor;block-size:.375rem;inline-size:.375rem}}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--gb-space-0:0;--gb-space-1:.25rem;--gb-space-2:.5rem;--gb-space-3:.75rem;--gb-space-4:1rem;--gb-space-5:1.25rem;--gb-space-6:1.5rem;--gb-space-8:2rem;--gb-space-10:2.5rem;--gb-space-12:3rem;--gb-space-16:4rem;--gb-space-0_5:.125rem;--gb-space-1_5:.375rem;--gb-space-2_5:.625rem;--gb-radius-none:0;--gb-radius-sm:.25rem;--gb-radius-md:.375rem;--gb-radius-lg:.5rem;--gb-radius-xl:.75rem;--gb-radius-full:9999px;--gb-font-sans:var(--font-geist-sans,"Geist"), "Noto Sans Ethiopic", ui-sans-serif, system-ui, sans-serif;--gb-font-mono:var(--font-geist-mono,"Geist Mono"), ui-monospace, SFMono-Regular, Menlo, monospace;--gb-text-xs:.75rem;--gb-text-sm:.875rem;--gb-text-md:.9375rem;--gb-text-lg:1rem;--gb-text-xl:1.25rem;--gb-text-2xl:1.5rem;--gb-weight-regular:400;--gb-weight-medium:500;--gb-weight-semibold:600;--gb-weight-bold:700;--gb-leading-none:1;--gb-leading-tight:1.25;--gb-leading-snug:1.4;--gb-leading-normal:1.5;--gb-duration-fast:.15s;--gb-duration-normal:.25s;--gb-duration-slow:.35s;--gb-ease-standard:cubic-bezier(.25, 1, .5, 1);--gb-ease-in:cubic-bezier(.5, 0, .75, 0);--gb-ease-in-out:cubic-bezier(.7, 0, 0, 1);--gb-ease-emphasized:cubic-bezier(.3, 0, 0, 1.3);--gb-z-dropdown:1000;--gb-z-overlay:1100;--gb-z-modal:1200;--gb-z-popover:1300;--gb-z-tooltip:1400;--gb-z-toast:1500;--gb-color-bg:#fbfbfb;--gb-color-fg:#161616;--gb-color-fg-soft:#525252;--gb-color-fg-muted:#6b6b6b;--gb-color-fg-subtle:#8a8a8a;--gb-color-surface:#fff;--gb-color-surface-muted:#f1f1f1;--gb-color-popover:#fff;--gb-color-raised:#f4f4f4;--gb-color-raised-hover:#ebebeb;--gb-color-hover:#0000000a;--gb-color-border:#ececec;--gb-color-border-strong:#dcdcdc;--gb-color-ring:#a3a3a3;--gb-color-track:#e5e5e5;--gb-color-overlay:#0009;--gb-color-primary:#ffa600;--gb-color-primary-hover:#ffa600e6;--gb-color-primary-fg:#1a1206;--gb-color-ink:#191715;--gb-color-ink-hover:#191715d9;--gb-color-ink-fg:#fbfaf9;--gb-color-secondary:#fff;--gb-color-secondary-fg:#161616;--gb-color-danger:#dc2626;--gb-color-danger-subtle:#dc26261a;--gb-color-danger-fg:#fff;--gb-color-success:#16a34a;--gb-color-warning:#d97606;--gb-color-tag-blue-bg:#eff6ff;--gb-color-tag-blue-border:#bfdbfe;--gb-color-tag-blue-fg:#1d4ed8;--gb-color-tag-purple-bg:#f5f3ff;--gb-color-tag-purple-border:#ddd6fe;--gb-color-tag-purple-fg:#6d28d9;--gb-color-tag-green-bg:#f0fdf4;--gb-color-tag-green-border:#bbf7d0;--gb-color-tag-green-fg:#15803d;--gb-color-tag-red-bg:#fef2f2;--gb-color-tag-red-border:#fecaca;--gb-color-tag-red-fg:#b91c1c;--gb-color-tag-orange-bg:#fff7ed;--gb-color-tag-orange-border:#fed7aa;--gb-color-tag-orange-fg:#c2410c;--gb-color-tag-amber-bg:#fffbeb;--gb-color-tag-amber-border:#fde68a;--gb-color-tag-amber-fg:#b45309;--gb-color-tag-teal-bg:#f0fdfa;--gb-color-tag-teal-border:#99f6e4;--gb-color-tag-teal-fg:#0f766e;--gb-color-tag-yellow-bg:#fefce8;--gb-color-tag-yellow-border:#fef08a;--gb-color-tag-yellow-fg:#a16207;--gb-color-tag-neutral-bg:#f4f4f4;--gb-color-tag-neutral-border:#e2e2e2;--gb-color-tag-neutral-fg:#3d3d3d;--gb-shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--gb-shadow-overlay:0 16px 40px 0 #0000001f, 0 0 0 1px #00000014;--gb-shadow-btn-primary:0 1px 2px 0 #96460038, 0 0 0 1px #e58a00, inset 0 1px 0 0 #ffffff80, inset 0 0 0 1px #ffffff1f, inset 0 -6px 12px 0 #d6640038;--gb-shadow-btn-ink:0 1px 2px 0 #0003, 0 0 0 1px #191715, inset 0 1px 0 0 #ffffff24;--gb-shadow-btn:0 1px 2px 0 #0000000d, 0 0 0 1px #0000001a, inset 0 1px 0 0 #fffc;--gb-shadow-btn-subtle:0 0 0 1px #e2e2e2;--gb-shadow-card:0 1px 2px 0 #0000000a, 0 0 0 1px #00000012;--gb-shadow-badge:0 0 0 .5px #d4d4d4}.dark,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--gb-color-bg:#161616;--gb-color-fg:#f9fbff;--gb-color-fg-soft:#a4a4a4;--gb-color-fg-muted:#999;--gb-color-fg-subtle:#676767;--gb-color-surface:#1b1d20;--gb-color-surface-muted:#2a2a2a;--gb-color-popover:#161616;--gb-color-raised:#232323;--gb-color-raised-hover:#333;--gb-color-hover:#ffffff0f;--gb-color-border:#232323;--gb-color-border-strong:#393939;--gb-color-ring:#676767;--gb-color-track:#3a3a3a;--gb-color-overlay:#0009;--gb-color-primary:#ffa600;--gb-color-primary-hover:#ffa600e6;--gb-color-primary-fg:#1a1206;--gb-color-ink:#f7f5f3;--gb-color-ink-hover:#f7f5f3d9;--gb-color-ink-fg:#191715;--gb-color-secondary:#1e1e1e;--gb-color-secondary-fg:#f9fbff;--gb-color-danger:#f97373;--gb-color-danger-subtle:#f973731a;--gb-color-danger-fg:#161616;--gb-color-success:#22c55e;--gb-color-warning:#fbbe24;--gb-color-tag-blue-bg:#1d2b3e;--gb-color-tag-blue-border:#23354c;--gb-color-tag-blue-fg:#bfdbfe;--gb-color-tag-purple-bg:#231f3a;--gb-color-tag-purple-border:#4b437b;--gb-color-tag-purple-fg:#b7aee9;--gb-color-tag-green-bg:#1f3a2d;--gb-color-tag-green-border:#275137;--gb-color-tag-green-fg:#b1ebc5;--gb-color-tag-red-bg:#3e1d1e;--gb-color-tag-red-border:#4c2324;--gb-color-tag-red-fg:#febfc6;--gb-color-tag-orange-bg:#3e291d;--gb-color-tag-orange-border:#764d35;--gb-color-tag-orange-fg:#eeb390;--gb-color-tag-amber-bg:#31221b;--gb-color-tag-amber-border:#6c4830;--gb-color-tag-amber-fg:#fed7aa;--gb-color-tag-teal-bg:#102a27;--gb-color-tag-teal-border:#3b6149;--gb-color-tag-teal-fg:#22c55e;--gb-color-tag-yellow-bg:#33301a;--gb-color-tag-yellow-border:#5a5228;--gb-color-tag-yellow-fg:#fde68a;--gb-color-tag-neutral-bg:#2a2a2a;--gb-color-tag-neutral-border:#363636;--gb-color-tag-neutral-fg:#cfcfcf;--gb-shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--gb-shadow-overlay:0 16px 40px 0 #00000080, 0 0 0 1px #0e0e0e;--gb-shadow-btn-primary:0 4px 4px 0 #00000052, 0 0 0 1px #0e0e0e, inset 0 1px 0 0 #fff6, inset 0 0 0 1px #ffffff1f, inset 0 -8px 14px 0 #c85a0047;--gb-shadow-btn-ink:0 1px 2px 0 #00000052, 0 0 0 1px #ffffffe6, inset 0 -2px 4px 0 #0000000f;--gb-shadow-btn:0 0 0 1px #0006, inset 0 1px 0 0 #ffffff1a, inset 0 0 0 1px #ffffff0f;--gb-shadow-btn-subtle:0 0 0 1px #333;--gb-shadow-card:0 4px 4px 0 #2a2a2a52, 0 0 0 1px #0e0e0e, inset 0 1px 0 0 #ffffff14, inset 0 0 0 1px #ffffff14;--gb-shadow-badge:0 0 0 .5px #0e0e0e}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
export declare const cx: (...inputs: ClassValue[]) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Base UI lets `className` be a string OR a function of component state.
|
|
5
|
+
* This merges our base class with whatever the consumer passed, in either form.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withBaseClass<State>(base: string | undefined, className: string | ((state: State) => string | undefined) | undefined): string | ((state: State) => string);
|
|
8
|
+
//# sourceMappingURL=class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-names.d.ts","sourceRoot":"","sources":["../../src/utils/class-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,WAAiB,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EACjC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,GACrE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,CAKrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { clsx as e } from "clsx";
|
|
3
|
+
// src/utils/class-names.ts
|
|
4
|
+
var t = (...t) => e(t);
|
|
5
|
+
function n(e, n) {
|
|
6
|
+
return typeof n == "function" ? (r) => t(e, n(r)) : t(e, n);
|
|
7
|
+
}
|
|
8
|
+
export { t as cx, n as withBaseClass };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=class-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-names.js","names":["cx","inputs","clsx","withBaseClass","className","base","state"],"sources":["../../src/utils/class-names.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\n\nexport const cx = (...inputs: ClassValue[]) => clsx(inputs);\n\n/**\n * Base UI lets `className` be a string OR a function of component state.\n * This merges our base class with whatever the consumer passed, in either form.\n */\nexport function withBaseClass<State>(\n base: string | undefined,\n className: string | ((state: State) => string | undefined) | undefined,\n): string | ((state: State) => string) {\n if (typeof className === 'function') {\n return (state: State) => cx(base, className(state));\n }\n return cx(base, className);\n}\n"],"mappings":";;;AAEA,IAAaA,KAAM,GAAGC,MAAyBC,EAAKD,CAAM;AAM1D,SAAgBE,EACd,GACA,GACqC;CAIrC,OAHI,OAAOC,KAAc,cACf,MAAiBJ,EAAGK,GAAMD,EAAUE,CAAK,CAAC,IAE7CN,EAAGK,GAAMD,CAAS;AAC3B"}
|