straw-ui-vue 0.1.30 → 0.1.32

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 CHANGED
@@ -43,12 +43,12 @@ import { StButton, StInput } from 'straw-ui-vue';
43
43
 
44
44
  ## UnoCSS 集成
45
45
 
46
- Straw UI 基于 UnoCSS 构建:
46
+ Straw UI 基于 UnoCSS 构建,需要配置 `content` 以确保组件库中使用的样式类能被正确扫描:
47
47
 
48
48
  ```ts
49
49
  // uno.config.ts
50
50
  import { defineConfig, presetWind4, presetIcons } from 'unocss';
51
- import { presetStrawUI } from 'straw-ui-vue/unocss';
51
+ import { presetStrawUI } from 'straw-ui-vue';
52
52
 
53
53
  export default defineConfig({
54
54
  presets: [
@@ -56,6 +56,20 @@ export default defineConfig({
56
56
  presetIcons(),
57
57
  presetStrawUI(), // Straw UI 预设
58
58
  ],
59
+ content: {
60
+ pipeline: {
61
+ include: [
62
+ // 默认的模板文件匹配
63
+ /\.(vue|[jt]sx|mdx?|html)($|\?)/,
64
+ // 让 pipeline 过滤器放行组件库 dist 文件
65
+ 'node_modules/straw-ui-vue/dist/**/*.{js,mjs}',
66
+ ],
67
+ },
68
+ filesystem: [
69
+ // 扫描组件库 dist 产物中使用的样式类
70
+ 'node_modules/straw-ui-vue/dist/**/*.{js,mjs}',
71
+ ],
72
+ },
59
73
  });
60
74
  ```
61
75
 
package/dist/straw-ui.js CHANGED
@@ -11989,7 +11989,7 @@ var Rs = /* @__PURE__ */ E({
11989
11989
  "trigger-style"
11990
11990
  ]));
11991
11991
  }
11992
- })), sc = le(ft), cc = $(xt, { StTreeNode: yt }), lc = yt, uc = [], dc = {
11992
+ })), sc = le(ft), cc = $(xt, { StTreeNode: yt }), lc = yt, uc = {
11993
11993
  colors: {
11994
11994
  background: "var(--background)",
11995
11995
  foreground: "var(--foreground)",
@@ -12039,7 +12039,7 @@ var Rs = /* @__PURE__ */ E({
12039
12039
  lg: "calc(var(--radius) + 2px)",
12040
12040
  xl: "calc(var(--radius) + 4px)"
12041
12041
  }
12042
- }, fc = [
12042
+ }, dc = [
12043
12043
  [/^h-(default|xxs|xs|sm|lg|xl|xxl)$/, ([, e]) => {
12044
12044
  let t = {
12045
12045
  default: 0,
@@ -12296,7 +12296,7 @@ var Rs = /* @__PURE__ */ E({
12296
12296
  return { "row-gap": t === 0 ? "var(--gap)" : `calc(var(--gap) ${t >= 0 ? "+" : "-"} ${Math.abs(t)}px)` };
12297
12297
  }],
12298
12298
  [/^scrollbar-(none|thin|auto)$/, ([, e]) => e === "none" ? { "scrollbar-width": "none" } : e === "thin" ? { "scrollbar-width": "thin" } : { "scrollbar-width": "auto" }]
12299
- ], pc = [{
12299
+ ], fc = [{
12300
12300
  order: -100,
12301
12301
  match(e) {
12302
12302
  return e.startsWith("hover:") ? {
@@ -12306,21 +12306,20 @@ var Rs = /* @__PURE__ */ E({
12306
12306
  } : e;
12307
12307
  }
12308
12308
  }];
12309
- function mc() {
12309
+ function pc() {
12310
12310
  return {
12311
12311
  name: "preset-straw-ui",
12312
- safelist: uc,
12313
- theme: dc,
12314
- rules: fc,
12315
- variants: pc
12312
+ theme: uc,
12313
+ rules: dc,
12314
+ variants: fc
12316
12315
  };
12317
12316
  }
12318
- function hc() {
12319
- return dc;
12317
+ function mc() {
12318
+ return uc;
12320
12319
  }
12321
12320
  //#endregion
12322
12321
  //#region src/index.ts
12323
- var gc = [
12322
+ var hc = [
12324
12323
  Ne,
12325
12324
  Fe,
12326
12325
  Pe,
@@ -12375,8 +12374,8 @@ var gc = [
12375
12374
  oc,
12376
12375
  sc,
12377
12376
  cc
12378
- ], _c = { install(e) {
12379
- for (let t of gc) e.use(t);
12377
+ ], gc = { install(e) {
12378
+ for (let t of hc) e.use(t);
12380
12379
  } };
12381
12380
  //#endregion
12382
- export { sc as StAddon, Ne as StButton, Fe as StButtonDesktop, Pe as StButtonGroup, Ie as StButtonPhone, We as StCard, Ge as StCardGroup, Ke as StCardGroupAddon, qe as StCardGroupContent, Je as StCardGroupDescription, Ye as StCardGroupFooter, Xe as StCardGroupHeader, Ze as StCardGroupTitle, wt as StCascade, Tt as StCascadePanel, Ft as StCheckbox, It as StCheckboxGroup, mn as StColorPicker, hn as StColorPickerPanel, Dn as StDatePicker, On as StDatePickerPanel, Lr as StDateTimePicker, Rr as StDateTimePickerPanel, Xr as StDialog, Zr as StDialogGroup, Qr as StDialogGroupAddon, $r as StDialogGroupBody, ei as StDialogGroupContent, ai as StDialogGroupDraggable, ti as StDialogGroupFooter, ni as StDialogGroupHeader, ri as StDialogGroupOverlay, ii as StDialogGroupTitle, ui as StDivider, fi as StDividerContent, di as StDividerLine, Ci as StDrawer, wi as StDrawerGroup, Ti as StDrawerGroupAddon, Ei as StDrawerGroupBody, Di as StDrawerGroupContent, Oi as StDrawerGroupFooter, ki as StDrawerGroupHeader, Ai as StDrawerGroupOverlay, ji as StDrawerGroupTitle, Fi as StEmpty, Ii as StEmptyGroup, Li as StEmptyGroupContent, Ri as StEmptyGroupDescription, qi as StForm, Ji as StFormControl, Yi as StFormDescription, Xi as StFormField, Zi as StFormItem, Qi as StFormLabel, $i as StFormMessage, ta as StImage, la as StInput, ua as StInputGroup, da as StInputGroupAddon, fa as StInputGroupButton, pa as StInputGroupInput, ma as StInputGroupText, ha as StInputGroupTextarea, ga as StInputNumber, va as StLabel, Ha as StMenu, Ua as StMenuContainer, Wa as StMenuContent, Ga as StMenuDivider, Ka as StMenuGroup, qa as StMenuItem, Ja as StMenuNode, Ya as StMenuTrigger, uo as StPagination, fo as StPopover, po as StPopoverArrow, mo as StPopoverContainer, ho as StPopoverContent, go as StPopoverTrigger, Oo as StProgress, jo as StProgressBar, ko as StProgressGroup, Ao as StProgressTrack, Lo as StRadio, Ro as StRadioGroup, Bo as StScrollbar, qo as StScrollbarDesktop, Jo as StScrollbarDesktopGroup, Vo as StScrollbarGroup, Go as StScrollbarGroupBackTop, Ko as StScrollbarGroupNavButton, Wo as StScrollbarGroupThumb, Uo as StScrollbarGroupTrack, Ho as StScrollbarGroupView, Yo as StScrollbarPhone, Xo as StScrollbarPhoneGroup, Zo as StScrollbarPhoneGroupPullAction, os as StSegmented, ss as StSegmentedGroup, ls as StSegmentedGroupIndicator, cs as StSegmentedGroupItem, ds as StSelect, fs as StSelectContainer, ps as StSelectContent, ms as StSelectEmpty, hs as StSelectGroup, gs as StSelectItem, _s as StSelectTrigger, Ts as StSidebar, Es as StSidebarItem, Os as StSkeleton, ks as StSkeletonItem, Ns as StSlider, Vs as StSplitter, Hs as StSplitterPanel, Gs as StSwitch, Qs as StTabs, $s as StTabsPane, ec as StTag, _a as StTextarea, tc as StTimePicker, nc as StTimePickerPanel, ic as StToggle, oc as StTooltip, cc as StTree, lc as StTreeNode, d as cn, _c as default, hc as getStrawUITheme, be as n, mc as presetStrawUI, je as t, r as useDevice, kn as useForwardEmit, nt as useZIndex, le as withInstall, $ as withInstallExtra };
12381
+ export { sc as StAddon, Ne as StButton, Fe as StButtonDesktop, Pe as StButtonGroup, Ie as StButtonPhone, We as StCard, Ge as StCardGroup, Ke as StCardGroupAddon, qe as StCardGroupContent, Je as StCardGroupDescription, Ye as StCardGroupFooter, Xe as StCardGroupHeader, Ze as StCardGroupTitle, wt as StCascade, Tt as StCascadePanel, Ft as StCheckbox, It as StCheckboxGroup, mn as StColorPicker, hn as StColorPickerPanel, Dn as StDatePicker, On as StDatePickerPanel, Lr as StDateTimePicker, Rr as StDateTimePickerPanel, Xr as StDialog, Zr as StDialogGroup, Qr as StDialogGroupAddon, $r as StDialogGroupBody, ei as StDialogGroupContent, ai as StDialogGroupDraggable, ti as StDialogGroupFooter, ni as StDialogGroupHeader, ri as StDialogGroupOverlay, ii as StDialogGroupTitle, ui as StDivider, fi as StDividerContent, di as StDividerLine, Ci as StDrawer, wi as StDrawerGroup, Ti as StDrawerGroupAddon, Ei as StDrawerGroupBody, Di as StDrawerGroupContent, Oi as StDrawerGroupFooter, ki as StDrawerGroupHeader, Ai as StDrawerGroupOverlay, ji as StDrawerGroupTitle, Fi as StEmpty, Ii as StEmptyGroup, Li as StEmptyGroupContent, Ri as StEmptyGroupDescription, qi as StForm, Ji as StFormControl, Yi as StFormDescription, Xi as StFormField, Zi as StFormItem, Qi as StFormLabel, $i as StFormMessage, ta as StImage, la as StInput, ua as StInputGroup, da as StInputGroupAddon, fa as StInputGroupButton, pa as StInputGroupInput, ma as StInputGroupText, ha as StInputGroupTextarea, ga as StInputNumber, va as StLabel, Ha as StMenu, Ua as StMenuContainer, Wa as StMenuContent, Ga as StMenuDivider, Ka as StMenuGroup, qa as StMenuItem, Ja as StMenuNode, Ya as StMenuTrigger, uo as StPagination, fo as StPopover, po as StPopoverArrow, mo as StPopoverContainer, ho as StPopoverContent, go as StPopoverTrigger, Oo as StProgress, jo as StProgressBar, ko as StProgressGroup, Ao as StProgressTrack, Lo as StRadio, Ro as StRadioGroup, Bo as StScrollbar, qo as StScrollbarDesktop, Jo as StScrollbarDesktopGroup, Vo as StScrollbarGroup, Go as StScrollbarGroupBackTop, Ko as StScrollbarGroupNavButton, Wo as StScrollbarGroupThumb, Uo as StScrollbarGroupTrack, Ho as StScrollbarGroupView, Yo as StScrollbarPhone, Xo as StScrollbarPhoneGroup, Zo as StScrollbarPhoneGroupPullAction, os as StSegmented, ss as StSegmentedGroup, ls as StSegmentedGroupIndicator, cs as StSegmentedGroupItem, ds as StSelect, fs as StSelectContainer, ps as StSelectContent, ms as StSelectEmpty, hs as StSelectGroup, gs as StSelectItem, _s as StSelectTrigger, Ts as StSidebar, Es as StSidebarItem, Os as StSkeleton, ks as StSkeletonItem, Ns as StSlider, Vs as StSplitter, Hs as StSplitterPanel, Gs as StSwitch, Qs as StTabs, $s as StTabsPane, ec as StTag, _a as StTextarea, tc as StTimePicker, nc as StTimePickerPanel, ic as StToggle, oc as StTooltip, cc as StTree, lc as StTreeNode, d as cn, gc as default, mc as getStrawUITheme, be as n, pc as presetStrawUI, je as t, r as useDevice, kn as useForwardEmit, nt as useZIndex, le as withInstall, $ as withInstallExtra };
@@ -1,12 +1,7 @@
1
1
  import { Preset } from 'unocss';
2
- /**
3
- * Straw UI 组件使用的 UnoCSS safelist
4
- * 由用户在 uno.config.ts 中自行配置,组件库不再自动生成
5
- * */
6
- export declare const strawUISafelist: string[];
7
2
  /**
8
3
  * Straw UI UnoCSS 预设
9
- * 提供组件库所需的 safelist、theme、rules 和 variants 配置
4
+ * 提供组件库所需的 theme、rules 和 variants 配置
10
5
  * */
11
6
  export declare function presetStrawUI(): Preset;
12
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "straw-ui-vue",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "type": "module",
5
5
  "main": "./dist/straw-ui.js",
6
6
  "module": "./dist/straw-ui.js",