@fragments-sdk/ui 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +13 -3
  2. package/fragments.json +1 -1
  3. package/package.json +4 -2
  4. package/src/blocks/ChatInterface.block.ts +3 -3
  5. package/src/blocks/DashboardLayout.block.ts +1 -1
  6. package/src/blocks/DashboardPage.block.ts +4 -3
  7. package/src/blocks/EmptyState.block.ts +4 -4
  8. package/src/blocks/SettingsPanel.block.ts +4 -4
  9. package/src/components/Accordion/Accordion.fragment.tsx +67 -1
  10. package/src/components/Alert/Alert.fragment.tsx +69 -1
  11. package/src/components/Alert/Alert.module.scss +7 -3
  12. package/src/components/AppShell/AppShell.fragment.tsx +341 -101
  13. package/src/components/AppShell/AppShell.module.scss +18 -19
  14. package/src/components/AppShell/index.tsx +37 -12
  15. package/src/components/Avatar/Avatar.fragment.tsx +35 -2
  16. package/src/components/Badge/Badge.fragment.tsx +47 -9
  17. package/src/components/Badge/Badge.module.scss +1 -0
  18. package/src/components/Breadcrumbs/Breadcrumbs.fragment.tsx +1 -1
  19. package/src/components/Breadcrumbs/Breadcrumbs.module.scss +3 -0
  20. package/src/components/Button/Button.fragment.tsx +1 -1
  21. package/src/components/Checkbox/Checkbox.fragment.tsx +4 -4
  22. package/src/components/Checkbox/Checkbox.module.scss +7 -7
  23. package/src/components/Checkbox/index.tsx +6 -1
  24. package/src/components/Chip/Chip.fragment.tsx +1 -1
  25. package/src/components/CodeBlock/CodeBlock.fragment.tsx +10 -2
  26. package/src/components/CodeBlock/CodeBlock.module.scss +48 -11
  27. package/src/components/CodeBlock/CodeBlock.test.tsx +51 -1
  28. package/src/components/CodeBlock/index.tsx +221 -3
  29. package/src/components/ColorPicker/ColorPicker.fragment.tsx +1 -1
  30. package/src/components/ColorPicker/ColorPicker.module.scss +8 -7
  31. package/src/components/Combobox/Combobox.fragment.tsx +1 -1
  32. package/src/components/Combobox/Combobox.module.scss +1 -3
  33. package/src/components/Field/index.tsx +1 -1
  34. package/src/components/Form/Form.fragment.tsx +4 -4
  35. package/src/components/Header/Header.fragment.tsx +8 -8
  36. package/src/components/Input/Input.fragment.tsx +1 -1
  37. package/src/components/Message/Message.module.scss +3 -3
  38. package/src/components/Popover/Popover.fragment.tsx +1 -1
  39. package/src/components/Popover/Popover.module.scss +1 -3
  40. package/src/components/Prompt/Prompt.module.scss +6 -19
  41. package/src/components/Prompt/Prompt.test.tsx +8 -0
  42. package/src/components/Prompt/index.tsx +12 -1
  43. package/src/components/RadioGroup/RadioGroup.fragment.tsx +4 -3
  44. package/src/components/RadioGroup/RadioGroup.module.scss +9 -9
  45. package/src/components/RadioGroup/index.tsx +5 -1
  46. package/src/components/Sidebar/Sidebar.module.scss +9 -2
  47. package/src/components/Sidebar/Sidebar.test.tsx +6 -0
  48. package/src/components/Sidebar/index.tsx +4 -1
  49. package/src/components/Slider/Slider.fragment.tsx +2 -2
  50. package/src/components/Slider/Slider.module.scss +2 -0
  51. package/src/components/Switch/index.ts +1 -0
  52. package/src/components/Theme/Theme.fragment.tsx +16 -0
  53. package/src/components/Theme/ThemeToggle.module.scss +4 -3
  54. package/src/components/Toast/Toast.fragment.tsx +1 -0
  55. package/src/components/Toast/Toast.module.scss +9 -4
  56. package/src/components/Toggle/Toggle.fragment.tsx +32 -32
  57. package/src/components/Toggle/Toggle.module.scss +33 -26
  58. package/src/components/Toggle/Toggle.test.tsx +10 -10
  59. package/src/components/Toggle/index.tsx +23 -15
  60. package/src/components/ToggleGroup/ToggleGroup.fragment.tsx +2 -2
  61. package/src/index.ts +6 -1
  62. package/src/tokens/_mixins.scss +14 -0
  63. package/src/tokens/_variables.scss +12 -6
package/README.md CHANGED
@@ -46,7 +46,7 @@ function App() {
46
46
  |-----------|----------|-------------|
47
47
  | Accordion | Layout | Vertically stacked, collapsible content sections. Use for organizing related content that can be progressively disclosed. |
48
48
  | Alert | Feedback | Contextual feedback messages for user actions or system status. Supports multiple severity levels with optional actions and dismissibility. |
49
- | AppShell | Layout | Full layout wrapper integrating sidebar, header, main content, and optional aside panel. Supports two layout modes: stacked (header on top) and sidebar-inset (sidebar full height). |
49
+ | AppShell | Layout | Full layout wrapper integrating sidebar, header, main content, and optional aside panel. Supports three layout modes: default (header on top), sidebar (sidebar full height), and sidebar-floating (rounded main content). |
50
50
  | Avatar | Display | Visual representation of a user or entity |
51
51
  | Badge | Display | Compact label for status, counts, or categorization. Draws attention to metadata without dominating the layout. |
52
52
  | Box | Layout | Primitive layout component for applying spacing, backgrounds, and borders. A flexible container for building custom layouts. |
@@ -55,7 +55,7 @@ function App() {
55
55
  | ButtonGroup | Forms | Groups related buttons together with consistent spacing and alignment. Useful for action bars, toolbars, and related button sets. |
56
56
  | Card | Layout | Container for grouping related content |
57
57
  | Chart | Display | Composable chart wrapper for recharts with theme-aware tooltips, legends, and color integration. |
58
- | Checkbox | Forms | Binary toggle for form fields. Use for options that require explicit submission, unlike Toggle which takes effect immediately. |
58
+ | Checkbox | Forms | Binary toggle for form fields. Use for options that require explicit submission, unlike Switch which takes effect immediately. |
59
59
  | Chip | Forms | Interactive pill-shaped element for filtering, selecting, and tagging. Supports single and multi-select via Chip.Group. |
60
60
  | CodeBlock | Display | Syntax-highlighted code display with copy functionality, theming, diff view, and collapsible sections |
61
61
  | Collapsible | Layout | An interactive component that expands/collapses to show or hide content |
@@ -97,11 +97,21 @@ function App() {
97
97
  | Theme | Navigation | Theme management system with provider, toggle, and hook pattern. Supports light, dark, and system modes with localStorage persistence. |
98
98
  | ThinkingIndicator | Ai | Animated indicator showing AI is processing |
99
99
  | Toast | Feedback | Brief, non-blocking notification messages |
100
- | Toggle | Forms | Binary on/off switch for settings and preferences. Provides immediate visual feedback and is ideal for options that take effect instantly. |
100
+ | Switch | Forms | Binary on/off switch for settings and preferences. Provides immediate visual feedback and is ideal for options that take effect instantly. |
101
101
  | ToggleGroup | Forms | A group of toggle buttons where only one can be selected at a time. Useful for switching between views, modes, or options. |
102
102
  | Tooltip | Feedback | Contextual help text that appears on hover or focus. Perfect for explaining icons, truncated text, or providing additional context. |
103
103
  | VisuallyHidden | Navigation | Hides content visually while keeping it accessible to screen readers. Essential for accessible icon-only buttons and supplementary text. |
104
104
 
105
+ ## Fragment Snippet Authoring
106
+
107
+ All fragment and block previews are authored source snippets, not runtime-serialized JSX.
108
+
109
+ - Add explicit `variant.code` (or block `code`) for every example.
110
+ - Keep snippets as full examples: include imports + renderable JSX.
111
+ - Use Fragments primitives for layout wrappers (`Box`, `Stack`, `Text`) instead of raw HTML wrappers (`div`, `span`, `p`, headings).
112
+ - Do not use inline `style={...}` in snippets or example renders.
113
+ - Do not use alias drift tags (`*Root`, `*2`) in snippet code.
114
+
105
115
  ## Design Tokens
106
116
 
107
117
  ### Seed-Based Configuration (Recommended)