base-themes 0.1.2 → 0.1.3
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/CHANGELOG.md +25 -0
- package/CODE_OF_CONDUCT.md +22 -0
- package/CONTRIBUTING.md +98 -0
- package/LICENSE +21 -0
- package/README.md +316 -3
- package/RELEASE.md +80 -0
- package/SECURITY.md +49 -0
- package/bin/base-themes.mjs +143 -0
- package/dist/base-themes.css +1 -1
- package/dist/base-themes.js +857 -302
- package/dist/llms-full.txt +288 -0
- package/dist/llms.txt +79 -0
- package/dist/types/blocks/AuthCard.d.ts +2 -0
- package/dist/types/blocks/CommandPaletteBlock.d.ts +2 -0
- package/dist/types/blocks/DashboardShell.d.ts +2 -0
- package/dist/types/blocks/DataTableBlock.d.ts +2 -0
- package/dist/types/blocks/PricingPanel.d.ts +2 -0
- package/dist/types/blocks/SettingsForm.d.ts +2 -0
- package/dist/types/blocks/TeamActivityFeed.d.ts +2 -0
- package/dist/types/blocks/ThemeShowcaseCard.d.ts +2 -0
- package/dist/types/blocks/index.d.ts +8 -0
- package/dist/types/components/ui/Input.d.ts +3 -0
- package/dist/types/components/ui/index.d.ts +1 -1
- package/dist/types/lib.d.ts +1 -0
- package/docs/adoption-dashboard.md +149 -0
- package/docs/analytics-setup.md +145 -0
- package/docs/community-gallery-proposal.md +64 -0
- package/docs/community-proof-telemetry.md +47 -0
- package/docs/contributor-issue-seeds.md +240 -0
- package/docs/registry-access-telemetry.md +87 -0
- package/docs/release-announcement-kit.md +229 -0
- package/docs/search-console-setup.md +111 -0
- package/docs/theme-token-contract.md +113 -0
- package/examples/dashboard/README.md +24 -0
- package/examples/dashboard/index.html +12 -0
- package/examples/dashboard/package-lock.json +1212 -0
- package/examples/dashboard/package.json +24 -0
- package/examples/dashboard/src/App.tsx +115 -0
- package/examples/dashboard/src/main.tsx +11 -0
- package/examples/dashboard/src/styles.css +129 -0
- package/examples/dashboard/src/vite-env.d.ts +4 -0
- package/examples/dashboard/tsconfig.app.json +23 -0
- package/examples/dashboard/tsconfig.json +7 -0
- package/examples/dashboard/tsconfig.node.json +15 -0
- package/examples/dashboard/vite.config.ts +6 -0
- package/examples/next/README.md +29 -0
- package/examples/next/app/base-themes-demo.tsx +70 -0
- package/examples/next/app/layout.tsx +16 -0
- package/examples/next/app/page.tsx +9 -0
- package/examples/next/app/styles.css +106 -0
- package/examples/next/next-env.d.ts +6 -0
- package/examples/next/next.config.ts +5 -0
- package/examples/next/package-lock.json +1199 -0
- package/examples/next/package.json +27 -0
- package/examples/next/tsconfig.json +36 -0
- package/examples/registry-copy/README.md +73 -0
- package/examples/registry-copy/plan-copy.mjs +130 -0
- package/examples/theme-customization/README.md +26 -0
- package/examples/theme-customization/index.html +12 -0
- package/examples/theme-customization/package-lock.json +1212 -0
- package/examples/theme-customization/package.json +24 -0
- package/examples/theme-customization/src/App.tsx +138 -0
- package/examples/theme-customization/src/main.tsx +11 -0
- package/examples/theme-customization/src/styles.css +138 -0
- package/examples/theme-customization/src/vite-env.d.ts +4 -0
- package/examples/theme-customization/tsconfig.app.json +23 -0
- package/examples/theme-customization/tsconfig.json +7 -0
- package/examples/theme-customization/tsconfig.node.json +15 -0
- package/examples/theme-customization/vite.config.ts +6 -0
- package/examples/vite/README.md +32 -0
- package/examples/vite/index.html +12 -0
- package/examples/vite/package-lock.json +1200 -0
- package/examples/vite/package.json +24 -0
- package/examples/vite/src/App.tsx +101 -0
- package/examples/vite/src/main.tsx +11 -0
- package/examples/vite/src/styles.css +125 -0
- package/examples/vite/src/vite-env.d.ts +4 -0
- package/examples/vite/tsconfig.app.json +23 -0
- package/examples/vite/tsconfig.json +7 -0
- package/examples/vite/tsconfig.node.json +15 -0
- package/examples/vite/vite.config.ts +6 -0
- package/llms-full.txt +288 -0
- package/llms.txt +79 -0
- package/package.json +157 -14
- package/registry/items/accordion.json +101 -0
- package/registry/items/alert-dialog.json +107 -0
- package/registry/items/autocomplete.json +106 -0
- package/registry/items/avatar.json +101 -0
- package/registry/items/block-auth-card.json +105 -0
- package/registry/items/block-command-palette.json +99 -0
- package/registry/items/block-dashboard-shell.json +101 -0
- package/registry/items/block-data-table.json +99 -0
- package/registry/items/block-pricing-panel.json +99 -0
- package/registry/items/block-settings-form.json +107 -0
- package/registry/items/block-team-activity-feed.json +99 -0
- package/registry/items/block-theme-showcase-card.json +99 -0
- package/registry/items/button.json +102 -0
- package/registry/items/checkbox-group.json +106 -0
- package/registry/items/checkbox.json +102 -0
- package/registry/items/collapsible.json +101 -0
- package/registry/items/combobox.json +101 -0
- package/registry/items/context-menu.json +106 -0
- package/registry/items/csp-provider.json +96 -0
- package/registry/items/dialog.json +102 -0
- package/registry/items/direction-provider.json +101 -0
- package/registry/items/drawer.json +101 -0
- package/registry/items/field.json +101 -0
- package/registry/items/fieldset.json +101 -0
- package/registry/items/form.json +101 -0
- package/registry/items/input.json +102 -0
- package/registry/items/menu.json +101 -0
- package/registry/items/menubar.json +106 -0
- package/registry/items/meter.json +101 -0
- package/registry/items/navigation-menu.json +101 -0
- package/registry/items/number-field.json +101 -0
- package/registry/items/otp-field.json +101 -0
- package/registry/items/popover.json +102 -0
- package/registry/items/preview-card.json +101 -0
- package/registry/items/progress.json +101 -0
- package/registry/items/radio-group.json +102 -0
- package/registry/items/radio.json +101 -0
- package/registry/items/scroll-area.json +101 -0
- package/registry/items/select.json +102 -0
- package/registry/items/separator.json +101 -0
- package/registry/items/slider.json +102 -0
- package/registry/items/switch.json +102 -0
- package/registry/items/tabs.json +101 -0
- package/registry/items/theme-bauhaus.json +107 -0
- package/registry/items/theme-bento.json +107 -0
- package/registry/items/theme-calm.json +107 -0
- package/registry/items/theme-cyberpunk.json +108 -0
- package/registry/items/theme-data-dense.json +107 -0
- package/registry/items/theme-editorial.json +107 -0
- package/registry/items/theme-enterprise.json +108 -0
- package/registry/items/theme-fluent.json +107 -0
- package/registry/items/theme-glass.json +107 -0
- package/registry/items/theme-linear.json +107 -0
- package/registry/items/theme-luxury.json +107 -0
- package/registry/items/theme-material.json +107 -0
- package/registry/items/theme-minimal.json +107 -0
- package/registry/items/theme-mono.json +107 -0
- package/registry/items/theme-neo-brutalism.json +107 -0
- package/registry/items/theme-playful.json +107 -0
- package/registry/items/theme-retro.json +107 -0
- package/registry/items/theme-shadcn.json +107 -0
- package/registry/items/theme-soft-ui.json +107 -0
- package/registry/items/theme-terminal.json +107 -0
- package/registry/items/toast.json +106 -0
- package/registry/items/toggle-group.json +101 -0
- package/registry/items/toggle.json +101 -0
- package/registry/items/toolbar.json +101 -0
- package/registry/items/tooltip.json +102 -0
- package/registry/registry.json +564 -49
- package/registry/shadcn-registry.json +415 -0
- package/research/telemetry-fixtures/analytics-events.jsonl +9 -0
- package/research/telemetry-fixtures/bundle-report.json +44 -0
- package/research/telemetry-fixtures/community-proof.csv +5 -0
- package/research/telemetry-fixtures/registry-access.jsonl +10 -0
- package/research/telemetry-fixtures/search-console-export.csv +4 -0
- package/scripts/registry-plan.mjs +434 -0
- package/scripts/render-launch-actions.mjs +405 -0
- package/scripts/render-launch-status.mjs +373 -0
- package/scripts/render-release-announcement.mjs +329 -0
- package/scripts/verify-launch-readiness.mjs +415 -0
- package/scripts/verify-telemetry-fixtures.mjs +85 -0
- package/scripts/verify-telemetry-report.mjs +89 -0
- package/skills/base-themes/SKILL.md +151 -47
- package/src/blocks/AuthCard.tsx +29 -0
- package/src/blocks/Blocks.css +182 -0
- package/src/blocks/CommandPaletteBlock.tsx +32 -0
- package/src/blocks/DashboardShell.tsx +36 -0
- package/src/blocks/DataTableBlock.tsx +44 -0
- package/src/blocks/PricingPanel.tsx +28 -0
- package/src/blocks/SettingsForm.tsx +37 -0
- package/src/blocks/TeamActivityFeed.tsx +38 -0
- package/src/blocks/ThemeShowcaseCard.tsx +32 -0
- package/src/blocks/index.ts +8 -0
- package/src/components/ui/Accordion.css +42 -0
- package/src/components/ui/Accordion.tsx +41 -0
- package/src/components/ui/AlertDialog.css +40 -0
- package/src/components/ui/AlertDialog.tsx +52 -0
- package/src/components/ui/Autocomplete.css +3 -0
- package/src/components/ui/Autocomplete.tsx +50 -0
- package/src/components/ui/Avatar.css +45 -0
- package/src/components/ui/Avatar.tsx +36 -0
- package/src/components/ui/Button.css +79 -0
- package/src/components/ui/Button.tsx +20 -0
- package/src/components/ui/Checkbox.css +37 -0
- package/src/components/ui/Checkbox.tsx +32 -0
- package/src/components/ui/CheckboxGroup.tsx +21 -0
- package/src/components/ui/Collapsible.css +34 -0
- package/src/components/ui/Collapsible.tsx +29 -0
- package/src/components/ui/Combobox.css +75 -0
- package/src/components/ui/Combobox.tsx +53 -0
- package/src/components/ui/ContextMenu.css +9 -0
- package/src/components/ui/ContextMenu.tsx +47 -0
- package/src/components/ui/CspProvider.tsx +10 -0
- package/src/components/ui/Dialog.css +41 -0
- package/src/components/ui/Dialog.tsx +45 -0
- package/src/components/ui/DirectionProvider.tsx +17 -0
- package/src/components/ui/Drawer.css +77 -0
- package/src/components/ui/Drawer.tsx +56 -0
- package/src/components/ui/Field.css +19 -0
- package/src/components/ui/Field.tsx +24 -0
- package/src/components/ui/Fieldset.css +16 -0
- package/src/components/ui/Fieldset.tsx +19 -0
- package/src/components/ui/Form.css +5 -0
- package/src/components/ui/Form.tsx +12 -0
- package/src/components/ui/Input.css +50 -0
- package/src/components/ui/Input.tsx +62 -0
- package/src/components/ui/Menu.css +59 -0
- package/src/components/ui/Menu.tsx +50 -0
- package/src/components/ui/Menubar.css +26 -0
- package/src/components/ui/Menubar.tsx +42 -0
- package/src/components/ui/Meter.css +45 -0
- package/src/components/ui/Meter.tsx +37 -0
- package/src/components/ui/NavigationMenu.css +103 -0
- package/src/components/ui/NavigationMenu.tsx +64 -0
- package/src/components/ui/NumberField.css +38 -0
- package/src/components/ui/NumberField.tsx +28 -0
- package/src/components/ui/OtpField.css +28 -0
- package/src/components/ui/OtpField.tsx +24 -0
- package/src/components/ui/Popover.css +25 -0
- package/src/components/ui/Popover.tsx +37 -0
- package/src/components/ui/PreviewCard.css +33 -0
- package/src/components/ui/PreviewCard.tsx +43 -0
- package/src/components/ui/Progress.css +33 -0
- package/src/components/ui/Progress.tsx +28 -0
- package/src/components/ui/Radio.tsx +22 -0
- package/src/components/ui/RadioGroup.css +42 -0
- package/src/components/ui/RadioGroup.tsx +29 -0
- package/src/components/ui/ScrollArea.css +42 -0
- package/src/components/ui/ScrollArea.tsx +22 -0
- package/src/components/ui/Select.css +86 -0
- package/src/components/ui/Select.tsx +39 -0
- package/src/components/ui/Separator.css +14 -0
- package/src/components/ui/Separator.tsx +12 -0
- package/src/components/ui/Slider.css +39 -0
- package/src/components/ui/Slider.tsx +21 -0
- package/src/components/ui/Switch.css +45 -0
- package/src/components/ui/Switch.tsx +29 -0
- package/src/components/ui/Tabs.css +72 -0
- package/src/components/ui/Tabs.tsx +44 -0
- package/src/components/ui/Toast.css +75 -0
- package/src/components/ui/Toast.tsx +48 -0
- package/src/components/ui/Toggle.tsx +12 -0
- package/src/components/ui/ToggleGroup.css +35 -0
- package/src/components/ui/ToggleGroup.tsx +30 -0
- package/src/components/ui/Toolbar.css +60 -0
- package/src/components/ui/Toolbar.tsx +36 -0
- package/src/components/ui/Tooltip.css +14 -0
- package/src/components/ui/Tooltip.tsx +31 -0
- package/src/components/ui/index.ts +83 -0
- package/src/components/ui/useDirection.ts +1 -0
- package/src/components/ui/useToastManager.ts +11 -0
- package/src/docs/blockMeta.json +66 -0
- package/src/docs/componentMeta.json +322 -0
- package/src/docs/staticPageMeta.json +143 -0
- package/src/docs/themeMeta.json +22 -0
- package/src/styles/tokenContract.json +61 -0
- package/workers/analytics-receiver.mjs +170 -0
- package/wrangler.analytics.jsonc +12 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.bento-progress {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.bento-progress-track {
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 10px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border-radius: 999px;
|
|
11
|
+
background: var(--track-bg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.bento-progress-indicator {
|
|
15
|
+
height: 100%;
|
|
16
|
+
border-radius: inherit;
|
|
17
|
+
background: linear-gradient(90deg, var(--bt-secondary), var(--bt-primary));
|
|
18
|
+
transition: width 300ms ease;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.bento-progress-label {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
margin-bottom: 8px;
|
|
26
|
+
color: var(--bt-muted-fg);
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
font-weight: 680;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.bento-progress-value {
|
|
32
|
+
color: var(--bt-fg);
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Progress as BaseProgress } from '@base-ui/react/progress'
|
|
2
|
+
import { type ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './Progress.css'
|
|
5
|
+
|
|
6
|
+
export type ProgressProps = ComponentPropsWithoutRef<typeof BaseProgress.Root> & {
|
|
7
|
+
showValue?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Progress = forwardRef<HTMLDivElement, ProgressProps>(
|
|
11
|
+
({ value, showValue, className, ...rest }, ref) => (
|
|
12
|
+
<div className={clsx('bento-progress', className)}>
|
|
13
|
+
{showValue && (
|
|
14
|
+
<div className="bento-progress-label">
|
|
15
|
+
<span>{rest['aria-label'] ?? 'Progress'}</span>
|
|
16
|
+
<span className="bento-progress-value">{value ?? 0}%</span>
|
|
17
|
+
</div>
|
|
18
|
+
)}
|
|
19
|
+
<BaseProgress.Root ref={ref} value={value} {...rest}>
|
|
20
|
+
<BaseProgress.Track className="bento-progress-track">
|
|
21
|
+
<BaseProgress.Indicator className="bento-progress-indicator" />
|
|
22
|
+
</BaseProgress.Track>
|
|
23
|
+
</BaseProgress.Root>
|
|
24
|
+
</div>
|
|
25
|
+
),
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
Progress.displayName = 'Progress'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Radio as BaseRadio } from '@base-ui/react/radio'
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './RadioGroup.css'
|
|
5
|
+
|
|
6
|
+
export type RadioProps = ComponentPropsWithoutRef<typeof BaseRadio.Root> & {
|
|
7
|
+
label?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Radio({ label, className, ...rest }: RadioProps) {
|
|
11
|
+
const radio = (
|
|
12
|
+
<BaseRadio.Root className={clsx('bento-radio', className)} {...rest}>
|
|
13
|
+
<BaseRadio.Indicator className="bento-radio-indicator" />
|
|
14
|
+
</BaseRadio.Root>
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
if (!label) return radio
|
|
18
|
+
|
|
19
|
+
return <label className="bento-radio-label">{radio}{label}</label>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { BaseRadio }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.bento-radio-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.bento-radio {
|
|
8
|
+
display: grid;
|
|
9
|
+
width: 22px;
|
|
10
|
+
height: 22px;
|
|
11
|
+
place-items: center;
|
|
12
|
+
border: 1px solid var(--bt-border-strong);
|
|
13
|
+
border-radius: 999px;
|
|
14
|
+
background: var(--bt-surface);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition: border-color 140ms ease;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.bento-radio[data-checked] {
|
|
20
|
+
border-color: var(--bt-secondary);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.bento-radio-indicator {
|
|
24
|
+
width: 12px;
|
|
25
|
+
height: 12px;
|
|
26
|
+
border-radius: 999px;
|
|
27
|
+
background: var(--bt-secondary);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.bento-radio-label {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 9px;
|
|
34
|
+
color: var(--bt-fg);
|
|
35
|
+
font-weight: 680;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.bento-radio:focus-visible {
|
|
40
|
+
outline: 3px solid var(--bt-ring, rgba(37, 99, 235, 0.32));
|
|
41
|
+
outline-offset: 2px;
|
|
42
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group'
|
|
2
|
+
import { Radio } from '@base-ui/react/radio'
|
|
3
|
+
import { type ComponentPropsWithoutRef } from 'react'
|
|
4
|
+
import clsx from 'clsx'
|
|
5
|
+
import './RadioGroup.css'
|
|
6
|
+
|
|
7
|
+
type RadioOption = { value: string; label: string }
|
|
8
|
+
|
|
9
|
+
type RadioGroupProps = Omit<ComponentPropsWithoutRef<typeof BaseRadioGroup>, 'defaultValue'> & {
|
|
10
|
+
options: RadioOption[]
|
|
11
|
+
defaultValue?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function RadioGroup({ options, defaultValue, className, ...rest }: RadioGroupProps) {
|
|
15
|
+
return (
|
|
16
|
+
<BaseRadioGroup defaultValue={defaultValue} className={clsx('bento-radio-group', className)} {...rest}>
|
|
17
|
+
{options.map((opt) => (
|
|
18
|
+
<label className="bento-radio-label" key={opt.value}>
|
|
19
|
+
<Radio.Root className="bento-radio" value={opt.value}>
|
|
20
|
+
<Radio.Indicator className="bento-radio-indicator" />
|
|
21
|
+
</Radio.Root>
|
|
22
|
+
{opt.label}
|
|
23
|
+
</label>
|
|
24
|
+
))}
|
|
25
|
+
</BaseRadioGroup>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type { RadioGroupProps, RadioOption }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.bento-scroll-area {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
border: 1px solid var(--bt-border);
|
|
4
|
+
border-radius: var(--bt-radius);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.bento-scroll-area-viewport {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow: auto;
|
|
11
|
+
scrollbar-width: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.bento-scroll-area-viewport::-webkit-scrollbar {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bento-scroll-area-scrollbar {
|
|
19
|
+
display: flex;
|
|
20
|
+
padding: 2px;
|
|
21
|
+
background: transparent;
|
|
22
|
+
touch-action: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bento-scroll-area-scrollbar[data-vertical] {
|
|
26
|
+
width: 10px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bento-scroll-area-thumb {
|
|
30
|
+
flex: 1;
|
|
31
|
+
border-radius: 999px;
|
|
32
|
+
background: var(--bt-border-strong);
|
|
33
|
+
transition: background 140ms ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.bento-scroll-area-thumb:hover {
|
|
37
|
+
background: var(--scrollbar-thumb-hover);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bento-scroll-area-corner {
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area'
|
|
2
|
+
import { type ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './ScrollArea.css'
|
|
5
|
+
|
|
6
|
+
export type ScrollAreaProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Root>
|
|
7
|
+
|
|
8
|
+
export const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(
|
|
9
|
+
({ className, children, ...rest }, ref) => (
|
|
10
|
+
<BaseScrollArea.Root ref={ref} className={clsx('bento-scroll-area', className)} {...rest}>
|
|
11
|
+
<BaseScrollArea.Viewport className="bento-scroll-area-viewport">
|
|
12
|
+
{children}
|
|
13
|
+
</BaseScrollArea.Viewport>
|
|
14
|
+
<BaseScrollArea.Scrollbar className="bento-scroll-area-scrollbar">
|
|
15
|
+
<BaseScrollArea.Thumb className="bento-scroll-area-thumb" />
|
|
16
|
+
</BaseScrollArea.Scrollbar>
|
|
17
|
+
<BaseScrollArea.Corner className="bento-scroll-area-corner" />
|
|
18
|
+
</BaseScrollArea.Root>
|
|
19
|
+
),
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
ScrollArea.displayName = 'ScrollArea'
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
.bento-select-trigger {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: min(100%, 330px);
|
|
4
|
+
min-height: 44px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: 12px;
|
|
8
|
+
padding: 0 12px 0 14px;
|
|
9
|
+
border: 1px solid var(--bt-border-strong);
|
|
10
|
+
border-radius: var(--bt-radius-sm);
|
|
11
|
+
color: var(--bt-fg);
|
|
12
|
+
background: var(--bt-surface);
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[dir='rtl'] .bento-select-trigger,
|
|
18
|
+
.bento-select-trigger:dir(rtl) {
|
|
19
|
+
flex-direction: row-reverse;
|
|
20
|
+
padding: 0 14px 0 12px;
|
|
21
|
+
text-align: right;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.bento-select-trigger:focus-visible {
|
|
25
|
+
outline: 3px solid var(--bt-ring, rgba(37, 99, 235, 0.32));
|
|
26
|
+
outline-offset: 2px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bento-select-positioner {
|
|
30
|
+
z-index: 40;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bento-select-popup {
|
|
34
|
+
min-width: 220px;
|
|
35
|
+
padding: 6px;
|
|
36
|
+
border: 1px solid var(--bt-border-strong);
|
|
37
|
+
border-radius: var(--bt-radius);
|
|
38
|
+
background: var(--bt-surface);
|
|
39
|
+
box-shadow: var(--bt-shadow);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.bento-select-item {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: 22px 1fr;
|
|
45
|
+
align-items: center;
|
|
46
|
+
min-height: 36px;
|
|
47
|
+
padding: 0 10px;
|
|
48
|
+
border-radius: var(--bt-radius-sm);
|
|
49
|
+
color: var(--bt-fg);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[dir='rtl'] .bento-select-item,
|
|
55
|
+
.bento-select-item:dir(rtl) {
|
|
56
|
+
grid-template-columns: 1fr 22px;
|
|
57
|
+
text-align: right;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[dir='rtl'] .bento-select-item [data-base-ui-select-item-indicator],
|
|
61
|
+
.bento-select-item:dir(rtl) [data-base-ui-select-item-indicator] {
|
|
62
|
+
grid-column: 2;
|
|
63
|
+
grid-row: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bento-select-item[data-highlighted] {
|
|
67
|
+
background: var(--bt-surface-muted);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bento-select-item[data-selected] {
|
|
71
|
+
color: var(--bt-secondary);
|
|
72
|
+
font-weight: var(--bt-font-weight, 720);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.bento-select-item[data-selected][data-highlighted] {
|
|
76
|
+
background: color-mix(in srgb, var(--bt-secondary), transparent 86%);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-theme='dark'] .bento-select-popup {
|
|
80
|
+
background: var(--bt-select-popup-bg, var(--bt-surface));
|
|
81
|
+
box-shadow: var(--bt-shadow);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-theme='dark'] .bento-select-item[data-selected][data-highlighted] {
|
|
85
|
+
background: color-mix(in srgb, var(--bt-secondary), transparent 84%);
|
|
86
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Select as BaseSelect } from '@base-ui/react/select'
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import { ChevronDown, Check } from 'lucide-react'
|
|
5
|
+
import './Select.css'
|
|
6
|
+
|
|
7
|
+
export type SelectProps = Omit<ComponentPropsWithoutRef<typeof BaseSelect.Root>, 'items'> & {
|
|
8
|
+
items: Record<string, string>
|
|
9
|
+
label?: string
|
|
10
|
+
placeholder?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function Select({ items, label, placeholder, defaultValue, ...rest }: SelectProps) {
|
|
14
|
+
return (
|
|
15
|
+
<BaseSelect.Root defaultValue={defaultValue} items={items} {...rest}>
|
|
16
|
+
{label && <label className="field-label" htmlFor={rest.id}>{label}</label>}
|
|
17
|
+
<BaseSelect.Trigger id={rest.id} className="bento-select-trigger">
|
|
18
|
+
<BaseSelect.Value placeholder={placeholder} />
|
|
19
|
+
<BaseSelect.Icon>
|
|
20
|
+
<ChevronDown size={16} />
|
|
21
|
+
</BaseSelect.Icon>
|
|
22
|
+
</BaseSelect.Trigger>
|
|
23
|
+
<BaseSelect.Portal>
|
|
24
|
+
<BaseSelect.Positioner className="bento-select-positioner" sideOffset={8}>
|
|
25
|
+
<BaseSelect.Popup className={clsx('bento-select-popup')}>
|
|
26
|
+
{Object.entries(items).map(([value, label]) => (
|
|
27
|
+
<BaseSelect.Item className="bento-select-item" key={value} value={value}>
|
|
28
|
+
<BaseSelect.ItemIndicator>
|
|
29
|
+
<Check size={15} />
|
|
30
|
+
</BaseSelect.ItemIndicator>
|
|
31
|
+
<BaseSelect.ItemText>{label}</BaseSelect.ItemText>
|
|
32
|
+
</BaseSelect.Item>
|
|
33
|
+
))}
|
|
34
|
+
</BaseSelect.Popup>
|
|
35
|
+
</BaseSelect.Positioner>
|
|
36
|
+
</BaseSelect.Portal>
|
|
37
|
+
</BaseSelect.Root>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Separator as BaseSeparator } from '@base-ui/react/separator'
|
|
2
|
+
import { type ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './Separator.css'
|
|
5
|
+
|
|
6
|
+
export type SeparatorProps = ComponentPropsWithoutRef<typeof BaseSeparator>
|
|
7
|
+
|
|
8
|
+
export const Separator = forwardRef<HTMLDivElement, SeparatorProps>(({ className, ...rest }, ref) => (
|
|
9
|
+
<BaseSeparator ref={ref} className={clsx('bento-separator', className)} {...rest} />
|
|
10
|
+
))
|
|
11
|
+
|
|
12
|
+
Separator.displayName = 'Separator'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.bento-slider {
|
|
2
|
+
width: min(100%, 420px);
|
|
3
|
+
padding: 12px 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.bento-slider-control {
|
|
7
|
+
display: flex;
|
|
8
|
+
height: 24px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.bento-slider-track {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 8px;
|
|
16
|
+
border-radius: 999px;
|
|
17
|
+
background: var(--track-bg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bento-slider-indicator {
|
|
21
|
+
position: absolute;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border-radius: 999px;
|
|
24
|
+
background: var(--bt-primary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bento-slider-thumb {
|
|
28
|
+
width: 22px;
|
|
29
|
+
height: 22px;
|
|
30
|
+
border: 3px solid var(--bt-surface);
|
|
31
|
+
border-radius: 999px;
|
|
32
|
+
background: var(--bt-primary-hover);
|
|
33
|
+
box-shadow: 0 5px 14px color-mix(in srgb, var(--bt-primary), transparent 70%);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.bento-slider-thumb:focus-visible {
|
|
37
|
+
outline: 3px solid var(--bt-ring, rgba(37, 99, 235, 0.32));
|
|
38
|
+
outline-offset: 2px;
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider'
|
|
2
|
+
import { type ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './Slider.css'
|
|
5
|
+
|
|
6
|
+
export type SliderProps = ComponentPropsWithoutRef<typeof BaseSlider.Root>
|
|
7
|
+
|
|
8
|
+
export const Slider = forwardRef<HTMLDivElement, SliderProps>(
|
|
9
|
+
({ className, ...rest }, ref) => (
|
|
10
|
+
<BaseSlider.Root ref={ref} className={clsx('bento-slider', className)} {...rest}>
|
|
11
|
+
<BaseSlider.Control className="bento-slider-control">
|
|
12
|
+
<BaseSlider.Track className="bento-slider-track">
|
|
13
|
+
<BaseSlider.Indicator className="bento-slider-indicator" />
|
|
14
|
+
<BaseSlider.Thumb className="bento-slider-thumb" />
|
|
15
|
+
</BaseSlider.Track>
|
|
16
|
+
</BaseSlider.Control>
|
|
17
|
+
</BaseSlider.Root>
|
|
18
|
+
),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
Slider.displayName = 'Slider'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.bento-switch {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
width: 44px;
|
|
5
|
+
height: 26px;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 3px;
|
|
8
|
+
border: 1px solid var(--bt-border-strong);
|
|
9
|
+
border-radius: 999px;
|
|
10
|
+
background: var(--track-bg);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
transition: border-color var(--bt-duration, 160ms) ease, background var(--bt-duration, 160ms) ease;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.bento-switch[data-checked] {
|
|
16
|
+
border-color: var(--bt-surface-strong);
|
|
17
|
+
background: var(--bt-surface-strong);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bento-switch:focus-visible {
|
|
21
|
+
outline: 3px solid var(--bt-ring, rgba(37, 99, 235, 0.32));
|
|
22
|
+
outline-offset: 2px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.bento-switch-thumb {
|
|
26
|
+
width: 18px;
|
|
27
|
+
height: 18px;
|
|
28
|
+
border-radius: 999px;
|
|
29
|
+
background: var(--bt-surface);
|
|
30
|
+
box-shadow: var(--bt-shadow);
|
|
31
|
+
transition: transform 180ms ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.bento-switch[data-checked] .bento-switch-thumb {
|
|
35
|
+
transform: translateX(18px);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.bento-switch-label {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 9px;
|
|
42
|
+
color: var(--bt-fg);
|
|
43
|
+
font-weight: 680;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Switch as BaseSwitch } from '@base-ui/react/switch'
|
|
2
|
+
import { type ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './Switch.css'
|
|
5
|
+
|
|
6
|
+
export type SwitchProps = ComponentPropsWithoutRef<typeof BaseSwitch.Root> & {
|
|
7
|
+
label?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Switch = forwardRef<HTMLButtonElement, SwitchProps>(
|
|
11
|
+
({ label, className, id, ...rest }, ref) => {
|
|
12
|
+
const inner = (
|
|
13
|
+
<BaseSwitch.Root ref={ref} id={id} className={clsx('bento-switch', className)} {...rest}>
|
|
14
|
+
<BaseSwitch.Thumb className="bento-switch-thumb" />
|
|
15
|
+
</BaseSwitch.Root>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
if (!label) return inner
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<label className="bento-switch-label" htmlFor={id}>
|
|
22
|
+
{inner}
|
|
23
|
+
{label}
|
|
24
|
+
</label>
|
|
25
|
+
)
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
Switch.displayName = 'Switch'
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.bento-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 18px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.bento-tabs-list {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
padding: 4px;
|
|
13
|
+
border: 1px solid var(--bt-border);
|
|
14
|
+
border-radius: var(--bt-radius);
|
|
15
|
+
background: var(--group-bg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bento-tabs-list.cols-2 {
|
|
19
|
+
grid-template-columns: 1fr 1fr;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bento-tabs-list.cols-3 {
|
|
23
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.bento-tabs-tab {
|
|
27
|
+
z-index: 1;
|
|
28
|
+
min-height: 36px;
|
|
29
|
+
border: 0;
|
|
30
|
+
border-radius: var(--bt-radius-sm);
|
|
31
|
+
color: var(--bt-muted-fg);
|
|
32
|
+
background: transparent;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
font-weight: var(--bt-font-weight, 760);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bento-tabs-tab[data-selected],
|
|
38
|
+
.bento-tabs-tab[data-active],
|
|
39
|
+
.bento-tabs-tab[aria-selected='true'] {
|
|
40
|
+
color: var(--bt-fg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.bento-tabs-indicator {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 4px;
|
|
46
|
+
bottom: 4px;
|
|
47
|
+
border-radius: var(--bt-radius-sm);
|
|
48
|
+
background: var(--bt-surface);
|
|
49
|
+
box-shadow: var(--bt-shadow);
|
|
50
|
+
transition: left 180ms ease, width 180ms ease;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bento-tabs-panel {
|
|
54
|
+
flex: 1;
|
|
55
|
+
padding: 18px;
|
|
56
|
+
border: 1px solid var(--bt-border);
|
|
57
|
+
border-radius: var(--bt-radius);
|
|
58
|
+
background: var(--group-bg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.bento-tabs-panel-title {
|
|
62
|
+
display: block;
|
|
63
|
+
color: var(--bt-fg);
|
|
64
|
+
font-size: 20px;
|
|
65
|
+
font-weight: 750;
|
|
66
|
+
margin-bottom: 10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.bento-tabs-panel p {
|
|
70
|
+
color: var(--bt-muted-fg);
|
|
71
|
+
margin: 0;
|
|
72
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from '@base-ui/react/tabs'
|
|
2
|
+
import { type ComponentPropsWithoutRef } from 'react'
|
|
3
|
+
import clsx from 'clsx'
|
|
4
|
+
import './Tabs.css'
|
|
5
|
+
|
|
6
|
+
type TabPanel = {
|
|
7
|
+
value: string
|
|
8
|
+
label: string
|
|
9
|
+
title?: string
|
|
10
|
+
content: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type TabsProps = Omit<ComponentPropsWithoutRef<typeof BaseTabs.Root>, 'defaultValue'> & {
|
|
14
|
+
panels: TabPanel[]
|
|
15
|
+
defaultValue?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function Tabs({ panels, defaultValue, className, ...rest }: TabsProps) {
|
|
19
|
+
return (
|
|
20
|
+
<BaseTabs.Root
|
|
21
|
+
defaultValue={defaultValue ?? panels[0]?.value}
|
|
22
|
+
className={clsx('bento-tabs', className)}
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
<BaseTabs.List className={clsx('bento-tabs-list', `cols-${panels.length}`)}>
|
|
26
|
+
{panels.map((panel) => (
|
|
27
|
+
<BaseTabs.Tab className="bento-tabs-tab" key={panel.value} value={panel.value}>
|
|
28
|
+
{panel.label}
|
|
29
|
+
</BaseTabs.Tab>
|
|
30
|
+
))}
|
|
31
|
+
<BaseTabs.Indicator className="bento-tabs-indicator" />
|
|
32
|
+
</BaseTabs.List>
|
|
33
|
+
{panels.map((panel) => (
|
|
34
|
+
<BaseTabs.Panel className="bento-tabs-panel" key={panel.value} value={panel.value}>
|
|
35
|
+
{panel.title && <strong className="bento-tabs-panel-title">{panel.title}</strong>}
|
|
36
|
+
<p>{panel.content}</p>
|
|
37
|
+
</BaseTabs.Panel>
|
|
38
|
+
))}
|
|
39
|
+
</BaseTabs.Root>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { BaseTabs }
|
|
44
|
+
export type { TabsProps, TabPanel }
|