@devalok/shilp-sutra 0.38.0 → 0.40.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/AGENTS.md +151 -0
- package/MIGRATION.md +255 -0
- package/README.md +3 -0
- package/dist/_chunks/badge-group.js +76 -75
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chart-container.js +50 -0
- package/dist/_chunks/chart-container.js.map +1 -0
- package/dist/_chunks/chat.js +236 -228
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/colors.js +30 -0
- package/dist/_chunks/colors.js.map +1 -0
- package/dist/_chunks/document-preview.js +2 -2
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/emoji-data.js +45 -0
- package/dist/_chunks/emoji-data.js.map +1 -0
- package/dist/_chunks/grid-lines.js +72 -0
- package/dist/_chunks/grid-lines.js.map +1 -0
- package/dist/_chunks/image-preview.js +2 -2
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +35 -263
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/normalize-icon.js +18 -0
- package/dist/_chunks/normalize-icon.js.map +1 -0
- package/dist/_chunks/oauth-button.js +227 -0
- package/dist/_chunks/oauth-button.js.map +1 -0
- package/dist/_chunks/popover.js +3 -3
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives.js +107 -107
- package/dist/_chunks/primitives.js.map +1 -1
- package/dist/_chunks/shared.js +5 -5
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/{text.js → success.js} +26 -63
- package/dist/_chunks/success.js.map +1 -0
- package/dist/_chunks/tiptap.js +1952 -1949
- package/dist/_chunks/tiptap.js.map +1 -1
- package/dist/_chunks/tooltip.js +58 -0
- package/dist/_chunks/tooltip.js.map +1 -0
- package/dist/_chunks/tree-view.js +101 -96
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/_chunks/use-calendar.js +5 -5
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/ai/ai-command-provider.d.ts +3 -2
- package/dist/ai/ai-command-provider.d.ts.map +1 -1
- package/dist/ai/ai-command-provider.js.map +1 -1
- package/dist/ai/block-renderer.js +11 -9
- package/dist/ai/block-renderer.js.map +1 -1
- package/dist/ai/blocks/error.js +31 -0
- package/dist/ai/blocks/error.js.map +1 -0
- package/dist/ai/blocks/index.d.ts +0 -2
- package/dist/ai/blocks/index.d.ts.map +1 -1
- package/dist/ai/blocks/index.js +2 -2
- package/dist/ai/blocks/text.js +19 -0
- package/dist/ai/blocks/text.js.map +1 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +198 -193
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.d.ts +2 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +92 -87
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/index.d.ts +0 -4
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +45 -46
- package/dist/ai/index.js.map +1 -1
- package/dist/composed/activity-feed.d.ts +2 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +5 -5
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/avatar-group.js +4 -4
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/bulk-action-bar.d.ts +2 -2
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +12 -12
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.d.ts +2 -1
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +106 -101
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/index.js +747 -3
- package/dist/composed/date-picker/index.js.map +1 -0
- package/dist/composed/emoji-picker.js +4 -4
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.d.ts +3 -3
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +40 -31
- package/dist/composed/empty-state.js.map +1 -1
- package/dist/composed/error-boundary.js +3 -3
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-node.js +81 -0
- package/dist/composed/extensions/emoji-node.js.map +1 -0
- package/dist/composed/extensions/emoji-suggestion.js +117 -0
- package/dist/composed/extensions/emoji-suggestion.js.map +1 -0
- package/dist/composed/file-preview.js +498 -2
- package/dist/composed/file-preview.js.map +1 -0
- package/dist/composed/filter-bar.js +1 -1
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/index.d.ts +0 -15
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +16 -24
- package/dist/composed/inline-edit.js +1 -1
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/composed/loading-skeleton.js +9 -9
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/markdown-viewer.js +3 -3
- package/dist/composed/markdown-viewer.js.map +1 -1
- package/dist/composed/multi-select-popover.js +1 -1
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/page-header.js +1 -1
- package/dist/composed/page-header.js.map +1 -1
- package/dist/composed/page-skeletons.js +15 -15
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/priority-indicator.js +3 -3
- package/dist/composed/priority-indicator.js.map +1 -1
- package/dist/composed/rich-chat-input.js +2073 -2
- package/dist/composed/rich-chat-input.js.map +1 -0
- package/dist/composed/rich-text-editor.js +75 -72
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.js +3 -3
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts +3 -2
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +58 -53
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/shell/app-command-palette.d.ts +2 -1
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js.map +1 -1
- package/dist/shell/bottom-navbar.d.ts +3 -1
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +94 -86
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/command-registry.d.ts +2 -1
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/command-registry.js.map +1 -1
- package/dist/shell/notification-center.js +8 -8
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.js +1 -1
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/sidebar.d.ts +7 -4
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +148 -134
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/top-bar.d.ts +4 -3
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +116 -108
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/semantic.css +82 -9
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.js +3 -3
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.js +2 -2
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/autocomplete.js +2 -2
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.js +11 -11
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.js +1 -1
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +3 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.js +1 -1
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.d.ts +5 -4
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +66 -65
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.js +5 -5
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/area-chart.js +177 -0
- package/dist/ui/charts/area-chart.js.map +1 -0
- package/dist/ui/charts/bar-chart.js +127 -0
- package/dist/ui/charts/bar-chart.js.map +1 -0
- package/dist/ui/charts/chart-container.js +3 -0
- package/dist/ui/charts/gauge-chart.js +72 -0
- package/dist/ui/charts/gauge-chart.js.map +1 -0
- package/dist/ui/charts/index.js +10 -1035
- package/dist/ui/charts/line-chart.js +135 -0
- package/dist/ui/charts/line-chart.js.map +1 -0
- package/dist/ui/charts/pie-chart.js +111 -0
- package/dist/ui/charts/pie-chart.js.map +1 -0
- package/dist/ui/charts/radar-chart.js +170 -0
- package/dist/ui/charts/radar-chart.js.map +1 -0
- package/dist/ui/charts/sparkline.js +119 -0
- package/dist/ui/charts/sparkline.js.map +1 -0
- package/dist/ui/chat/message.d.ts +3 -3
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/system-message.d.ts +2 -1
- package/dist/ui/chat/system-message.d.ts.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.js +2 -2
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/color-input.js +10 -10
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/color-swatch.js +3 -3
- package/dist/ui/color-swatch.js.map +1 -1
- package/dist/ui/combobox.d.ts +2 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +100 -95
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/container.d.ts +6 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/container.js +2 -1
- package/dist/ui/container.js.map +1 -1
- package/dist/ui/context-menu.js +6 -6
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.js +1 -1
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.js +2 -2
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/data-table-card.js +2 -2
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-header.js +2 -2
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js +3 -3
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/data-table-toolbar.js +1 -1
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/data-table.js +1 -1
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/devalok-grain.d.ts +1 -1
- package/dist/ui/devalok-grain.js.map +1 -1
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.js +6 -6
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.js +4 -4
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon-button.d.ts +9 -2
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js +14 -13
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/index.d.ts +1 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +31 -33
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.js +2 -2
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/lib/icon-input.d.ts +42 -0
- package/dist/ui/lib/icon-input.d.ts.map +1 -0
- package/dist/ui/lib/normalize-icon.d.ts +39 -0
- package/dist/ui/lib/normalize-icon.d.ts.map +1 -0
- package/dist/ui/link.js +1 -1
- package/dist/ui/link.js.map +1 -1
- package/dist/ui/menubar.js +8 -8
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.js +3 -3
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-input.js +3 -3
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/oauth-button/index.d.ts +3 -0
- package/dist/ui/oauth-button/index.d.ts.map +1 -0
- package/dist/ui/oauth-button/index.js +3 -0
- package/dist/ui/oauth-button/oauth-button.d.ts +208 -0
- package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -0
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/progress.js +2 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.js +1 -1
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/segmented-control.d.ts +3 -4
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +53 -45
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/select.js +3 -3
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.js +11 -11
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.js +9 -9
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.js +2 -2
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/split-button.js +7 -7
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stack.d.ts +6 -1
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/stack.js +2 -1
- package/dist/ui/stack.js.map +1 -1
- package/dist/ui/stat-card.d.ts +2 -3
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +118 -116
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/status-dot.js +2 -2
- package/dist/ui/status-dot.js.map +1 -1
- package/dist/ui/stepper.d.ts +2 -1
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +74 -69
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/switch.js +2 -2
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/tabs.js +3 -3
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.d.ts +7 -2
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js +2 -1
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.js +8 -8
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toaster.d.ts +11 -2
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js.map +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.js +12 -12
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/tree-item.d.ts +3 -2
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/dist/ui/tree-view/use-tree.d.ts +2 -1
- package/dist/ui/tree-view/use-tree.d.ts.map +1 -1
- package/docs/components/_header.md +90 -1
- package/docs/components/ui/oauth-button.md +86 -0
- package/docs/recipes/customize-brand.md +100 -4
- package/docs/recipes/index.md +5 -1
- package/docs/recipes/install-astro.md +15 -0
- package/docs/recipes/install-next-app-router.md +21 -5
- package/docs/recipes/install-next-pages.md +2 -0
- package/docs/recipes/install-remix.md +15 -0
- package/docs/recipes/install-tanstack-start.md +15 -0
- package/docs/recipes/install-vite.md +15 -0
- package/docs/recipes/troubleshoot.md +22 -0
- package/llms-full.txt +177 -2
- package/llms-quick.txt +247 -0
- package/llms.txt +116 -3
- package/package.json +80 -2
- package/scripts/welcome.mjs +219 -0
- package/skill/README.md +99 -0
- package/skill/SKILL.md +163 -0
- package/skill/install.sh +59 -0
- package/skill/references/components-full.md +7083 -0
- package/skill/references/components.md +778 -0
- package/skill/references/customize-brand.md +314 -0
- package/skill/references/server-components.md +211 -0
- package/skill/references/setup-astro.md +195 -0
- package/skill/references/setup-next-app-router.md +248 -0
- package/skill/references/setup-next-pages.md +127 -0
- package/skill/references/setup-remix.md +188 -0
- package/skill/references/setup-tanstack-start.md +160 -0
- package/skill/references/setup-vite.md +187 -0
- package/skill/references/troubleshoot.md +241 -0
- package/dist/_chunks/date-picker.js +0 -748
- package/dist/_chunks/date-picker.js.map +0 -1
- package/dist/_chunks/file-preview.js +0 -499
- package/dist/_chunks/file-preview.js.map +0 -1
- package/dist/_chunks/rich-chat-input.js +0 -2071
- package/dist/_chunks/rich-chat-input.js.map +0 -1
- package/dist/_chunks/text.js.map +0 -1
- package/dist/ui/charts/index.js.map +0 -1
- /package/{LICENSE → skill/LICENSE} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# OAuthButton
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/oauth-button
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Exports
|
|
8
|
+
- `OAuthButton` — primary brand-aware sign-in button
|
|
9
|
+
- `OAuthGroup` — stacked layout wrapper with consistent spacing
|
|
10
|
+
- `OAuthDivider` — `or`-style horizontal rule between OAuth row and email form
|
|
11
|
+
- `OAuthConnectionRow` — settings-page row for a linked provider (Disconnect / Connect action)
|
|
12
|
+
|
|
13
|
+
## OAuthButton props
|
|
14
|
+
provider: "google" | "apple" | "github" | "microsoft" | "x" | "linkedin" | "facebook" | "discord" | "slack" | "gitlab" | "sso" | "email" | "passkey" (required)
|
|
15
|
+
intent: "continue" | "signin" | "signup" (default "continue") — drives the verb in the label
|
|
16
|
+
appearance: "brand" | "outline" | "dark" (default "brand") — visual treatment
|
|
17
|
+
icon: ReactNode — override the default Tabler glyph with a brand-multicolour SVG
|
|
18
|
+
iconOnly: boolean — compact icon-only button; provider name preserved in aria-label
|
|
19
|
+
compact: boolean — short label ("Google" not "Continue with Google"); aria-label keeps long form
|
|
20
|
+
lastUsed: boolean — inline right-edge pill inside the button (a stronger pattern is reorder, below)
|
|
21
|
+
helperText: ReactNode — reassurance copy rendered below the button
|
|
22
|
+
children: ReactNode — override the default label entirely (i18n / custom copy)
|
|
23
|
+
size: inherited from Button ("xs" | "sm" | "md" | "lg" | compact + icon variants)
|
|
24
|
+
fullWidth, loading, onClick, onClickAsync, asyncFeedbackDuration, disabled — inherited from Button
|
|
25
|
+
|
|
26
|
+
## Data attributes
|
|
27
|
+
- `data-provider="<provider>"` — useful for analytics filtering
|
|
28
|
+
- `data-oauth-appearance="<appearance>"`
|
|
29
|
+
|
|
30
|
+
## OAuthGroup props
|
|
31
|
+
orientation: "vertical" | "horizontal" (default "vertical")
|
|
32
|
+
gap: "ds-02" | "ds-03" | "ds-04" (default "ds-03")
|
|
33
|
+
fullWidth: boolean (default true) — stretches children to fill width when vertical
|
|
34
|
+
reorderLastUsedFirst: boolean (default false) — pull the child with lastUsed to position 0
|
|
35
|
+
(Stripe-style — a stronger conversion lever than a visual badge alone)
|
|
36
|
+
|
|
37
|
+
## OAuthDivider props
|
|
38
|
+
label: ReactNode (default "or")
|
|
39
|
+
|
|
40
|
+
## OAuthConnectionRow props
|
|
41
|
+
provider: OAuthProvider (required)
|
|
42
|
+
connected: boolean (required)
|
|
43
|
+
accountLabel: ReactNode — account identifier shown next to the provider name (e.g. email)
|
|
44
|
+
onAction: (e) => void — synchronous click handler
|
|
45
|
+
onActionAsync: (e) => Promise<void> — uses Button's async state machine
|
|
46
|
+
actionLabel: ReactNode — override the "Disconnect" / "Connect <name>" copy
|
|
47
|
+
icon: ReactNode — override the default glyph
|
|
48
|
+
disabled: boolean
|
|
49
|
+
|
|
50
|
+
## Defaults
|
|
51
|
+
intent="continue", appearance="brand", iconOnly=false, lastUsed=false
|
|
52
|
+
|
|
53
|
+
## Example
|
|
54
|
+
```jsx
|
|
55
|
+
// Typical signup flow
|
|
56
|
+
<OAuthGroup>
|
|
57
|
+
<OAuthButton provider="google" lastUsed />
|
|
58
|
+
<OAuthButton provider="apple" />
|
|
59
|
+
<OAuthButton provider="github" />
|
|
60
|
+
</OAuthGroup>
|
|
61
|
+
<OAuthDivider />
|
|
62
|
+
<OAuthGroup>
|
|
63
|
+
<OAuthButton provider="passkey" appearance="outline" />
|
|
64
|
+
<OAuthButton provider="email" appearance="outline" />
|
|
65
|
+
</OAuthGroup>
|
|
66
|
+
|
|
67
|
+
// Async loading + success/error feedback
|
|
68
|
+
<OAuthButton provider="google" fullWidth onClickAsync={signInWithGoogle} />
|
|
69
|
+
|
|
70
|
+
// True brand-multicolour glyph from the provider's brand page
|
|
71
|
+
<OAuthButton provider="google" icon={<GoogleGSvg />} />
|
|
72
|
+
|
|
73
|
+
// Settings page — linked state
|
|
74
|
+
<OAuthConnectionRow
|
|
75
|
+
provider="google"
|
|
76
|
+
connected
|
|
77
|
+
accountLabel="namaskar@devalok.in"
|
|
78
|
+
onAction={disconnectGoogle}
|
|
79
|
+
/>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Composability
|
|
83
|
+
- **Built on Button.** Async state machine, loading/processing, sizes, and `fullWidth` are inherited. `variant` and `color` are managed internally — pass `appearance` instead.
|
|
84
|
+
- **Tabler peer dep.** Default glyphs come from `@tabler/icons-react`. To match a provider's official multicolour mark, pass `icon={<YourSvg />}`.
|
|
85
|
+
- **Brand-colour backgrounds.** `appearance="brand"` uses each provider's published button colour. `appearance="outline"` falls back to DS-neutral. `appearance="dark"` unifies every provider into an Apple-style black-on-white (light) / white-on-black (dark) treatment — useful when you want a row to feel visually consistent across providers.
|
|
86
|
+
- **Last-used hint.** Storage is the consumer's responsibility — pass `lastUsed={user.lastProvider === 'google'}`.
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Override colors, radius, fonts, and spacing without forking the package. All customization happens through CSS custom properties — no JS configuration.
|
|
4
4
|
|
|
5
|
+
## The fast path: use the Themer
|
|
6
|
+
|
|
7
|
+
Before hand-writing variables, try **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)**. It is one funnel with four entry doors:
|
|
8
|
+
|
|
9
|
+
- **Pick an archetype** — Linear, Stripe, Apple, Material, Notion, Vercel, or Devalok. Click → result page.
|
|
10
|
+
- **Use my brand color** — paste a hex or dial OKLCH. Auto-generates the 12-step ramp and suggests an archetype.
|
|
11
|
+
- **Walk me through it** — five-question wizard composes the answers into a theme.
|
|
12
|
+
- **Just exploring** — land on a sample result page to see what you ship away with.
|
|
13
|
+
|
|
14
|
+
Every door drops you at the same result screen: a copy-pasteable CSS block (role tokens + 12-step OKLCH accent ramp), install commands for your package manager, and a share URL that encodes the theme.
|
|
15
|
+
|
|
16
|
+
Paste the snippet into your global stylesheet *after* the `@import "@devalok/shilp-sutra/css";` line. That's the whole flow — no `tailwind.config.ts`, no theme provider, no JS bundle.
|
|
17
|
+
|
|
18
|
+
The rest of this doc covers what to do if the Themer doesn't expose a token you need to override (font stack, spacing scale, focus ring) — fall through to the hand-written cases below.
|
|
19
|
+
|
|
5
20
|
## How tokens layer
|
|
6
21
|
|
|
7
22
|
Shilp Sutra's tokens are organized in three tiers:
|
|
@@ -56,19 +71,100 @@ To swap to teal:
|
|
|
56
71
|
|
|
57
72
|
For a quick swap without redoing the full scale, only override step 9 (background) and step 11 (foreground). Other steps will still reference the original chroma — visually mismatched but functional.
|
|
58
73
|
|
|
59
|
-
###
|
|
74
|
+
### Shape presets (`[data-shape]`)
|
|
75
|
+
|
|
76
|
+
The simplest way to change roundness for the whole UI is to set a `data-shape` attribute on the document (or any subtree). Three presets ship by default — `sharp`, `slightly-rounded` (the default if no attribute), and `rounded`. Pill shapes (Badge, Switch, Slider, Avatar circle) stay pill in every preset.
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<!-- Whole-app, sharp/technical feel -->
|
|
80
|
+
<html data-shape="sharp">
|
|
81
|
+
|
|
82
|
+
<!-- Whole-app, soft/consumer feel -->
|
|
83
|
+
<html data-shape="rounded">
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
You can scope it to a subtree if a particular section wants different shape language than the rest:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<div data-shape="sharp">
|
|
90
|
+
<DeveloperConsole />
|
|
91
|
+
</div>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Visual feel:
|
|
95
|
+
|
|
96
|
+
| Preset | Identity | Comparable to |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `sharp` | Technical, precise, "serious software" | Vercel, Linear, terminal UIs |
|
|
99
|
+
| `slightly-rounded` (default) | Modern SaaS neutral | shadcn default, Stripe, Notion sidebar |
|
|
100
|
+
| `rounded` | Friendly, soft, consumer | iOS, Notion content, modern startup landings |
|
|
101
|
+
|
|
102
|
+
### Custom radius — override a role token
|
|
103
|
+
|
|
104
|
+
If a preset doesn't fit, you can override any semantic radius role token directly. Components reference these role tokens (not the primitive scale), so a single override propagates everywhere.
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
/* Tighten controls only; leave overlays / surfaces alone */
|
|
108
|
+
:root {
|
|
109
|
+
--radius-control: 4px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Or scoped to a subtree */
|
|
113
|
+
.checkout {
|
|
114
|
+
--radius-control: 8px;
|
|
115
|
+
--radius-surface: 20px;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The role tokens (defaults shown — the "slightly-rounded" preset):
|
|
120
|
+
|
|
121
|
+
| Token | Default | Used by |
|
|
122
|
+
|--------------------------|---------|---------|
|
|
123
|
+
| `--radius-control` | 6px | Button, Input, Select, Tabs trigger, Toggle, Code block |
|
|
124
|
+
| `--radius-control-inner` | 2px | Checkbox box, ±/close buttons, inline Code |
|
|
125
|
+
| `--radius-surface` | 10px | Card, Alert, Accordion |
|
|
126
|
+
| `--radius-overlay-sm` | 6px | Tooltip, Toast |
|
|
127
|
+
| `--radius-overlay` | 10px | Popover, HoverCard, DropdownMenu / ContextMenu / Menubar content, listboxes |
|
|
128
|
+
| `--radius-overlay-lg` | 16px | Dialog, AlertDialog, Sheet, BottomSheet, ColorInput picker |
|
|
129
|
+
| `--radius-pill` | 9999px | Badge, StatusDot, Radio, Switch, Slider, Progress, Avatar circle |
|
|
130
|
+
| `--radius-bubble` | 24px | ChatMessage bubble |
|
|
131
|
+
|
|
132
|
+
### Build your own preset
|
|
133
|
+
|
|
134
|
+
Define your own `[data-shape="…"]` block and swap to it whenever you want:
|
|
135
|
+
|
|
136
|
+
```css
|
|
137
|
+
[data-shape="brand-soft"] {
|
|
138
|
+
--radius-control: 8px;
|
|
139
|
+
--radius-control-inner: 3px;
|
|
140
|
+
--radius-surface: 14px;
|
|
141
|
+
--radius-overlay-sm: 8px;
|
|
142
|
+
--radius-overlay: 14px;
|
|
143
|
+
--radius-overlay-lg: 20px;
|
|
144
|
+
--radius-pill: 9999px;
|
|
145
|
+
--radius-bubble: 28px;
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<html data-shape="brand-soft">
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Change the primitive radius scale (advanced)
|
|
154
|
+
|
|
155
|
+
If you're rebuilding the entire system rather than just rebranding, you can also override the primitive scale that the role tokens reference:
|
|
60
156
|
|
|
61
157
|
```css
|
|
62
158
|
@theme {
|
|
63
|
-
--radius-ds-sm: 0.25rem;
|
|
64
|
-
--radius-ds-md: 0.5rem;
|
|
159
|
+
--radius-ds-sm: 0.25rem;
|
|
160
|
+
--radius-ds-md: 0.5rem;
|
|
65
161
|
--radius-ds-lg: 0.75rem;
|
|
66
162
|
--radius-ds-xl: 1rem;
|
|
67
163
|
--radius: 0.5rem; /* unsuffixed — generates bare `rounded` */
|
|
68
164
|
}
|
|
69
165
|
```
|
|
70
166
|
|
|
71
|
-
|
|
167
|
+
Most consumers should NOT touch this — overriding the role tokens above is the cleaner path.
|
|
72
168
|
|
|
73
169
|
### Change fonts
|
|
74
170
|
|
package/docs/recipes/index.md
CHANGED
|
@@ -29,9 +29,13 @@ If the framework is not listed, start with [install-vite.md](./install-vite.md)
|
|
|
29
29
|
|
|
30
30
|
| Recipe | What it covers |
|
|
31
31
|
|---|---|
|
|
32
|
-
| [customize-brand.md](./customize-brand.md) | Token override cookbook —
|
|
32
|
+
| [customize-brand.md](./customize-brand.md) | Token override cookbook — colors, radius role tokens, `[data-shape]` presets, fonts, spacing scale, dark-mode mapping. **Start here**, or skip ahead to the Themer ↓ |
|
|
33
33
|
| [server-components.md](./server-components.md) | Per-component RSC-safety matrix; correct import patterns for Server Components |
|
|
34
34
|
|
|
35
|
+
### The fast path: Themer
|
|
36
|
+
|
|
37
|
+
Don't want to write CSS variables by hand? Use **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)** — one funnel, four doors (pick an archetype, paste your brand color, take a wizard, or just explore). Every door drops you at a result page with a CSS snippet to paste, install commands, and a share URL.
|
|
38
|
+
|
|
35
39
|
## Diagnostics
|
|
36
40
|
|
|
37
41
|
| Recipe | What it covers |
|
|
@@ -29,6 +29,21 @@ Add only if rendering `<Toaster />`:
|
|
|
29
29
|
pnpm add sonner
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
33
|
+
|
|
34
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or Astro's Vite build will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
35
|
+
|
|
36
|
+
| When you import… | Install |
|
|
37
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
38
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
39
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
40
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
41
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
42
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
43
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
44
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
45
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
46
|
+
|
|
32
47
|
## 3. Wire Tailwind 4 in `astro.config`
|
|
33
48
|
|
|
34
49
|
Astro has its own `@astrojs/tailwind` integration, but for Tailwind 4 use the Vite plugin directly (Astro 4.5+ supports this):
|
|
@@ -8,10 +8,9 @@ You are in this recipe if **all** of these are true:
|
|
|
8
8
|
|
|
9
9
|
- `package.json` lists `"next"` at version `^13.0.0` or higher
|
|
10
10
|
- An `app/` directory exists at the project root or under `src/`
|
|
11
|
-
- An `app/layout.tsx
|
|
12
|
-
- No `pages/` directory at the project root, OR `pages/` exists but only contains `_app.{js,tsx}` and `_document.{js,tsx}` (legacy artifacts)
|
|
11
|
+
- An `app/layout.{tsx,jsx}` file exists
|
|
13
12
|
|
|
14
|
-
If `pages/`
|
|
13
|
+
If a `pages/` directory exists at the project root AND contains route files (not just `_app`/`_document` legacy artifacts from older `create-next-app` versions), use [install-next-pages.md](./install-next-pages.md). `create-next-app@16+` no longer scaffolds `pages/` for App Router projects.
|
|
15
14
|
|
|
16
15
|
## 2. Install dependencies
|
|
17
16
|
|
|
@@ -47,6 +46,23 @@ Add brand assets package if you need Devalok or Karm logos:
|
|
|
47
46
|
pnpm add @devalok/shilp-sutra-brand
|
|
48
47
|
```
|
|
49
48
|
|
|
49
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
50
|
+
|
|
51
|
+
Some components depend on third-party libraries that ship as optional peers. **Install BEFORE first import** of the matching component, or `next build` will exit with `Module not found`. Skip entirely if you only use core components (`Button`, `Text`, `Stack`, `Dialog`, `Toast`, `Form*`, `Input`, `Card`, etc.).
|
|
52
|
+
|
|
53
|
+
| When you import… | Install |
|
|
54
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
55
|
+
| `@devalok/shilp-sutra/ui/charts/*` (BarChart, LineChart, …)| `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
56
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
57
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
58
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
59
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
60
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
61
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
62
|
+
| Any `Icon` / `IconButton` use with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
63
|
+
|
|
64
|
+
> These aren't in core deps so consumers who never render a chart, OTP input, or rich-text editor don't pay the install / bundle cost. One-time decision at install.
|
|
65
|
+
|
|
50
66
|
## 3. Configure PostCSS
|
|
51
67
|
|
|
52
68
|
Create or update `postcss.config.mjs` at the project root:
|
|
@@ -211,8 +227,8 @@ If anything is off, see [troubleshoot.md](./troubleshoot.md).
|
|
|
211
227
|
}
|
|
212
228
|
```
|
|
213
229
|
For npm/yarn/bun equivalents, see [troubleshoot.md](./troubleshoot.md).
|
|
214
|
-
- **
|
|
215
|
-
- **`p-3` vs `p-ds-03
|
|
230
|
+
- **Per-component imports keep RSC fast AND avoid peer-dep cliffs.** Inside Server Components, prefer `@devalok/shilp-sutra/ui/text`, `…/composed/page-header`, etc. The barrel `@devalok/shilp-sutra/ui` re-exports many client components — including some with hard peer-dep imports (e.g. `input-otp`) — so it both inflates the client bundle and forces those peers to be installed even when you never render those components. See [server-components.md](./server-components.md) for the full RSC-safety matrix.
|
|
231
|
+
- **`p-3` vs `p-ds-03` — both are valid.** DS spacing uses the `--spacing-ds-*` namespace (`p-ds-04`, `gap-ds-03`); Tailwind 4's default numeric scale (`p-4`, `gap-2`) coexists by design. Pick `p-ds-*` for values that should track DS theme changes (card padding, form gaps); pick `p-N` for one-off layout values (section breathing room). Do NOT mass-codemod `p-4` → `p-ds-04` — that is not what the package intends.
|
|
216
232
|
- **Bare `shadow` is dead.** Tailwind 4 has no `--shadow-DEFAULT`. Use `shadow-raised`, `shadow-overlay`, or `shadow-floating`.
|
|
217
233
|
|
|
218
234
|
## 9. What you should NOT do
|
|
@@ -16,6 +16,8 @@ If both `app/` and `pages/` exist, prefer [install-next-app-router.md](./install
|
|
|
16
16
|
|
|
17
17
|
Same dependencies as the App Router recipe — see [install-next-app-router.md § 2](./install-next-app-router.md#2-install-dependencies). Replace `next-themes`'s `attribute="class"` setup with the same on Pages Router (it works identically).
|
|
18
18
|
|
|
19
|
+
**Optional peer dependencies** — if you'll render `<DataTable>`, any chart, `<DatePicker>`, `<RichTextEditor>`, `<InputOTP>`, `<FilePreview>`, `<MarkdownViewer>`, or use Tabler icons, install the matching peers BEFORE first import. Full table at [install-next-app-router.md § 2a](./install-next-app-router.md#2a-optional-peer-dependencies-install-only-when-importing-the-matching-subpath) — identical for Pages Router.
|
|
20
|
+
|
|
19
21
|
## 3. PostCSS
|
|
20
22
|
|
|
21
23
|
Same as App Router — see [§ 3](./install-next-app-router.md#3-configure-postcss).
|
|
@@ -25,6 +25,21 @@ Optional:
|
|
|
25
25
|
pnpm add sonner # only if rendering <Toaster />
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
29
|
+
|
|
30
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or Remix's Vite build will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
31
|
+
|
|
32
|
+
| When you import… | Install |
|
|
33
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
34
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
35
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
36
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
37
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
38
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
39
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
40
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
41
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
42
|
+
|
|
28
43
|
## 3. Wire Tailwind 4 in `vite.config.ts`
|
|
29
44
|
|
|
30
45
|
```ts
|
|
@@ -23,6 +23,21 @@ Optional:
|
|
|
23
23
|
pnpm add sonner # only if rendering <Toaster />
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
27
|
+
|
|
28
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or the TanStack Start dev/build will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
29
|
+
|
|
30
|
+
| When you import… | Install |
|
|
31
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
32
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
33
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
34
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
35
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
36
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
37
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
38
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
39
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
40
|
+
|
|
26
41
|
## 3. Wire Tailwind 4 in `app.config.ts`
|
|
27
42
|
|
|
28
43
|
```ts
|
|
@@ -40,6 +40,21 @@ Add only if rendering `<Toaster />`:
|
|
|
40
40
|
pnpm add sonner
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
44
|
+
|
|
45
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or `vite dev` / `vite build` will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
46
|
+
|
|
47
|
+
| When you import… | Install |
|
|
48
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
49
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
50
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
51
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
52
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
53
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
54
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
55
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
56
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
57
|
+
|
|
43
58
|
## 3. Wire Tailwind 4 in `vite.config.ts`
|
|
44
59
|
|
|
45
60
|
Use the official Tailwind 4 Vite plugin (faster than PostCSS for Vite):
|
|
@@ -97,6 +97,28 @@ transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"],
|
|
|
97
97
|
|
|
98
98
|
If `@devalok/shilp-sutra-brand` is not installed, list only `@devalok/shilp-sutra`.
|
|
99
99
|
|
|
100
|
+
## Symptom: Build error `Cannot find module 'sonner' / 'input-otp' / 'date-fns' / '@tiptap/react' / 'react-pdf' / 'react-markdown' / '@emoji-mart/react'`
|
|
101
|
+
|
|
102
|
+
**Diagnosis:** an optional peer dependency is missing. Each component below has a peer it pulls only when imported. Install the matching peer (always BEFORE the first import):
|
|
103
|
+
|
|
104
|
+
| You imported (per-component subpath) | Install |
|
|
105
|
+
|--------------------------------------|-----------------------------------------------------------------------------------------------|
|
|
106
|
+
| `…/ui/toaster` or `…/ui/toast` | `pnpm add sonner` |
|
|
107
|
+
| `…/ui/input-otp` | `pnpm add input-otp` |
|
|
108
|
+
| `…/composed/date-picker` | `pnpm add date-fns` |
|
|
109
|
+
| `…/composed/emoji-picker` | `pnpm add @emoji-mart/data @emoji-mart/react` |
|
|
110
|
+
| `…/composed/extensions/emoji-node` or `…/extensions/emoji-suggestion` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
111
|
+
| `…/composed/rich-text-editor` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
112
|
+
| `…/composed/rich-chat-input` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
113
|
+
| `…/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
114
|
+
| `…/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
|
|
115
|
+
| `…/ai/block-renderer`, `…/ai/blocks/text`, `…/ai/blocks/error` | `pnpm add react-markdown remark-gfm` |
|
|
116
|
+
| Any `…/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
117
|
+
|
|
118
|
+
These ship as **optional** peers so consumers who never render the matching component don't pay the install cost. Once you import the component, the peer becomes required. Each affected component's JSDoc carries the same install hint — hover the import in your editor to see it inline.
|
|
119
|
+
|
|
120
|
+
For the full table in your framework's install recipe, see `install-<framework>.md → §2a. Optional peer dependencies`.
|
|
121
|
+
|
|
100
122
|
## Symptom: Hydration warning on every page load (Next.js)
|
|
101
123
|
|
|
102
124
|
**Diagnosis:** `next-themes` writes the `class` attribute on `<html>` before React hydrates, causing a server/client class mismatch.
|
package/llms-full.txt
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> All variant values and props verified from source CVA definitions.
|
|
6
6
|
>
|
|
7
7
|
> Package: @devalok/shilp-sutra
|
|
8
|
-
> Version: 0.
|
|
8
|
+
> Version: 0.40.0
|
|
9
9
|
>
|
|
10
10
|
> **If you are an AI agent reading this file top-to-bottom:** the Setup
|
|
11
11
|
> section below is authoritative. If any later per-component doc or a
|
|
@@ -67,7 +67,8 @@ transpilePackages: ['@devalok/shilp-sutra', '@devalok/shilp-sutra-brand'],
|
|
|
67
67
|
| `--leading-ds-*` | `leading-ds-tight`, `leading-ds-normal` | ds-namespaced |
|
|
68
68
|
| `--tracking-*` | `tracking-tight`, `tracking-normal` | standard TW namespace |
|
|
69
69
|
| `--font-*`, `--font-weight-*` | `font-sans`, `font-semibold` | standard TW namespace |
|
|
70
|
-
| `--radius`, `--radius-ds-*` | `rounded` (bare), `rounded-ds-lg` | unprefixed + ds-namespaced |
|
|
70
|
+
| `--radius`, `--radius-ds-*` | `rounded` (bare), `rounded-ds-lg` | unprefixed + ds-namespaced primitive scale |
|
|
71
|
+
| `--radius-control`, `--radius-surface`, `--radius-overlay-*`, `--radius-pill`, `--radius-bubble` | `rounded-control`, `rounded-surface`, `rounded-overlay`, `rounded-pill`, `rounded-bubble` | semantic roles (PUBLIC) — components reference these, `[data-shape]` presets remap them |
|
|
71
72
|
| `--shadow-*` | `shadow-raised`, `shadow-overlay` | semantic names only; bare `shadow` is NOT generated (TW4 has no default scale and we don't define `--shadow`) |
|
|
72
73
|
| `--ease-*` | `ease-productive-standard` | semantic names |
|
|
73
74
|
| `--breakpoint-*` | `md:`, `lg:` | standard TW namespace |
|
|
@@ -105,6 +106,94 @@ See `MIGRATION.md#v0370--tailwind-4-css-first-migration` (root of this package).
|
|
|
105
106
|
|
|
106
107
|
---
|
|
107
108
|
|
|
109
|
+
## Shape Presets & Radius Roles (v0.39+)
|
|
110
|
+
|
|
111
|
+
Radius has TWO layers:
|
|
112
|
+
|
|
113
|
+
1. **Primitive scale** — `--radius-ds-sm/md/lg/xl/2xl/full` (private; internal building blocks).
|
|
114
|
+
2. **Semantic roles** — `--radius-control`, `--radius-control-inner`, `--radius-surface`, `--radius-overlay-sm/md/lg`, `--radius-pill`, `--radius-bubble`. Components reference roles. Consumers customize these.
|
|
115
|
+
|
|
116
|
+
### Role token reference
|
|
117
|
+
|
|
118
|
+
| Token | Default (px) | Utility class | Used by |
|
|
119
|
+
|--------------------------|--------------|--------------------------|---------|
|
|
120
|
+
| `--radius-control` | 6 | `rounded-control` | Button, Input, Select, Combobox, Autocomplete, NumberInput, Toggle, ToggleGroup, Tabs trigger (contained), menu items, sidebar menu button, stepper, pagination, code block, InputOTP slot |
|
|
121
|
+
| `--radius-control-inner` | 2 | `rounded-control-inner` | Checkbox box, +/− buttons, close X buttons, focus rings on text links, small badges, color preset swatches, skeleton text bars, inline Code |
|
|
122
|
+
| `--radius-surface` | 10 | `rounded-surface` | Card, StatCard, DataTableCard, Alert, Accordion trigger, FileUpload dropzone, Tabs list (contained) |
|
|
123
|
+
| `--radius-overlay-sm` | 6 | `rounded-overlay-sm` | Tooltip, Toast, charts internal tooltip |
|
|
124
|
+
| `--radius-overlay` | 10 | `rounded-overlay` | Popover, HoverCard, DropdownMenu / ContextMenu / Menubar content, Select / Combobox / Autocomplete listbox, NavigationMenu viewport, DataTable bulk-actions toolbar, SplitButton dropdown |
|
|
125
|
+
| `--radius-overlay-lg` | 16 | `rounded-overlay-lg` | Dialog, AlertDialog, Sheet (top corners), BottomSheet, ColorInput picker panel, ChatMessageInput wrapper, Sidebar inset variant |
|
|
126
|
+
| `--radius-pill` | 9999 | `rounded-pill` | Badge, BadgeIndicator, StatusDot, Radio, Switch, Slider, Progress, Avatar circle, SegmentedControl item, ChatMessage reaction button, drag handles |
|
|
127
|
+
| `--radius-bubble` | 24 | `rounded-bubble` | ChatMessage bubble |
|
|
128
|
+
|
|
129
|
+
Bare `rounded-ds-*` and `rounded-full` are BANNED in components (enforced by pre-publish audit gate). Token-showcase stories (`forced-colors.stories.tsx`, `FoundationsShowcase.tsx`) are explicitly allowlisted.
|
|
130
|
+
|
|
131
|
+
### Shape presets — `[data-shape]`
|
|
132
|
+
|
|
133
|
+
Apply to `<html>`, app root, or any subtree. Three presets ship by default:
|
|
134
|
+
|
|
135
|
+
| Preset | control / control-inner | surface | overlay-sm / overlay / overlay-lg | bubble | Feel |
|
|
136
|
+
|---|---|---|---|---|---|
|
|
137
|
+
| `sharp` | 2 / 0 | 4 | 2 / 4 / 6 | 8 | Vercel / Linear / dev-tool |
|
|
138
|
+
| `slightly-rounded` (default) | 6 / 2 | 10 | 6 / 10 / 16 | 24 | shadcn / Stripe / Notion sidebar |
|
|
139
|
+
| `rounded` | 10 / 4 | 16 | 10 / 16 / 24 | 32 | iOS / Notion content / consumer |
|
|
140
|
+
|
|
141
|
+
```html
|
|
142
|
+
<!-- Whole-app preset -->
|
|
143
|
+
<html data-shape="sharp">
|
|
144
|
+
|
|
145
|
+
<!-- Or scoped per subtree -->
|
|
146
|
+
<div data-shape="rounded">...</div>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`--radius-pill` stays `9999px` in every preset by design — pill shapes are shape-by-meaning, not shape-by-style.
|
|
150
|
+
|
|
151
|
+
### Per-token consumer overrides
|
|
152
|
+
|
|
153
|
+
Override any role globally or scoped:
|
|
154
|
+
|
|
155
|
+
```css
|
|
156
|
+
:root { --radius-control: 4px; } /* tighten controls only */
|
|
157
|
+
.checkout { --radius-control: 8px; --radius-surface: 20px; } /* per-subtree */
|
|
158
|
+
[data-shape="rounded"] .admin { --radius-control: 6px; } /* extend a preset */
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Custom preset
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
[data-shape="brand-soft"] {
|
|
165
|
+
--radius-control: 8px;
|
|
166
|
+
--radius-control-inner: 3px;
|
|
167
|
+
--radius-surface: 14px;
|
|
168
|
+
--radius-overlay-sm: 8px;
|
|
169
|
+
--radius-overlay: 14px;
|
|
170
|
+
--radius-overlay-lg: 20px;
|
|
171
|
+
--radius-pill: 9999px;
|
|
172
|
+
--radius-bubble: 28px;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<html data-shape="brand-soft">
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Migration from `rounded-ds-*` / `rounded-full`
|
|
181
|
+
|
|
182
|
+
```diff
|
|
183
|
+
- className="rounded-ds-md ..." → + className="rounded-control ..."
|
|
184
|
+
- className="rounded-ds-lg ..." → + className="rounded-surface ..." /* card/panel context */
|
|
185
|
+
- className="rounded-ds-lg ..." → + className="rounded-overlay ..." /* popover/dropdown context */
|
|
186
|
+
- className="rounded-ds-xl ..." → + className="rounded-overlay-lg ..." /* dialog/sheet */
|
|
187
|
+
- className="rounded-ds-2xl ..." → + className="rounded-bubble ..."
|
|
188
|
+
- className="rounded-ds-sm ..." → + className="rounded-control-inner ..."
|
|
189
|
+
- className="rounded-ds-full ..." → + className="rounded-pill ..."
|
|
190
|
+
- className="rounded-full ..." → + className="rounded-pill ..."
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Re-runnable codemod: `scripts/migrate-radius-roles.mjs` (dry-run by default, `--write` to apply).
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
108
197
|
## Architecture Notes
|
|
109
198
|
|
|
110
199
|
### The Two-Axis Variant System
|
|
@@ -2943,6 +3032,92 @@ const { size, stroke } = useIconContext()
|
|
|
2943
3032
|
|
|
2944
3033
|
### v0.1.0
|
|
2945
3034
|
- **Added** Initial release
|
|
3035
|
+
# OAuthButton
|
|
3036
|
+
|
|
3037
|
+
- Import: @devalok/shilp-sutra/ui/oauth-button
|
|
3038
|
+
- Server-safe: No
|
|
3039
|
+
- Category: ui
|
|
3040
|
+
|
|
3041
|
+
## Exports
|
|
3042
|
+
- `OAuthButton` — primary brand-aware sign-in button
|
|
3043
|
+
- `OAuthGroup` — stacked layout wrapper with consistent spacing
|
|
3044
|
+
- `OAuthDivider` — `or`-style horizontal rule between OAuth row and email form
|
|
3045
|
+
- `OAuthConnectionRow` — settings-page row for a linked provider (Disconnect / Connect action)
|
|
3046
|
+
|
|
3047
|
+
## OAuthButton props
|
|
3048
|
+
provider: "google" | "apple" | "github" | "microsoft" | "x" | "linkedin" | "facebook" | "discord" | "slack" | "gitlab" | "sso" | "email" | "passkey" (required)
|
|
3049
|
+
intent: "continue" | "signin" | "signup" (default "continue") — drives the verb in the label
|
|
3050
|
+
appearance: "brand" | "outline" | "dark" (default "brand") — visual treatment
|
|
3051
|
+
icon: ReactNode — override the default Tabler glyph with a brand-multicolour SVG
|
|
3052
|
+
iconOnly: boolean — compact icon-only button; provider name preserved in aria-label
|
|
3053
|
+
compact: boolean — short label ("Google" not "Continue with Google"); aria-label keeps long form
|
|
3054
|
+
lastUsed: boolean — inline right-edge pill inside the button (a stronger pattern is reorder, below)
|
|
3055
|
+
helperText: ReactNode — reassurance copy rendered below the button
|
|
3056
|
+
children: ReactNode — override the default label entirely (i18n / custom copy)
|
|
3057
|
+
size: inherited from Button ("xs" | "sm" | "md" | "lg" | compact + icon variants)
|
|
3058
|
+
fullWidth, loading, onClick, onClickAsync, asyncFeedbackDuration, disabled — inherited from Button
|
|
3059
|
+
|
|
3060
|
+
## Data attributes
|
|
3061
|
+
- `data-provider="<provider>"` — useful for analytics filtering
|
|
3062
|
+
- `data-oauth-appearance="<appearance>"`
|
|
3063
|
+
|
|
3064
|
+
## OAuthGroup props
|
|
3065
|
+
orientation: "vertical" | "horizontal" (default "vertical")
|
|
3066
|
+
gap: "ds-02" | "ds-03" | "ds-04" (default "ds-03")
|
|
3067
|
+
fullWidth: boolean (default true) — stretches children to fill width when vertical
|
|
3068
|
+
reorderLastUsedFirst: boolean (default false) — pull the child with lastUsed to position 0
|
|
3069
|
+
(Stripe-style — a stronger conversion lever than a visual badge alone)
|
|
3070
|
+
|
|
3071
|
+
## OAuthDivider props
|
|
3072
|
+
label: ReactNode (default "or")
|
|
3073
|
+
|
|
3074
|
+
## OAuthConnectionRow props
|
|
3075
|
+
provider: OAuthProvider (required)
|
|
3076
|
+
connected: boolean (required)
|
|
3077
|
+
accountLabel: ReactNode — account identifier shown next to the provider name (e.g. email)
|
|
3078
|
+
onAction: (e) => void — synchronous click handler
|
|
3079
|
+
onActionAsync: (e) => Promise<void> — uses Button's async state machine
|
|
3080
|
+
actionLabel: ReactNode — override the "Disconnect" / "Connect <name>" copy
|
|
3081
|
+
icon: ReactNode — override the default glyph
|
|
3082
|
+
disabled: boolean
|
|
3083
|
+
|
|
3084
|
+
## Defaults
|
|
3085
|
+
intent="continue", appearance="brand", iconOnly=false, lastUsed=false
|
|
3086
|
+
|
|
3087
|
+
## Example
|
|
3088
|
+
```jsx
|
|
3089
|
+
// Typical signup flow
|
|
3090
|
+
<OAuthGroup>
|
|
3091
|
+
<OAuthButton provider="google" lastUsed />
|
|
3092
|
+
<OAuthButton provider="apple" />
|
|
3093
|
+
<OAuthButton provider="github" />
|
|
3094
|
+
</OAuthGroup>
|
|
3095
|
+
<OAuthDivider />
|
|
3096
|
+
<OAuthGroup>
|
|
3097
|
+
<OAuthButton provider="passkey" appearance="outline" />
|
|
3098
|
+
<OAuthButton provider="email" appearance="outline" />
|
|
3099
|
+
</OAuthGroup>
|
|
3100
|
+
|
|
3101
|
+
// Async loading + success/error feedback
|
|
3102
|
+
<OAuthButton provider="google" fullWidth onClickAsync={signInWithGoogle} />
|
|
3103
|
+
|
|
3104
|
+
// True brand-multicolour glyph from the provider's brand page
|
|
3105
|
+
<OAuthButton provider="google" icon={<GoogleGSvg />} />
|
|
3106
|
+
|
|
3107
|
+
// Settings page — linked state
|
|
3108
|
+
<OAuthConnectionRow
|
|
3109
|
+
provider="google"
|
|
3110
|
+
connected
|
|
3111
|
+
accountLabel="namaskar@devalok.in"
|
|
3112
|
+
onAction={disconnectGoogle}
|
|
3113
|
+
/>
|
|
3114
|
+
```
|
|
3115
|
+
|
|
3116
|
+
## Composability
|
|
3117
|
+
- **Built on Button.** Async state machine, loading/processing, sizes, and `fullWidth` are inherited. `variant` and `color` are managed internally — pass `appearance` instead.
|
|
3118
|
+
- **Tabler peer dep.** Default glyphs come from `@tabler/icons-react`. To match a provider's official multicolour mark, pass `icon={<YourSvg />}`.
|
|
3119
|
+
- **Brand-colour backgrounds.** `appearance="brand"` uses each provider's published button colour. `appearance="outline"` falls back to DS-neutral. `appearance="dark"` unifies every provider into an Apple-style black-on-white (light) / white-on-black (dark) treatment — useful when you want a row to feel visually consistent across providers.
|
|
3120
|
+
- **Last-used hint.** Storage is the consumer's responsibility — pass `lastUsed={user.lastProvider === 'google'}`.
|
|
2946
3121
|
# Pagination
|
|
2947
3122
|
|
|
2948
3123
|
- Import: @devalok/shilp-sutra/ui/pagination
|