@fragments-sdk/ui 0.8.5 → 0.8.7
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/fragments.json +1 -1
- package/package.json +2 -2
- package/src/blocks/AccountSettings.block.ts +1 -1
- package/src/blocks/ActivityFeed.block.ts +1 -1
- package/src/blocks/ChatInterface.block.ts +1 -1
- package/src/blocks/ChatMessages.block.ts +1 -1
- package/src/blocks/CheckoutForm.block.ts +1 -1
- package/src/blocks/ContactForm.block.ts +1 -1
- package/src/blocks/DashboardLayout.block.ts +1 -1
- package/src/blocks/DashboardPage.block.ts +1 -1
- package/src/blocks/DataTable.block.ts +1 -1
- package/src/blocks/EmptyState.block.ts +1 -1
- package/src/blocks/FAQSection.block.ts +1 -1
- package/src/blocks/FeatureGrid.block.ts +1 -1
- package/src/blocks/HeroSection.block.ts +1 -1
- package/src/blocks/LoginForm.block.ts +1 -1
- package/src/blocks/NavigationHeader.block.ts +1 -1
- package/src/blocks/PricingComparison.block.ts +1 -1
- package/src/blocks/ProductCard.block.ts +1 -1
- package/src/blocks/RegistrationForm.block.ts +1 -1
- package/src/blocks/SettingsPanel.block.ts +1 -1
- package/src/blocks/ShoppingCart.block.ts +1 -1
- package/src/blocks/StatsCard.block.ts +1 -1
- package/src/blocks/ThinkingStates.block.ts +1 -1
- package/src/components/Accordion/Accordion.fragment.tsx +1 -1
- package/src/components/Alert/Alert.fragment.tsx +1 -1
- package/src/components/AppShell/AppShell.fragment.tsx +11 -11
- package/src/components/Avatar/Avatar.fragment.tsx +1 -1
- package/src/components/Avatar/index.tsx +9 -1
- package/src/components/Badge/Badge.fragment.tsx +1 -1
- package/src/components/Box/Box.fragment.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumbs.fragment.tsx +1 -1
- package/src/components/Button/Button.fragment.tsx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.fragment.tsx +1 -1
- package/src/components/Card/Card.fragment.tsx +1 -1
- package/src/components/Chart/Chart.fragment.tsx +1 -1
- package/src/components/Checkbox/Checkbox.fragment.tsx +1 -1
- package/src/components/Chip/Chip.fragment.tsx +1 -1
- package/src/components/Chip/index.tsx +2 -0
- package/src/components/CodeBlock/CodeBlock.fragment.tsx +1 -1
- package/src/components/Collapsible/Collapsible.fragment.tsx +1 -1
- package/src/components/ColorPicker/ColorPicker.fragment.tsx +1 -1
- package/src/components/ColorPicker/index.tsx +2 -0
- package/src/components/Combobox/Combobox.fragment.tsx +1 -1
- package/src/components/Combobox/index.tsx +2 -0
- package/src/components/ConversationList/ConversationList.fragment.tsx +1 -1
- package/src/components/DatePicker/DatePicker.fragment.tsx +10 -9
- package/src/components/DatePicker/index.tsx +2 -0
- package/src/components/Dialog/Dialog.fragment.tsx +1 -1
- package/src/components/EmptyState/EmptyState.fragment.tsx +1 -1
- package/src/components/Field/Field.fragment.tsx +1 -1
- package/src/components/Fieldset/Fieldset.fragment.tsx +1 -1
- package/src/components/Form/Form.fragment.tsx +1 -1
- package/src/components/Grid/Grid.fragment.tsx +1 -1
- package/src/components/Header/Header.fragment.tsx +1 -1
- package/src/components/Icon/Icon.fragment.tsx +1 -1
- package/src/components/Image/Image.fragment.tsx +1 -1
- package/src/components/Image/index.tsx +10 -0
- package/src/components/Input/Input.fragment.tsx +1 -1
- package/src/components/Input/index.tsx +2 -0
- package/src/components/Link/Link.fragment.tsx +1 -1
- package/src/components/List/List.fragment.tsx +1 -1
- package/src/components/Listbox/Listbox.fragment.tsx +1 -1
- package/src/components/Listbox/index.tsx +6 -1
- package/src/components/Loading/Loading.fragment.tsx +1 -1
- package/src/components/Markdown/Markdown.fragment.tsx +1 -1
- package/src/components/Menu/Menu.fragment.tsx +55 -5
- package/src/components/Menu/Menu.module.scss +21 -10
- package/src/components/Menu/Menu.test.tsx +126 -3
- package/src/components/Menu/index.tsx +85 -11
- package/src/components/Message/Message.fragment.tsx +1 -1
- package/src/components/Message/Message.module.scss +2 -1
- package/src/components/NavigationMenu/NavigationMenu.fragment.tsx +1 -1
- package/src/components/NavigationMenu/index.tsx +1 -0
- package/src/components/Popover/Popover.fragment.tsx +1 -1
- package/src/components/Progress/Progress.fragment.tsx +1 -1
- package/src/components/Prompt/Prompt.fragment.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.fragment.tsx +1 -1
- package/src/components/ScrollArea/ScrollArea.fragment.tsx +1 -1
- package/src/components/ScrollArea/index.tsx +2 -0
- package/src/components/Select/Select.fragment.tsx +1 -1
- package/src/components/Select/index.tsx +2 -0
- package/src/components/Separator/Separator.fragment.tsx +1 -1
- package/src/components/Sidebar/Sidebar.fragment.tsx +2 -2
- package/src/components/Sidebar/index.tsx +2 -0
- package/src/components/Skeleton/Skeleton.fragment.tsx +1 -1
- package/src/components/Slider/Slider.fragment.tsx +1 -1
- package/src/components/Slider/index.tsx +2 -0
- package/src/components/Stack/Stack.fragment.tsx +1 -1
- package/src/components/Table/Table.fragment.tsx +1 -1
- package/src/components/Table/index.tsx +2 -0
- package/src/components/TableOfContents/TableOfContents.fragment.tsx +1 -1
- package/src/components/Tabs/Tabs.fragment.tsx +1 -1
- package/src/components/Text/Text.fragment.tsx +1 -1
- package/src/components/Textarea/Textarea.fragment.tsx +1 -1
- package/src/components/Theme/Theme.fragment.tsx +1 -1
- package/src/components/ThinkingIndicator/ThinkingIndicator.fragment.tsx +1 -1
- package/src/components/Toast/Toast.fragment.tsx +1 -1
- package/src/components/Toast/index.tsx +2 -0
- package/src/components/Toggle/Toggle.fragment.tsx +1 -1
- package/src/components/ToggleGroup/ToggleGroup.fragment.tsx +1 -1
- package/src/components/Tooltip/Tooltip.fragment.tsx +1 -1
- package/src/components/VisuallyHidden/VisuallyHidden.fragment.tsx +1 -1
- package/src/styles/globals.scss +65 -7
- package/src/tokens/_computed.scss +1 -1
- package/src/tokens/_density.scss +1 -1
- package/src/tokens/_derive.scss +1 -1
- package/src/tokens/_index.scss +1 -1
- package/src/tokens/_mixins.scss +1 -1
- package/src/tokens/_palettes.scss +1 -1
- package/src/tokens/_radius.scss +1 -1
- package/src/tokens/_seeds.scss +1 -1
- package/src/tokens/_variables.scss +2 -2
- package/src/utils/a11y.tsx +2 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { defineFragment } from '@fragments/core';
|
|
2
|
+
import { defineFragment } from '@fragments-sdk/cli/core';
|
|
3
3
|
import { Sidebar, SidebarProvider, useSidebar } from '.';
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
|
|
@@ -81,7 +81,7 @@ const mainContentStyle: React.CSSProperties = {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
const demoContainerStyle: React.CSSProperties = {
|
|
84
|
-
|
|
84
|
+
minHeight: '100vh',
|
|
85
85
|
display: 'flex',
|
|
86
86
|
width: '100%',
|
|
87
87
|
};
|
package/src/styles/globals.scss
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// ============================================
|
|
2
|
-
// @fragments/ui Global Styles
|
|
2
|
+
// @fragments-sdk/ui Global Styles
|
|
3
3
|
// ============================================
|
|
4
4
|
// Import this file once in your app to set up CSS custom properties
|
|
5
|
-
// for theming
|
|
5
|
+
// for theming, plus base element resets for consistent rendering.
|
|
6
6
|
//
|
|
7
7
|
// Usage in your app:
|
|
8
|
-
// import '@fragments/ui/styles/globals.scss';
|
|
8
|
+
// import '@fragments-sdk/ui/styles/globals.scss';
|
|
9
9
|
//
|
|
10
10
|
// Or in SCSS:
|
|
11
|
-
// @use '@fragments/ui/styles/globals';
|
|
11
|
+
// @use '@fragments-sdk/ui/styles/globals';
|
|
12
12
|
// ============================================
|
|
13
13
|
|
|
14
14
|
@use '../tokens/variables' as *;
|
|
@@ -16,11 +16,70 @@
|
|
|
16
16
|
// Output all CSS custom properties
|
|
17
17
|
@include fui-css-variables;
|
|
18
18
|
|
|
19
|
+
// ============================================
|
|
20
|
+
// Box-Sizing Reset
|
|
21
|
+
// ============================================
|
|
22
|
+
|
|
23
|
+
*,
|
|
24
|
+
*::before,
|
|
25
|
+
*::after {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ============================================
|
|
30
|
+
// Base Element Resets
|
|
31
|
+
// ============================================
|
|
32
|
+
|
|
33
|
+
html {
|
|
34
|
+
scroll-behavior: smooth;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
body {
|
|
38
|
+
margin: 0;
|
|
39
|
+
font-family: var(--fui-font-sans, Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
|
|
40
|
+
background-color: var(--fui-bg-primary, #ffffff);
|
|
41
|
+
color: var(--fui-text-primary, #171717);
|
|
42
|
+
-webkit-font-smoothing: antialiased;
|
|
43
|
+
-moz-osx-font-smoothing: grayscale;
|
|
44
|
+
font-feature-settings: "rlig" 1, "calt" 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
*::selection {
|
|
48
|
+
background-color: var(--fui-color-success-bg, rgba(16, 163, 127, 0.1));
|
|
49
|
+
color: var(--fui-text-primary, #171717);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ============================================
|
|
53
|
+
// Scrollbar Styles
|
|
54
|
+
// ============================================
|
|
55
|
+
|
|
56
|
+
::-webkit-scrollbar {
|
|
57
|
+
width: 6px;
|
|
58
|
+
height: 6px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
::-webkit-scrollbar-track {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
::-webkit-scrollbar-thumb {
|
|
66
|
+
background-color: var(--fui-text-tertiary, #8a8a8a);
|
|
67
|
+
border-radius: 9999px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
::-webkit-scrollbar-thumb:hover {
|
|
71
|
+
background-color: var(--fui-text-secondary, #525252);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Firefox scrollbar
|
|
75
|
+
* {
|
|
76
|
+
scrollbar-width: thin;
|
|
77
|
+
scrollbar-color: var(--fui-text-tertiary, #8a8a8a) transparent;
|
|
78
|
+
}
|
|
79
|
+
|
|
19
80
|
// ============================================
|
|
20
81
|
// Accessibility: Reduced Motion
|
|
21
82
|
// ============================================
|
|
22
|
-
// Respects user's system preference for reduced motion.
|
|
23
|
-
// Disables animations and transitions globally when enabled.
|
|
24
83
|
|
|
25
84
|
@media (prefers-reduced-motion: reduce) {
|
|
26
85
|
*,
|
|
@@ -36,7 +95,6 @@
|
|
|
36
95
|
// ============================================
|
|
37
96
|
// Accessibility: Focus Visible
|
|
38
97
|
// ============================================
|
|
39
|
-
// Ensures focus indicators are only shown for keyboard navigation
|
|
40
98
|
|
|
41
99
|
:focus:not(:focus-visible) {
|
|
42
100
|
outline: none;
|
package/src/tokens/_density.scss
CHANGED
package/src/tokens/_derive.scss
CHANGED
package/src/tokens/_index.scss
CHANGED
package/src/tokens/_mixins.scss
CHANGED
package/src/tokens/_radius.scss
CHANGED
package/src/tokens/_seeds.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ============================================
|
|
2
|
-
// @fragments/ui Design Tokens
|
|
2
|
+
// @fragments-sdk/ui Design Tokens
|
|
3
3
|
// ============================================
|
|
4
4
|
//
|
|
5
5
|
// SEED-BASED DESIGN SYSTEM
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
//
|
|
22
22
|
// Example:
|
|
23
23
|
// $fui-color-accent: #0066ff;
|
|
24
|
-
// @use '@fragments/ui/tokens';
|
|
24
|
+
// @use '@fragments-sdk/ui/tokens';
|
|
25
25
|
//
|
|
26
26
|
// Or use CSS custom properties for runtime theming.
|
|
27
27
|
// ============================================
|
package/src/utils/a11y.tsx
CHANGED
|
@@ -143,11 +143,7 @@ export function useAnnounce(): {
|
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
145
|
export function usePrefersReducedMotion(): boolean {
|
|
146
|
-
const [prefersReducedMotion, setPrefersReducedMotion] = React.useState(
|
|
147
|
-
// SSR-safe default
|
|
148
|
-
if (typeof window === 'undefined') return false;
|
|
149
|
-
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
150
|
-
});
|
|
146
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = React.useState(false);
|
|
151
147
|
|
|
152
148
|
React.useEffect(() => {
|
|
153
149
|
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
@@ -184,11 +180,7 @@ export function usePrefersReducedMotion(): boolean {
|
|
|
184
180
|
* ```
|
|
185
181
|
*/
|
|
186
182
|
export function usePrefersContrast(): boolean {
|
|
187
|
-
const [prefersContrast, setPrefersContrast] = React.useState(
|
|
188
|
-
// SSR-safe default
|
|
189
|
-
if (typeof window === 'undefined') return false;
|
|
190
|
-
return window.matchMedia('(prefers-contrast: more)').matches;
|
|
191
|
-
});
|
|
183
|
+
const [prefersContrast, setPrefersContrast] = React.useState(false);
|
|
192
184
|
|
|
193
185
|
React.useEffect(() => {
|
|
194
186
|
const mediaQuery = window.matchMedia('(prefers-contrast: more)');
|