@fragments-sdk/ui 0.11.0 → 0.12.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/README.md +15 -0
- package/dist/assets/ui.css +50 -44
- package/dist/blocks/AccountSettings.block.d.ts +1 -1
- package/dist/blocks/ActivityFeed.block.d.ts +1 -1
- package/dist/blocks/ActivityFeedSkeleton.block.d.ts +1 -1
- package/dist/blocks/BlogEditor.block.d.ts +1 -1
- package/dist/blocks/ChatInterface.block.d.ts +1 -1
- package/dist/blocks/ChatMessages.block.d.ts +1 -1
- package/dist/blocks/CheckoutForm.block.d.ts +1 -1
- package/dist/blocks/CommandPalette.block.d.ts +1 -1
- package/dist/blocks/ContactForm.block.d.ts +1 -1
- package/dist/blocks/DashboardLayout.block.d.ts +1 -1
- package/dist/blocks/DashboardPage.block.d.ts +1 -1
- package/dist/blocks/DashboardSkeleton.block.d.ts +1 -1
- package/dist/blocks/DataTable.block.d.ts +1 -1
- package/dist/blocks/EmptyState.block.d.ts +1 -1
- package/dist/blocks/FAQSection.block.d.ts +1 -1
- package/dist/blocks/FeatureGrid.block.d.ts +1 -1
- package/dist/blocks/HeroSection.block.d.ts +1 -1
- package/dist/blocks/LoginForm.block.d.ts +1 -1
- package/dist/blocks/NavigationHeader.block.d.ts +1 -1
- package/dist/blocks/PaginatedTable.block.d.ts +1 -1
- package/dist/blocks/PricingComparison.block.d.ts +1 -1
- package/dist/blocks/ProductCard.block.d.ts +1 -1
- package/dist/blocks/RegistrationForm.block.d.ts +1 -1
- package/dist/blocks/SettingsDrawer.block.d.ts +1 -1
- package/dist/blocks/SettingsPanel.block.d.ts +1 -1
- package/dist/blocks/ShoppingCart.block.d.ts +1 -1
- package/dist/blocks/StatsCard.block.d.ts +1 -1
- package/dist/blocks/StatsCardSkeleton.block.d.ts +1 -1
- package/dist/blocks/TableSkeleton.block.d.ts +1 -1
- package/dist/blocks/ThinkingStates.block.d.ts +1 -1
- package/dist/codeblock.cjs +44 -11
- package/dist/codeblock.cjs.map +1 -1
- package/dist/codeblock.js +22 -11
- package/dist/codeblock.js.map +1 -1
- package/dist/components/Alert/index.cjs.map +1 -1
- package/dist/components/Alert/index.d.ts +7 -0
- package/dist/components/Alert/index.d.ts.map +1 -1
- package/dist/components/Alert/index.js.map +1 -1
- package/dist/components/AppShell/AppShell.module.scss.cjs +14 -14
- package/dist/components/AppShell/AppShell.module.scss.js +14 -14
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.d.ts +4 -0
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.ts +12 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.cjs +9 -1
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.ts +14 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +9 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.cjs +2 -1
- package/dist/components/Card/index.cjs.map +1 -1
- package/dist/components/Card/index.d.ts +12 -2
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +2 -1
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Checkbox/index.cjs.map +1 -1
- package/dist/components/Checkbox/index.d.ts +6 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Chip/index.cjs +2 -1
- package/dist/components/Chip/index.cjs.map +1 -1
- package/dist/components/Chip/index.d.ts +10 -3
- package/dist/components/Chip/index.d.ts.map +1 -1
- package/dist/components/Chip/index.js +2 -1
- package/dist/components/Chip/index.js.map +1 -1
- package/dist/components/CodeBlock/index.d.ts +1 -1
- package/dist/components/CodeBlock/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.cjs.map +1 -1
- package/dist/components/Dialog/index.d.ts +12 -0
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Dialog/index.js.map +1 -1
- package/dist/components/Drawer/index.cjs +2 -1
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.ts +17 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +2 -1
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Grid/index.cjs +4 -1
- package/dist/components/Grid/index.cjs.map +1 -1
- package/dist/components/Grid/index.d.ts +6 -2
- package/dist/components/Grid/index.d.ts.map +1 -1
- package/dist/components/Grid/index.js +4 -1
- package/dist/components/Grid/index.js.map +1 -1
- package/dist/components/Input/index.cjs.map +1 -1
- package/dist/components/Input/index.d.ts +15 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.ts +9 -0
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RadioGroup/index.cjs.map +1 -1
- package/dist/components/RadioGroup/index.d.ts +4 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.ts +14 -0
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Sidebar/index.cjs +8 -5
- package/dist/components/Sidebar/index.cjs.map +1 -1
- package/dist/components/Sidebar/index.d.ts +4 -6
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +8 -5
- package/dist/components/Sidebar/index.js.map +1 -1
- package/dist/components/Slider/index.cjs +3 -1
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.ts +10 -0
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +3 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Stack/index.cjs +6 -0
- package/dist/components/Stack/index.cjs.map +1 -1
- package/dist/components/Stack/index.d.ts +12 -6
- package/dist/components/Stack/index.d.ts.map +1 -1
- package/dist/components/Stack/index.js +6 -0
- package/dist/components/Stack/index.js.map +1 -1
- package/dist/components/Tabs/index.cjs.map +1 -1
- package/dist/components/Tabs/index.d.ts +13 -1
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/Text.module.scss.cjs +44 -32
- package/dist/components/Text/Text.module.scss.cjs.map +1 -1
- package/dist/components/Text/Text.module.scss.js +44 -32
- package/dist/components/Text/Text.module.scss.js.map +1 -1
- package/dist/components/Text/index.cjs.map +1 -1
- package/dist/components/Text/index.d.ts +18 -3
- package/dist/components/Text/index.d.ts.map +1 -1
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Theme/index.cjs.map +1 -1
- package/dist/components/Theme/index.d.ts +12 -0
- package/dist/components/Theme/index.d.ts.map +1 -1
- package/dist/components/Theme/index.js.map +1 -1
- package/dist/components/Toggle/index.cjs +2 -1
- package/dist/components/Toggle/index.cjs.map +1 -1
- package/dist/components/Toggle/index.d.ts +9 -0
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/Toggle/index.js +2 -1
- package/dist/components/Toggle/index.js.map +1 -1
- package/dist/components/ToggleGroup/index.cjs +4 -1
- package/dist/components/ToggleGroup/index.cjs.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +13 -4
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.js +4 -1
- package/dist/components/ToggleGroup/index.js.map +1 -1
- package/dist/components/Tooltip/index.cjs +8 -4
- package/dist/components/Tooltip/index.cjs.map +1 -1
- package/dist/components/Tooltip/index.d.ts +5 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +8 -4
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/css-warning.cjs +18 -0
- package/dist/utils/css-warning.cjs.map +1 -0
- package/dist/utils/css-warning.d.ts +2 -0
- package/dist/utils/css-warning.d.ts.map +1 -0
- package/dist/utils/css-warning.js +18 -0
- package/dist/utils/css-warning.js.map +1 -0
- package/fragments.json +1 -1
- package/package.json +2 -2
- package/src/components/Alert/index.tsx +7 -0
- package/src/components/AppShell/AppShell.module.scss +12 -13
- package/src/components/Avatar/index.tsx +4 -0
- package/src/components/Badge/Badge.fragment.tsx +10 -2
- package/src/components/Badge/index.tsx +12 -0
- package/src/components/Button/Button.fragment.tsx +12 -2
- package/src/components/Button/Button.test.tsx +16 -0
- package/src/components/Button/index.tsx +27 -2
- package/src/components/Card/Card.fragment.tsx +14 -2
- package/src/components/Card/Card.test.tsx +5 -0
- package/src/components/Card/index.tsx +15 -2
- package/src/components/Checkbox/index.tsx +6 -1
- package/src/components/Chip/Chip.fragment.tsx +12 -2
- package/src/components/Chip/Chip.test.tsx +5 -0
- package/src/components/Chip/index.tsx +14 -4
- package/src/components/CodeBlock/index.tsx +28 -13
- package/src/components/Dialog/index.tsx +12 -0
- package/src/components/Drawer/index.tsx +18 -1
- package/src/components/Grid/Grid.fragment.tsx +14 -2
- package/src/components/Grid/Grid.test.tsx +6 -0
- package/src/components/Grid/index.tsx +12 -3
- package/src/components/Input/index.tsx +15 -1
- package/src/components/Popover/index.tsx +9 -0
- package/src/components/RadioGroup/index.tsx +4 -0
- package/src/components/Select/index.tsx +14 -0
- package/src/components/Sidebar/index.tsx +9 -8
- package/src/components/Slider/Slider.fragment.tsx +5 -1
- package/src/components/Slider/Slider.test.tsx +6 -0
- package/src/components/Slider/index.tsx +13 -1
- package/src/components/Stack/Stack.fragment.tsx +22 -2
- package/src/components/Stack/Stack.test.tsx +6 -0
- package/src/components/Stack/index.tsx +20 -6
- package/src/components/Tabs/index.tsx +13 -1
- package/src/components/Text/Text.fragment.tsx +10 -8
- package/src/components/Text/Text.module.scss +8 -2
- package/src/components/Text/Text.test.tsx +15 -0
- package/src/components/Text/index.tsx +18 -3
- package/src/components/Theme/index.tsx +12 -0
- package/src/components/Toggle/Toggle.fragment.tsx +5 -1
- package/src/components/Toggle/Toggle.test.tsx +19 -0
- package/src/components/Toggle/index.tsx +11 -1
- package/src/components/ToggleGroup/ToggleGroup.fragment.tsx +5 -2
- package/src/components/ToggleGroup/ToggleGroup.test.tsx +20 -0
- package/src/components/ToggleGroup/index.tsx +15 -4
- package/src/components/Tooltip/index.tsx +14 -4
- package/src/index.ts +6 -0
- package/src/tokens/_seeds.scss +5 -3
- package/src/tokens/_variables.scss +2 -0
- package/src/utils/css-warning.ts +29 -0
package/README.md
CHANGED
|
@@ -29,6 +29,15 @@ import '@fragments-sdk/ui/styles'; // component styles (ui.css)
|
|
|
29
29
|
import './styles/globals.scss'; // your seed overrides
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
**Next.js users** — add `transpilePackages` to your `next.config.js`:
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
// next.config.js
|
|
36
|
+
const nextConfig = {
|
|
37
|
+
transpilePackages: ['@fragments-sdk/ui'],
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
32
41
|
Then use components:
|
|
33
42
|
|
|
34
43
|
```tsx
|
|
@@ -279,6 +288,12 @@ npm install @fragments-sdk/ui @fragments-sdk/mcp
|
|
|
279
288
|
|
|
280
289
|
The MCP server automatically discovers `fragments.json` from the installed `@fragments-sdk/ui` package. No configuration needed.
|
|
281
290
|
|
|
291
|
+
Or use the CLI to set up everything at once:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
npx @fragments-sdk/cli setup --mcp
|
|
295
|
+
```
|
|
296
|
+
|
|
282
297
|
## Composition Blocks
|
|
283
298
|
|
|
284
299
|
The library includes composition blocks — named patterns showing how components wire together for common use cases:
|
package/dist/assets/ui.css
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
--fui-font-weight-normal: 400;
|
|
14
14
|
--fui-font-weight-medium: 500;
|
|
15
15
|
--fui-font-weight-semibold: 600;
|
|
16
|
+
--fui-font-weight-bold: 700;
|
|
16
17
|
--fui-line-height-tight: 1.25;
|
|
17
18
|
--fui-line-height-normal: 1.5;
|
|
18
19
|
--fui-line-height-relaxed: 1.625;
|
|
@@ -5836,7 +5837,7 @@ a {
|
|
|
5836
5837
|
overflow: visible;
|
|
5837
5838
|
outline: none;
|
|
5838
5839
|
box-shadow: 0 0 0 var(--fui-focus-ring-offset, 2px) var(--fui-bg-primary, #ffffff), 0 0 0 calc(var(--fui-focus-ring-offset, 2px) + var(--fui-focus-ring-width, 2px)) var(--fui-focus-ring-color, #18181b);
|
|
5839
|
-
}.
|
|
5840
|
+
}._root_10ypa_1 {
|
|
5840
5841
|
display: grid;
|
|
5841
5842
|
min-height: 100vh;
|
|
5842
5843
|
min-height: 100dvh;
|
|
@@ -5847,7 +5848,7 @@ a {
|
|
|
5847
5848
|
transition: grid-template-columns var(--fui-transition-normal, 200ms) ease;
|
|
5848
5849
|
}
|
|
5849
5850
|
@media (max-width: 767px) {
|
|
5850
|
-
.
|
|
5851
|
+
._root_10ypa_1 {
|
|
5851
5852
|
grid-template-areas: "header" "main" "aside";
|
|
5852
5853
|
grid-template-columns: 1fr;
|
|
5853
5854
|
grid-template-rows: var(--appshell-header-height, 56px) 1fr auto;
|
|
@@ -5855,21 +5856,21 @@ a {
|
|
|
5855
5856
|
}
|
|
5856
5857
|
}
|
|
5857
5858
|
|
|
5858
|
-
.
|
|
5859
|
+
._sidebarLayout_10ypa_20 {
|
|
5859
5860
|
grid-template-areas: "sidebar header header" "sidebar main aside";
|
|
5860
5861
|
}
|
|
5861
5862
|
@media (max-width: 767px) {
|
|
5862
|
-
.
|
|
5863
|
+
._sidebarLayout_10ypa_20 {
|
|
5863
5864
|
grid-template-areas: "header" "main" "aside";
|
|
5864
5865
|
grid-template-columns: 1fr;
|
|
5865
5866
|
}
|
|
5866
5867
|
}
|
|
5867
5868
|
|
|
5868
|
-
.
|
|
5869
|
+
._sidebarFloatingLayout_10ypa_30 {
|
|
5869
5870
|
background-color: var(--fui-bg-primary, #ffffff);
|
|
5870
5871
|
}
|
|
5871
5872
|
|
|
5872
|
-
.
|
|
5873
|
+
._header_10ypa_34 {
|
|
5873
5874
|
grid-area: header;
|
|
5874
5875
|
position: sticky;
|
|
5875
5876
|
top: 0;
|
|
@@ -5878,11 +5879,11 @@ a {
|
|
|
5878
5879
|
background-color: var(--fui-bg-primary, #ffffff);
|
|
5879
5880
|
}
|
|
5880
5881
|
|
|
5881
|
-
.
|
|
5882
|
+
._headerFloating_10ypa_43 {
|
|
5882
5883
|
background-color: var(--fui-bg-primary, #ffffff);
|
|
5883
5884
|
}
|
|
5884
5885
|
|
|
5885
|
-
.
|
|
5886
|
+
._sidebar_10ypa_20 {
|
|
5886
5887
|
grid-area: sidebar;
|
|
5887
5888
|
position: sticky;
|
|
5888
5889
|
top: var(--appshell-header-height, 56px);
|
|
@@ -5892,7 +5893,7 @@ a {
|
|
|
5892
5893
|
overflow: hidden;
|
|
5893
5894
|
}
|
|
5894
5895
|
@media (max-width: 767px) {
|
|
5895
|
-
.
|
|
5896
|
+
._sidebar_10ypa_20 {
|
|
5896
5897
|
position: fixed;
|
|
5897
5898
|
top: 0;
|
|
5898
5899
|
left: 0;
|
|
@@ -5902,77 +5903,76 @@ a {
|
|
|
5902
5903
|
height: 100dvh;
|
|
5903
5904
|
z-index: 51;
|
|
5904
5905
|
}
|
|
5905
|
-
.
|
|
5906
|
+
._sidebar_10ypa_20 > .root {
|
|
5906
5907
|
width: var(--appshell-sidebar-expanded-width, 240px);
|
|
5907
5908
|
}
|
|
5908
5909
|
}
|
|
5909
|
-
.
|
|
5910
|
+
._sidebar_10ypa_20 .root {
|
|
5910
5911
|
height: 100%;
|
|
5911
5912
|
}
|
|
5912
5913
|
@media (max-width: 767px) {
|
|
5913
|
-
.
|
|
5914
|
+
._sidebar_10ypa_20 .root {
|
|
5914
5915
|
height: 100vh;
|
|
5915
5916
|
height: 100dvh;
|
|
5916
5917
|
}
|
|
5917
5918
|
}
|
|
5918
5919
|
|
|
5919
|
-
.
|
|
5920
|
+
._sidebarFullHeight_10ypa_81 {
|
|
5920
5921
|
top: 0;
|
|
5921
5922
|
height: 100vh;
|
|
5922
5923
|
height: 100dvh;
|
|
5923
5924
|
z-index: var(--fui-header-z-index, 40);
|
|
5924
5925
|
}
|
|
5925
|
-
.
|
|
5926
|
+
._sidebarFullHeight_10ypa_81 .root {
|
|
5926
5927
|
height: 100%;
|
|
5927
5928
|
}
|
|
5928
5929
|
|
|
5929
|
-
.
|
|
5930
|
+
._sidebarFloating_10ypa_30 .root {
|
|
5930
5931
|
background-color: var(--fui-bg-primary, #ffffff);
|
|
5931
5932
|
}
|
|
5932
5933
|
|
|
5933
|
-
.
|
|
5934
|
+
._main_10ypa_95 {
|
|
5934
5935
|
grid-area: main;
|
|
5935
5936
|
min-height: 0;
|
|
5936
5937
|
min-width: 0;
|
|
5937
5938
|
background-color: var(--fui-bg-primary, #ffffff);
|
|
5938
|
-
overflow-x: hidden;
|
|
5939
5939
|
}
|
|
5940
5940
|
|
|
5941
|
-
.
|
|
5941
|
+
._mainFloating_10ypa_102 {
|
|
5942
5942
|
border-radius: var(--fui-radius-xl, 0.857rem);
|
|
5943
5943
|
background-color: var(--fui-bg-secondary, #f4f4f5);
|
|
5944
5944
|
overflow: hidden;
|
|
5945
5945
|
}
|
|
5946
5946
|
@media (max-width: 767px) {
|
|
5947
|
-
.
|
|
5947
|
+
._mainFloating_10ypa_102 {
|
|
5948
5948
|
border-radius: var(--fui-radius-lg, 0.571rem);
|
|
5949
5949
|
width: 100%;
|
|
5950
5950
|
}
|
|
5951
5951
|
}
|
|
5952
5952
|
|
|
5953
|
-
.
|
|
5953
|
+
._paddingSm_10ypa_114 {
|
|
5954
5954
|
padding: var(--fui-padding-container-sm);
|
|
5955
5955
|
}
|
|
5956
5956
|
|
|
5957
|
-
.
|
|
5957
|
+
._paddingMd_10ypa_118 {
|
|
5958
5958
|
padding: var(--fui-padding-container-md);
|
|
5959
5959
|
}
|
|
5960
5960
|
@media (min-width: 768px) {
|
|
5961
|
-
.
|
|
5961
|
+
._paddingMd_10ypa_118 {
|
|
5962
5962
|
padding: var(--fui-padding-container-lg);
|
|
5963
5963
|
}
|
|
5964
5964
|
}
|
|
5965
5965
|
|
|
5966
|
-
.
|
|
5966
|
+
._paddingLg_10ypa_127 {
|
|
5967
5967
|
padding: var(--fui-padding-container-lg);
|
|
5968
5968
|
}
|
|
5969
5969
|
@media (min-width: 768px) {
|
|
5970
|
-
.
|
|
5970
|
+
._paddingLg_10ypa_127 {
|
|
5971
5971
|
padding: var(--fui-padding-container-xl);
|
|
5972
5972
|
}
|
|
5973
5973
|
}
|
|
5974
5974
|
|
|
5975
|
-
.
|
|
5975
|
+
._aside_10ypa_136 {
|
|
5976
5976
|
grid-area: aside;
|
|
5977
5977
|
position: sticky;
|
|
5978
5978
|
top: var(--appshell-header-height, 56px);
|
|
@@ -5985,7 +5985,7 @@ a {
|
|
|
5985
5985
|
overflow: hidden;
|
|
5986
5986
|
}
|
|
5987
5987
|
@media (max-width: 767px) {
|
|
5988
|
-
.
|
|
5988
|
+
._aside_10ypa_136 {
|
|
5989
5989
|
position: static;
|
|
5990
5990
|
width: 100%;
|
|
5991
5991
|
height: auto;
|
|
@@ -6122,13 +6122,13 @@ a {
|
|
|
6122
6122
|
._separator_ixv42_121[data-orientation=vertical] {
|
|
6123
6123
|
width: 1px;
|
|
6124
6124
|
align-self: stretch;
|
|
6125
|
-
}.
|
|
6125
|
+
}._text_yt586_1 {
|
|
6126
6126
|
font-family: var(--fui-font-sans, "Geist Sans", "Geist", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
|
|
6127
6127
|
color: var(--fui-text-primary, #18181b);
|
|
6128
6128
|
margin: 0;
|
|
6129
6129
|
}
|
|
6130
6130
|
|
|
6131
|
-
._variant-section-
|
|
6131
|
+
._variant-section-label_yt586_7 {
|
|
6132
6132
|
font-family: var(--fui-font-sans, Geist Sans, Geist, Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif);
|
|
6133
6133
|
font-size: var(--fui-font-size-xs, 0.857rem);
|
|
6134
6134
|
color: var(--fui-text-secondary, #52525b);
|
|
@@ -6138,69 +6138,75 @@ a {
|
|
|
6138
6138
|
letter-spacing: 0.05em;
|
|
6139
6139
|
}
|
|
6140
6140
|
|
|
6141
|
-
._size-
|
|
6141
|
+
._size-2xs_yt586_17 {
|
|
6142
6142
|
font-size: var(--fui-font-size-2xs, 0.714rem);
|
|
6143
6143
|
}
|
|
6144
6144
|
|
|
6145
|
-
._size-
|
|
6145
|
+
._size-xs_yt586_21 {
|
|
6146
6146
|
font-size: var(--fui-font-size-xs, 0.857rem);
|
|
6147
6147
|
}
|
|
6148
6148
|
|
|
6149
|
-
._size-
|
|
6149
|
+
._size-sm_yt586_25 {
|
|
6150
6150
|
font-size: var(--fui-font-size-sm, 1rem);
|
|
6151
6151
|
}
|
|
6152
6152
|
|
|
6153
|
-
._size-
|
|
6153
|
+
._size-base_yt586_29,
|
|
6154
|
+
._size-md_yt586_30 {
|
|
6154
6155
|
font-size: var(--fui-font-size-base, 1.143rem);
|
|
6155
6156
|
}
|
|
6156
6157
|
|
|
6157
|
-
._size-
|
|
6158
|
+
._size-lg_yt586_34 {
|
|
6158
6159
|
font-size: var(--fui-font-size-lg, 1.286rem);
|
|
6159
6160
|
}
|
|
6160
6161
|
|
|
6161
|
-
._size-
|
|
6162
|
+
._size-xl_yt586_38 {
|
|
6162
6163
|
font-size: var(--fui-font-size-xl, 1.714rem);
|
|
6163
6164
|
}
|
|
6164
6165
|
|
|
6165
|
-
._size-
|
|
6166
|
+
._size-2xl_yt586_42 {
|
|
6166
6167
|
font-size: var(--fui-font-size-2xl, 2.143rem);
|
|
6167
6168
|
}
|
|
6168
6169
|
|
|
6169
|
-
._weight-
|
|
6170
|
+
._weight-normal_yt586_46 {
|
|
6170
6171
|
font-weight: var(--fui-font-weight-normal, 400);
|
|
6171
6172
|
}
|
|
6172
6173
|
|
|
6173
|
-
._weight-
|
|
6174
|
+
._weight-medium_yt586_50 {
|
|
6174
6175
|
font-weight: var(--fui-font-weight-medium, 500);
|
|
6175
6176
|
}
|
|
6176
6177
|
|
|
6177
|
-
._weight-
|
|
6178
|
+
._weight-semibold_yt586_54 {
|
|
6178
6179
|
font-weight: var(--fui-font-weight-semibold, 600);
|
|
6179
6180
|
}
|
|
6180
6181
|
|
|
6181
|
-
.
|
|
6182
|
+
._weight-bold_yt586_58 {
|
|
6183
|
+
font-weight: var(--fui-font-weight-bold, 700);
|
|
6184
|
+
}
|
|
6185
|
+
|
|
6186
|
+
._color-primary_yt586_62 {
|
|
6182
6187
|
color: var(--fui-text-primary, #18181b);
|
|
6183
6188
|
}
|
|
6184
6189
|
|
|
6185
|
-
._color-
|
|
6190
|
+
._color-secondary_yt586_66 {
|
|
6186
6191
|
color: var(--fui-text-secondary, #52525b);
|
|
6187
6192
|
}
|
|
6188
6193
|
|
|
6189
|
-
._color-
|
|
6194
|
+
._color-tertiary_yt586_70,
|
|
6195
|
+
._color-muted_yt586_71 {
|
|
6190
6196
|
color: var(--fui-text-tertiary, #71717a);
|
|
6191
6197
|
}
|
|
6192
6198
|
|
|
6193
|
-
.
|
|
6199
|
+
._mono_yt586_75 {
|
|
6194
6200
|
font-family: var(--fui-font-mono, "Geist Mono", "SF Mono", SFMono-Regular, ui-monospace, "Cascadia Code", Menlo, monospace);
|
|
6195
6201
|
}
|
|
6196
6202
|
|
|
6197
|
-
.
|
|
6203
|
+
._truncate_yt586_79 {
|
|
6198
6204
|
overflow: hidden;
|
|
6199
6205
|
text-overflow: ellipsis;
|
|
6200
6206
|
white-space: nowrap;
|
|
6201
6207
|
}
|
|
6202
6208
|
|
|
6203
|
-
.
|
|
6209
|
+
._lineClamp_yt586_85 {
|
|
6204
6210
|
display: -webkit-box;
|
|
6205
6211
|
-webkit-box-orient: vertical;
|
|
6206
6212
|
-webkit-line-clamp: var(--fui-line-clamp, 2);
|
package/dist/codeblock.cjs
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
2
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
25
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
26
|
const React = require("react");
|
|
@@ -23,18 +45,28 @@ function _interopNamespaceDefault(e) {
|
|
|
23
45
|
}
|
|
24
46
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
25
47
|
let _codeToHtml = null;
|
|
26
|
-
let
|
|
48
|
+
let _shikiLoadPromise = null;
|
|
27
49
|
let _shikiFailed = false;
|
|
28
|
-
function loadShikiDeps() {
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
async function loadShikiDeps() {
|
|
51
|
+
if (_codeToHtml) return;
|
|
52
|
+
if (_shikiFailed) return;
|
|
53
|
+
if (!_shikiLoadPromise) {
|
|
54
|
+
_shikiLoadPromise = (async () => {
|
|
55
|
+
try {
|
|
56
|
+
const shiki = await import("shiki");
|
|
57
|
+
_codeToHtml = shiki.codeToHtml;
|
|
58
|
+
} catch {
|
|
59
|
+
_shikiFailed = true;
|
|
60
|
+
}
|
|
61
|
+
})();
|
|
36
62
|
}
|
|
63
|
+
await _shikiLoadPromise;
|
|
37
64
|
}
|
|
65
|
+
const LANGUAGE_ALIASES = {
|
|
66
|
+
ts: "typescript",
|
|
67
|
+
js: "javascript",
|
|
68
|
+
text: "plaintext"
|
|
69
|
+
};
|
|
38
70
|
function CopyIcon({ className }) {
|
|
39
71
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
40
72
|
"svg",
|
|
@@ -375,7 +407,7 @@ const CodeBlockBase = React__namespace.forwardRef(function CodeBlock2({
|
|
|
375
407
|
let cancelled = false;
|
|
376
408
|
setHighlight((prev) => ({ ...prev, loading: true }));
|
|
377
409
|
const run = async () => {
|
|
378
|
-
loadShikiDeps();
|
|
410
|
+
await loadShikiDeps();
|
|
379
411
|
const fallbackHtml = `<pre class="shiki"><code>${escapeHtml(visibleCode)}</code></pre>`;
|
|
380
412
|
if (_shikiFailed || !_codeToHtml) {
|
|
381
413
|
if (_shikiFailed && process.env.NODE_ENV === "development") {
|
|
@@ -386,7 +418,8 @@ const CodeBlockBase = React__namespace.forwardRef(function CodeBlock2({
|
|
|
386
418
|
return fallbackHtml;
|
|
387
419
|
}
|
|
388
420
|
try {
|
|
389
|
-
const
|
|
421
|
+
const resolvedLang = LANGUAGE_ALIASES[language] || language;
|
|
422
|
+
const html = await _codeToHtml(visibleCode, { lang: resolvedLang, theme });
|
|
390
423
|
return processShikiHtml(html, {
|
|
391
424
|
showLineNumbers,
|
|
392
425
|
startLineNumber,
|