lism-css 0.3.4 → 0.5.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.
Files changed (253) hide show
  1. package/README.md +2 -2
  2. package/bin/build-config.js +157 -0
  3. package/bin/build-css.cjs +92 -0
  4. package/bin/build-css.js +90 -0
  5. package/bin/cli.mjs +69 -0
  6. package/bin/script-build-css.js +6 -0
  7. package/config/__prop_list.js +44 -0
  8. package/config/__props.scss +25 -0
  9. package/config/default-config.js +9 -0
  10. package/config/defaults/__props-memo.js +45 -0
  11. package/config/defaults/props.js +370 -0
  12. package/config/defaults/states.js +42 -0
  13. package/config/defaults/tokens.js +26 -0
  14. package/config/helper/getSvgUrl.js +28 -0
  15. package/config/helper/minifyHtml.js +22 -0
  16. package/config/helper.js +67 -0
  17. package/config/index.js +15 -0
  18. package/config.js +2 -0
  19. package/dist/components/Accordion/AccIcon.js +1 -1
  20. package/dist/components/Accordion/getProps.js +15 -17
  21. package/dist/components/Accordion/index.js +4 -4
  22. package/dist/components/Accordion/index2.js +28 -23
  23. package/dist/components/Accordion/setAccordion.js +11 -11
  24. package/dist/components/Box/index.js +5 -6
  25. package/dist/components/Center/index.js +2 -2
  26. package/dist/components/Cluster/index.js +8 -0
  27. package/dist/components/Columns/index.js +5 -6
  28. package/dist/components/Container/index.js +3 -3
  29. package/dist/components/Dummy/index.js +9 -14
  30. package/dist/components/Dummy/texts.js +6 -6
  31. package/dist/components/Flex/index.js +5 -6
  32. package/dist/components/Flow/index.js +8 -0
  33. package/dist/components/Frame/index.js +5 -6
  34. package/dist/components/Grid/index.js +5 -6
  35. package/dist/components/HTML/index.js +5 -0
  36. package/dist/components/HTML/index2.js +44 -0
  37. package/dist/components/Layer/index.js +5 -5
  38. package/dist/components/LinkBox/index.js +6 -6
  39. package/dist/components/Lism/Link.js +5 -5
  40. package/dist/components/Lism/Text.js +4 -4
  41. package/dist/components/Lism/index.js +5 -4
  42. package/dist/components/Modal/Body.js +5 -5
  43. package/dist/components/Modal/CloseBtn.js +13 -0
  44. package/dist/components/Modal/Inner.js +5 -5
  45. package/dist/components/Modal/OpenBtn.js +9 -0
  46. package/dist/components/Modal/getProps.js +12 -13
  47. package/dist/components/Modal/index.js +4 -5
  48. package/dist/components/Modal/index2.js +12 -12
  49. package/dist/components/Stack/index.js +5 -5
  50. package/dist/components/Tabs/Tab.js +7 -9
  51. package/dist/components/Tabs/TabList.js +4 -4
  52. package/dist/components/Tabs/TabPanel.js +6 -7
  53. package/dist/components/Tabs/getProps.js +1 -8
  54. package/dist/components/Tabs/index2.js +14 -23
  55. package/dist/components/WithSide/index.js +4 -5
  56. package/dist/components/atomic/Decorator/getProps.js +13 -0
  57. package/dist/components/{Decorator → atomic/Decorator}/index.js +1 -1
  58. package/dist/components/atomic/Divider/getProps.js +10 -0
  59. package/dist/components/atomic/Divider/index.js +9 -0
  60. package/dist/components/atomic/Icon/getProps.js +59 -0
  61. package/dist/components/{Icon → atomic/Icon}/index.js +1 -1
  62. package/dist/components/atomic/Media/getProps.js +9 -0
  63. package/dist/components/atomic/Media/index.js +9 -0
  64. package/dist/components/atomic/Spacer/getProps.js +21 -0
  65. package/dist/components/atomic/Spacer/index.js +9 -0
  66. package/dist/components/getFilterProps.js +8 -18
  67. package/dist/components/getLayoutProps.js +27 -0
  68. package/dist/config/default-config.js +11 -0
  69. package/dist/config/defaults/props.js +342 -0
  70. package/dist/config/defaults/states.js +36 -0
  71. package/dist/config/defaults/tokens.js +29 -0
  72. package/dist/config/helper/getSvgUrl.js +4 -0
  73. package/dist/config/helper.js +31 -0
  74. package/dist/config/index.js +11 -0
  75. package/dist/index.js +50 -50
  76. package/dist/lib/getBpData.js +1 -1
  77. package/dist/lib/getLismProps.js +109 -177
  78. package/dist/lib/getMaybeCssVar.js +30 -54
  79. package/dist/lib/getMaybeTokenValue.js +26 -0
  80. package/dist/lib/getUtilKey.js +13 -0
  81. package/dist/lib/isPresetValue.js +3 -3
  82. package/dist/lib/isTokenValue.js +6 -5
  83. package/package.json +16 -3
  84. package/packages/astro/Accordion/AccBody.astro +5 -6
  85. package/packages/astro/Accordion/AccHeader.astro +4 -4
  86. package/packages/astro/Accordion/AccHeaderLabel.astro +12 -0
  87. package/packages/astro/Accordion/AccIcon.astro +1 -1
  88. package/packages/astro/Accordion/AccLabel.astro +1 -1
  89. package/packages/astro/Accordion/Accordion.astro +1 -1
  90. package/packages/astro/Accordion/index.js +2 -1
  91. package/packages/astro/Box/Box.astro +2 -3
  92. package/packages/astro/Center/Center.astro +2 -8
  93. package/packages/astro/Cluster/Cluster.astro +5 -0
  94. package/packages/astro/Cluster/index.js +1 -0
  95. package/packages/astro/Columns/Columns.astro +2 -8
  96. package/packages/astro/Container/Container.astro +3 -4
  97. package/packages/astro/Decorator/Decorator.astro +2 -2
  98. package/packages/astro/Divider/Divider.astro +3 -3
  99. package/packages/astro/Dummy/Dummy.astro +3 -2
  100. package/packages/astro/Flex/Flex.astro +1 -10
  101. package/packages/astro/Flex/index.js +0 -1
  102. package/packages/astro/Flow/Flow.astro +5 -0
  103. package/packages/astro/Flow/index.js +1 -0
  104. package/packages/astro/Frame/Frame.astro +1 -8
  105. package/packages/astro/Grid/Grid.astro +1 -9
  106. package/packages/astro/Grid/index.js +0 -1
  107. package/packages/astro/HTML/a.astro +5 -0
  108. package/packages/astro/HTML/button.astro +5 -0
  109. package/packages/astro/HTML/div.astro +5 -0
  110. package/packages/astro/HTML/h.astro +6 -0
  111. package/packages/astro/HTML/img.astro +5 -0
  112. package/packages/astro/HTML/index.js +12 -0
  113. package/packages/astro/HTML/li.astro +5 -0
  114. package/packages/astro/HTML/ol.astro +5 -0
  115. package/packages/astro/HTML/p.astro +5 -0
  116. package/packages/astro/HTML/span.astro +5 -0
  117. package/packages/astro/HTML/ul.astro +5 -0
  118. package/packages/astro/Icon/Icon.astro +3 -5
  119. package/packages/astro/Layer/Layer.astro +3 -10
  120. package/packages/astro/LinkBox/LinkBox.astro +4 -5
  121. package/packages/astro/Lism/Link.astro +2 -2
  122. package/packages/astro/Lism/Lism.astro +4 -3
  123. package/packages/astro/Lism/Text.astro +2 -2
  124. package/packages/astro/Lism/index.js +0 -1
  125. package/packages/astro/{Lism → Media}/Media.astro +1 -9
  126. package/packages/astro/Media/index.js +1 -0
  127. package/packages/astro/Modal/Body.astro +4 -5
  128. package/packages/astro/Modal/CloseBtn.astro +24 -0
  129. package/packages/astro/Modal/Inner.astro +4 -4
  130. package/packages/astro/Modal/Modal.astro +4 -5
  131. package/packages/astro/Modal/OpenBtn.astro +14 -0
  132. package/packages/astro/Modal/index.js +3 -4
  133. package/packages/astro/OverlayLink/OverlayLink.astro +1 -1
  134. package/packages/astro/Spacer/Spacer.astro +3 -3
  135. package/packages/astro/Stack/Stack.astro +2 -4
  136. package/packages/astro/Tabs/Tab.astro +2 -11
  137. package/packages/astro/Tabs/TabList.astro +4 -4
  138. package/packages/astro/Tabs/TabPanel.astro +4 -4
  139. package/packages/astro/Tabs/Tabs.astro +6 -10
  140. package/packages/astro/Test/Test.astro +1 -1
  141. package/packages/astro/Test/TestItem.astro +1 -1
  142. package/packages/astro/WithSide/WithSide.astro +1 -8
  143. package/packages/astro/index.js +6 -2
  144. package/packages/types/index.d.ts +31 -38
  145. package/src/scss/{_props.scss → __props copy.scss } +146 -169
  146. package/src/scss/__props.scss +786 -0
  147. package/src/scss/_auto_output.scss +102 -76
  148. package/src/scss/_prop-config.scss +862 -0
  149. package/src/scss/_setting.scss +2 -3
  150. package/src/scss/_with_layer.scss +19 -14
  151. package/src/scss/base/_dom.scss +35 -26
  152. package/src/scss/base/_property.scss +4 -16
  153. package/src/scss/base/_tokens.scss +105 -116
  154. package/src/scss/base/index.scss +18 -42
  155. package/src/scss/base/set/_hover.scss +13 -0
  156. package/src/scss/base/set/_innerRs.scss +3 -0
  157. package/src/scss/base/set/_mask.scss +6 -0
  158. package/src/scss/base/set/_plain.scss +14 -0
  159. package/src/scss/base/set/_shadow.scss +27 -0
  160. package/src/scss/base/set/_snap.scss +8 -0
  161. package/src/scss/base/set/_transition.scss +20 -0
  162. package/src/scss/main.scss +0 -1
  163. package/src/scss/main_no_layer.scss +6 -14
  164. package/src/scss/modules/atomic/_divider.scss +6 -0
  165. package/src/scss/{layout → modules/atomic}/_icon.scss +3 -9
  166. package/src/scss/modules/atomic/_media.scss +3 -0
  167. package/src/scss/{layout → modules/atomic}/_spacer.scss +1 -1
  168. package/src/scss/modules/atomic/index.scss +6 -0
  169. package/src/scss/{dynamic → modules/dynamic}/_accordion.scss +24 -24
  170. package/src/scss/modules/dynamic/_modal.scss +33 -0
  171. package/src/scss/{dynamic → modules/dynamic}/_tabs.scss +4 -5
  172. package/src/scss/{layout/_flex.scss → modules/layout/_cluster.scss} +1 -4
  173. package/src/scss/modules/layout/_columns.scss +9 -0
  174. package/src/scss/modules/layout/_flex.scss +3 -0
  175. package/src/scss/modules/layout/_flow.scss +46 -0
  176. package/src/scss/{layout → modules/layout}/_frame.scss +1 -1
  177. package/src/scss/modules/layout/_grid.scss +35 -0
  178. package/src/scss/{layout → modules/layout}/_withSide.scss +3 -3
  179. package/src/scss/{layout → modules/layout}/index.scss +4 -6
  180. package/src/scss/modules/state/_container.scss +37 -0
  181. package/src/scss/{state → modules/state}/_linkbox.scss +1 -1
  182. package/src/scss/modules/state/index.scss +5 -0
  183. package/src/scss/props/_border.scss +25 -40
  184. package/src/scss/props/_hover.scss +12 -23
  185. package/src/scss/props/_size.scss +17 -0
  186. package/src/scss/props/index.scss +1 -2
  187. package/src/scss/reset.scss +1 -1
  188. package/src/scss/utility/_cbox.scss +5 -4
  189. package/src/scss/utility/_hidden.scss +14 -0
  190. package/src/scss/utility/_itemDivider.scss +11 -0
  191. package/src/scss/utility/_linkExpand.scss +10 -0
  192. package/src/scss/utility/_trimHL.scss +29 -13
  193. package/src/scss/utility/index.scss +3 -45
  194. package/dist/components/Box/getProps.js +0 -7
  195. package/dist/components/Columns/getProps.js +0 -6
  196. package/dist/components/Decorator/getProps.js +0 -17
  197. package/dist/components/Divider/getProps.js +0 -11
  198. package/dist/components/Divider/index.js +0 -9
  199. package/dist/components/Flex/Cluster.js +0 -8
  200. package/dist/components/Flex/FlexItem.js +0 -8
  201. package/dist/components/Flex/getProps.js +0 -13
  202. package/dist/components/Frame/getProps.js +0 -7
  203. package/dist/components/Grid/GridItem.js +0 -9
  204. package/dist/components/Grid/getProps.js +0 -28
  205. package/dist/components/Icon/getProps.js +0 -60
  206. package/dist/components/Layer/getProps.js +0 -9
  207. package/dist/components/Lism/Media.js +0 -9
  208. package/dist/components/Modal/CloseIconBtn.js +0 -19
  209. package/dist/components/Modal/Footer.js +0 -9
  210. package/dist/components/Modal/Header.js +0 -9
  211. package/dist/components/Spacer/getProps.js +0 -21
  212. package/dist/components/Spacer/index.js +0 -9
  213. package/dist/components/WithSide/getProps.js +0 -14
  214. package/dist/components/getInsetProps.js +0 -8
  215. package/dist/components/getMediaProps.js +0 -7
  216. package/dist/components/getTransformProps.js +0 -8
  217. package/dist/config/prop_list.js +0 -386
  218. package/dist/config/tokens.js +0 -43
  219. package/dist/config.js +0 -9
  220. package/dist/css/base.css +0 -1
  221. package/dist/css/dynamic.css +0 -1
  222. package/dist/css/layout.css +0 -1
  223. package/dist/css/main.css +0 -1
  224. package/dist/css/main_no_layer.css +0 -1
  225. package/dist/css/props.css +0 -1
  226. package/dist/css/reset.css +0 -1
  227. package/dist/css/state.css +0 -1
  228. package/dist/css/utility.css +0 -1
  229. package/dist/lib/getMaybeUtilValue.js +0 -6
  230. package/packages/astro/Flex/Cluster.astro +0 -11
  231. package/packages/astro/Grid/GridItem.astro +0 -15
  232. package/packages/astro/Modal/CloseIconBtn.astro +0 -24
  233. package/packages/astro/Modal/Footer.astro +0 -14
  234. package/packages/astro/Modal/Header.astro +0 -14
  235. package/src/scss/dynamic/_modal.scss +0 -30
  236. package/src/scss/layout/_columns.scss +0 -13
  237. package/src/scss/layout/_divider.scss +0 -3
  238. package/src/scss/layout/_grid.scss +0 -9
  239. package/src/scss/props/__memo.scss +0 -15
  240. package/src/scss/props/_color.scss +0 -7
  241. package/src/scss/props/_transition.scss +0 -20
  242. package/src/scss/state/_container.scss +0 -34
  243. package/src/scss/state/_flow.scss +0 -45
  244. package/src/scss/state/_size.scss +0 -22
  245. package/src/scss/state/index.scss +0 -12
  246. /package/dist/components/{Icon → atomic/Icon}/SVG.js +0 -0
  247. /package/dist/components/{Icon → atomic/Icon}/presets.js +0 -0
  248. /package/packages/astro/{helper/index.js → helper.js} +0 -0
  249. /package/src/scss/{dynamic → modules/dynamic}/index.scss +0 -0
  250. /package/src/scss/{layout → modules/layout}/_center.scss +0 -0
  251. /package/src/scss/{layout → modules/layout}/_stack.scss +0 -0
  252. /package/src/scss/{state → modules/state}/_gutter.scss +0 -0
  253. /package/src/scss/{state → modules/state}/_layer.scss +0 -0
@@ -0,0 +1,370 @@
1
+ /**
2
+ * isVar: 1 → クラス出力はせずstyle属性での変数出力のみ (--bdw, --keycolor など)
3
+ * bp: 0 → Prop-valユーティリティクラス化されなければ、style属性で出力するだけ。
4
+ * bp: 1 → .-prop と --prop の セットがベースにあり、.-prop_bp と .--prop_bp で ブレイクポイント指定できる。
5
+ * .-prop{propaty:var(--prop)} が基本で、ユーティリティクラスは .-prop:val{propaty:value} となる。
6
+ *
7
+ * ↓コンポーネント処理で使用される
8
+ * tokenClass: 1 → 対応するトークン値がそのまま全てユーティリティクラス化されるもの。
9
+ * shorthands: → コンポーネント側で短く書くための設定
10
+ *
11
+ * ↓SCSS出力で使用される
12
+ * alwaysVar: 1 → .-prop,[class*=-prop:] {propaty:var(--prop)} で、ユーティリティクラス時も常に変数管理となる。
13
+ * overwriteBaseVar: 1 → ブレイクポイントクラスで --prop: var(--prop_$bp) がセットされ、常にベース変数の --prop で値が取得できるようになる。
14
+ * important: 1 → !important を付けて最終的に出力する
15
+ */
16
+
17
+ const PLACE_PRESETS = ['start', 'center', 'end'];
18
+ const PLACE_UTILS = { 'flex-s': 'flex-start', 'flex-e': 'flex-end' };
19
+ const PLACE_SHORTHANDS = { s: 'start', e: 'end', c: 'center', fs: 'flex-s', fe: 'flex-e' };
20
+
21
+ export default {
22
+ f: { prop: 'font', presets: ['inherit'] },
23
+ fz: { prop: 'fontSize', token: 'fz', tokenClass: 1, bp: 1, alwaysVar: 1 },
24
+ fw: { prop: 'fontWeight', token: 'fw', tokenClass: 1 },
25
+ ff: { prop: 'fontFamily', token: 'ff', tokenClass: 1 },
26
+ fs: { prop: 'fontStyle', presets: ['italic'], shorthands: { i: 'italic' } },
27
+ lh: { prop: 'lineHeight', presets: ['1'], token: 'lh', tokenClass: 1, bp: 1, alwaysVar: 1 },
28
+ lts: { prop: 'letterSpacing', token: 'lts', tokenClass: 1 },
29
+ ta: { prop: 'textAlign', presets: ['center', 'left', 'right'] },
30
+ td: { prop: 'textDecoration', utils: { under: 'underline', none: 'none' } },
31
+ // tt: { prop: 'textTransform', utils: { upper: 'uppercase', lower: 'lowercase' } },
32
+ // te: { prop: 'textEmphasis', presets: ['filled'] },
33
+ // tsh: { prop: 'textShadow' },
34
+
35
+ d: {
36
+ prop: 'display',
37
+ presets: ['none', 'block'],
38
+ utils: { 'in-flex': 'inline-flex' },
39
+ bp: 1,
40
+ },
41
+ o: { prop: 'opacity', presets: ['0'], token: 'o', tokenClass: 1 },
42
+ v: { prop: 'visibility', presets: ['hidden'] },
43
+ ov: { prop: 'overflow', presets: ['hidden', 'auto', 'clip'] },
44
+ 'ov-x': { prop: 'overflowX', presets: ['clip', 'auto', 'scroll'] },
45
+ 'ov-y': { prop: 'overflowY', presets: ['clip', 'auto', 'scroll'] },
46
+ // overflow-clip-margin → safariで使えない
47
+ ar: {
48
+ prop: 'aspectRatio',
49
+ presets: ['21/9', '16/9', '3/2', '1/1'], // 4/3, 2/1
50
+ token: 'ar',
51
+ tokenClass: 1,
52
+ bp: 1,
53
+ },
54
+
55
+ // size
56
+ w: { prop: 'width', utils: { fit: 'fit-content' }, presets: ['100%'], token: 'sz', bp: 1 },
57
+ h: { prop: 'height', presets: ['100%'], token: 'sz', bp: 1 },
58
+ 'min-w': { prop: 'minWidth', presets: ['100%'], token: 'sz', bp: 1 },
59
+ 'max-w': { prop: 'maxWidth', presets: ['100%'], token: 'sz', bp: 1 },
60
+ 'min-h': { prop: 'minHeight', presets: ['100%'], token: 'sz', bp: 1 },
61
+ 'max-h': { prop: 'maxHeight', presets: ['100%'], token: 'sz', bp: 1 },
62
+
63
+ sz: { prop: 'inlineSize', token: 'sz' },
64
+ 'min-sz': { prop: 'minInlineSize', token: 'sz' },
65
+ 'max-sz': {
66
+ prop: 'maxInlineSize',
67
+ token: 'sz',
68
+ tokenClass: 1,
69
+ exUtility: {
70
+ min: '',
71
+ full: '',
72
+ outer: '',
73
+ },
74
+ },
75
+ ysz: { prop: 'blockSize', token: 'sz' },
76
+ 'min-ysz': { prop: 'minBlockSize', token: 'sz' },
77
+ 'max-ysz': { prop: 'maxBlockSize', token: 'sz' },
78
+
79
+ // bg
80
+ bg: { prop: 'background', bp: 1 },
81
+ bgi: { prop: 'backgroundImage' },
82
+ bgr: { prop: 'backgroundRepeat', utils: { no: 'no-repeat' } },
83
+ bgp: { prop: 'backgroundPosition', presets: ['center'] },
84
+ bgsz: { prop: 'backgroundSize', presets: ['cover', 'contain'] },
85
+ bga: { prop: 'backgroundAttachment' }, // fixed
86
+ bgo: { prop: 'backgroundOrigin' }, // border, padding, content
87
+ bgblend: { prop: 'backgroundBlendMode' },
88
+ bgclip: {
89
+ prop: 'backgroundClip',
90
+ presets: ['text'],
91
+ },
92
+ bgc: {
93
+ prop: 'backgroundColor',
94
+ presets: ['base', 'base-2', 'text', 'inherit', 'main', 'accent'],
95
+ utils: { trsp: 'transparent' },
96
+ token: 'color',
97
+ exUtility: { inherit: { 'background-color': 'inherit' } },
98
+ alwaysVar: 1,
99
+ },
100
+
101
+ c: {
102
+ // Note: bg系(bgclip)より後にくるように。
103
+ prop: 'color',
104
+ presets: ['base', 'text', 'text-2', 'main', 'accent', 'inherit'],
105
+ utils: { trsp: 'transparent' },
106
+ // tt
107
+ token: 'color',
108
+ exUtility: {
109
+ inherit: { color: 'inherit' }, // --c ではなく color で出力したい
110
+ // mix: {'--_c1:currentColor;--_c2:transparent;--c:color-mix(in srgb, var(--_c1) var(--_mix-c, 50%), var(--_c2))'},
111
+ },
112
+ alwaysVar: 1,
113
+ },
114
+ keycolor: { isVar: 1, token: 'color' },
115
+ bd: { prop: 'border', presets: ['none'] },
116
+ bds: { isVar: 1, presets: ['dashed', 'dotted', 'double'] },
117
+ bdc: {
118
+ isVar: 1,
119
+ presets: ['main', 'accent', 'line', 'inherit'],
120
+ utils: { trsp: 'transparent' },
121
+ token: 'color',
122
+ },
123
+ bdw: { isVar: 1, bp: 1 }, // --bdw のみ
124
+ 'bd-x': { prop: 'borderInline' },
125
+ 'bd-y': { prop: 'borderBlock' },
126
+ 'bd-x-s': { prop: 'borderInlineStart' },
127
+ 'bd-x-e': { prop: 'borderInlineEnd' },
128
+ 'bd-y-s': { prop: 'borderBlockStart' },
129
+ 'bd-y-e': { prop: 'borderBlockEnd' },
130
+ 'bd-t': { prop: 'borderTop' },
131
+ 'bd-b': { prop: 'borderBottom' },
132
+ 'bd-l': { prop: 'borderLeft' },
133
+ 'bd-r': { prop: 'borderRight' },
134
+
135
+ bdrs: {
136
+ prop: 'borderRadius',
137
+ presets: ['0'],
138
+ token: 'bdrs',
139
+ tokenClass: 1,
140
+ bp: 1,
141
+ alwaysVar: 1,
142
+ overwriteBaseVar: 1,
143
+ },
144
+ 'bdrs-tl': { prop: 'borderTopLeftRadius', token: 'bdrs' },
145
+ 'bdrs-tr': { prop: 'borderTopRightRadius', token: 'bdrs' },
146
+ 'bdrs-br': { prop: 'borderBottomRightRadius', token: 'bdrs' },
147
+ 'bdrs-bl': { prop: 'borderBottomLeftRadius', token: 'bdrs' },
148
+ 'bdrs-ss': { prop: 'borderStartStartRadius', token: 'bdrs' },
149
+ 'bdrs-se': { prop: 'borderStartEndRadius', token: 'bdrs' },
150
+ 'bdrs-es': { prop: 'borderEndStartRadius', token: 'bdrs' },
151
+ 'bdrs-ee': { prop: 'borderEndEndRadius', token: 'bdrs' },
152
+
153
+ bxsh: { prop: 'boxShadow', utils: { 0: 'none' }, token: 'bxsh', tokenClass: 1, bp: 1, alwaysVar: 1 },
154
+
155
+ // position
156
+ pos: {
157
+ prop: 'position',
158
+ presets: ['static', 'fixed', 'sticky'],
159
+ utils: { rel: 'relative', abs: 'absolute' },
160
+ },
161
+ z: { prop: 'zIndex', presets: ['-1', '0', '1', '99'] },
162
+ t: { prop: 'top', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
163
+ l: { prop: 'left', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
164
+ r: { prop: 'right', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
165
+ b: { prop: 'bottom', utils: { 0: '0%' }, presets: ['50%', '100%'], token: 'space' },
166
+ i: { prop: 'inset', utils: { 0: '0%' }, token: 'space' },
167
+ 'i-x': { prop: 'insetInline', token: 'space' },
168
+ 'i-y': { prop: 'insetBlock', token: 'space' },
169
+ 'i-x-s': { prop: 'insetInlineStart', token: 'space' },
170
+ 'i-x-e': { prop: 'insetInlineEnd', token: 'space' },
171
+ 'i-y-s': { prop: 'insetBlockStart', token: 'space' },
172
+ 'i-y-e': { prop: 'insetBlockEnd', token: 'space' },
173
+
174
+ // space
175
+ p: {
176
+ prop: 'padding',
177
+ presets: ['0'],
178
+ token: 'space',
179
+ tokenClass: 1,
180
+ alwaysVar: 1,
181
+ overwriteBaseVar: 1,
182
+ bp: 1,
183
+ },
184
+ px: { prop: 'paddingInline', presets: ['0'], token: 'space', tokenClass: 1, alwaysVar: 1, bp: 1 },
185
+ py: { prop: 'paddingBlock', presets: ['0'], token: 'space', tokenClass: 1, alwaysVar: 1, bp: 1 },
186
+ 'px-s': { prop: 'paddingInlineStart', token: 'space', bp: 1 },
187
+ 'px-e': { prop: 'paddingInlineEnd', token: 'space', bp: 1 },
188
+ 'py-s': { prop: 'paddingBlockStart', token: 'space', bp: 1 },
189
+ 'py-e': { prop: 'paddingBlockEnd', token: 'space', bp: 1 },
190
+ pl: { prop: 'paddingLeft', token: 'space', bp: 1 },
191
+ pr: { prop: 'paddingRight', token: 'space', bp: 1 },
192
+ pt: { prop: 'paddingTop', token: 'space', bp: 1 },
193
+ pb: { prop: 'paddingBottom', token: 'space', bp: 1 },
194
+ m: {
195
+ prop: 'margin',
196
+ presets: ['auto', '0'],
197
+ token: 'space',
198
+ tokenClass: 1,
199
+ alwaysVar: 1,
200
+ overwriteBaseVar: 1,
201
+ bp: 1,
202
+ },
203
+ mx: { prop: 'marginInline', presets: ['auto', '0'], token: 'space', tokenClass: 1, alwaysVar: 1, bp: 1 },
204
+ my: { prop: 'marginBlock', presets: ['auto', '0'], token: 'space', tokenClass: 1, alwaysVar: 1, bp: 1 },
205
+ 'mx-s': { prop: 'marginInlineStart', presets: ['auto'], token: 'space', bp: 1 },
206
+ 'mx-e': { prop: 'marginInlineEnd', presets: ['auto'], token: 'space', bp: 1 },
207
+ 'my-s': { prop: 'marginBlockStart', token: 'space', bp: 1, presets: ['auto', '0'], tokenClass: 1 },
208
+ 'my-e': { prop: 'marginInlineEnd', presets: ['auto'], token: 'space', bp: 1 },
209
+ ml: { prop: 'marginLeft', token: 'space', bp: 1 },
210
+ mr: { prop: 'marginRight', token: 'space', bp: 1 },
211
+ mt: { prop: 'marginTop', token: 'space', bp: 1 },
212
+ mb: { prop: 'marginBottom', token: 'space', bp: 1 },
213
+
214
+ g: {
215
+ prop: 'gap',
216
+ presets: ['0', 'inherit'],
217
+ exUtility: { inherit: { gap: 'inherit' } },
218
+ token: 'space',
219
+ tokenClass: 1,
220
+ alwaysVar: 1,
221
+ overwriteBaseVar: 1,
222
+ bp: 1,
223
+ },
224
+ 'g-x': { prop: 'columnGap', token: 'space', bp: 1 },
225
+ 'g-y': { prop: 'rowGap', token: 'space', bp: 1 },
226
+ cols: { isVar: 1, bp: 1 },
227
+ rows: { isVar: 1, bp: 1 },
228
+
229
+ // flex
230
+ fxf: { prop: 'flexFlow' },
231
+ fxw: { prop: 'flexWrap', presets: ['wrap'], bp: 1 },
232
+ fxd: { prop: 'flexDirection', utils: { col: 'column', 'col-r': 'column-reverse', 'row-r': 'row-reverse' }, bp: 1 },
233
+ fx: { prop: 'flex', presets: ['1'], bp: 1 },
234
+ fxg: { prop: 'flexGrow', presets: ['1'] },
235
+ fxsh: { prop: 'flexShrink', presets: ['0'] },
236
+ fxb: { prop: 'flexBasis', bp: 1 },
237
+
238
+ // grid
239
+ // gd: { prop: 'grid' },
240
+ gt: {
241
+ prop: 'gridTemplate',
242
+ presets: ['repeat'],
243
+ exUtility: {
244
+ repeat: {
245
+ '--cols': '1',
246
+ '--rows': '1',
247
+ 'grid-template': 'repeat(var(--rows), 1fr) / repeat(var(--cols), 1fr)',
248
+ },
249
+ },
250
+ bp: 1,
251
+ },
252
+ gta: { prop: 'gridTemplateAreas', bp: 1 },
253
+ gtc: {
254
+ prop: 'gridTemplateColumns',
255
+ presets: ['subgrid', 'liquid'],
256
+ exUtility: {
257
+ // repeat: { '--cols': '1', '--gtc': 'repeat(var(--cols), 1fr)' },
258
+ liquid: { '--cols': 'var(--sz--min)', '--gtc': 'repeat(auto-fill, minmax(min(var(--cols), 100%), 1fr))' },
259
+ },
260
+ bp: 1,
261
+ },
262
+ gtr: {
263
+ prop: 'gridTemplateRows',
264
+ presets: ['subgrid'],
265
+ // exUtility: { repeat: { '--rows': '1', '--gtr': 'repeat(var(--rows), 1fr)' } },
266
+ bp: 1,
267
+ },
268
+ gaf: { prop: 'gridAutoFlow', utils: { row: 'row', col: 'column' }, bp: 1 }, //dense
269
+ gac: { prop: 'gridAutoColumns' },
270
+ gar: { prop: 'gridAutoRows' },
271
+
272
+ // grid item
273
+ ga: { prop: 'gridArea', utils: { '1/1': '1 / 1' }, bp: 1 },
274
+ gc: { prop: 'gridColumn', utils: { '1/-1': '1 / -1' }, bp: 1 },
275
+ gr: { prop: 'gridRow', utils: { '1/-1': '1 / -1' }, bp: 1 },
276
+ gcs: { prop: 'gridColumnStart' },
277
+ gce: { prop: 'gridColumnEnd' },
278
+ grs: { prop: 'gridRowStart' },
279
+ gre: { prop: 'gridRowEnd' },
280
+
281
+ // places
282
+ // -(ai|ac|ji|jc|aslf|jslf): / -$1:
283
+ ai: {
284
+ prop: 'alignItems',
285
+ presets: [...PLACE_PRESETS, 'stretch'],
286
+ utils: PLACE_UTILS,
287
+ shorthands: PLACE_SHORTHANDS,
288
+ bp: 1,
289
+ },
290
+ ac: {
291
+ prop: 'alignContent',
292
+ presets: PLACE_PRESETS,
293
+ utils: { ...PLACE_UTILS, between: 'space-between' },
294
+ shorthands: PLACE_SHORTHANDS,
295
+ bp: 1,
296
+ },
297
+ ji: {
298
+ prop: 'justifyItems',
299
+ presets: [...PLACE_PRESETS, 'stretch'],
300
+ utils: PLACE_UTILS,
301
+ shorthands: PLACE_SHORTHANDS,
302
+ bp: 1,
303
+ },
304
+ jc: {
305
+ prop: 'justifyContent',
306
+ presets: PLACE_PRESETS,
307
+ utils: { ...PLACE_UTILS, between: 'space-between' },
308
+ shorthands: PLACE_SHORTHANDS,
309
+ bp: 1,
310
+ },
311
+ aslf: {
312
+ prop: 'alignSelf',
313
+ presets: [...PLACE_PRESETS, 'stretch'],
314
+ shorthands: PLACE_SHORTHANDS,
315
+ },
316
+ jslf: {
317
+ prop: 'justifySelf',
318
+ presets: [...PLACE_PRESETS, 'stretch'],
319
+ shorthands: PLACE_SHORTHANDS,
320
+ },
321
+ pi: { prop: 'placeItems' },
322
+ pc: { prop: 'placeContent' },
323
+ pslf: { prop: 'placeSelf' },
324
+ order: { prop: 'order', presets: ['0', '-1', '1'] },
325
+
326
+ // transform
327
+ translate: {
328
+ prop: 'translate',
329
+ utils: {
330
+ '-50X': '-50% 0',
331
+ '-50Y': '0 -50%',
332
+ '-50XY': '-50% -50%',
333
+ },
334
+ },
335
+ //rtt
336
+ rotate: {
337
+ prop: 'rotate',
338
+ utils: {
339
+ [`45`]: '45deg',
340
+ '-45': '-45deg',
341
+ [`90`]: '90deg',
342
+ '-90': '-90deg',
343
+ // '180': '180deg',
344
+ },
345
+ },
346
+ //scl
347
+ scale: {
348
+ prop: 'scale',
349
+ utils: {
350
+ '-X': '-1 1',
351
+ '-Y': '1 -1',
352
+ '-XY': '-1 -1',
353
+ },
354
+ },
355
+
356
+ // others
357
+ // msk: { prop: 'mask', bp: 1 },
358
+ ovw: { prop: 'overflowWrap', utils: { any: 'anywhere' } },
359
+ whitespace: { prop: 'whiteSpace', presets: ['nowrap'] },
360
+ // wordbreak: { prop: 'wordBreak', utils: { keep: 'keep-all', all: 'break-all' } },
361
+ writing: { prop: 'writingMode', token: 'writing', tokenClass: 1, bp: 1 },
362
+ float: { prop: 'float', presets: ['left', 'right'] },
363
+ clear: { prop: 'clear', presets: ['both'] },
364
+ isolation: { prop: 'isolation', presets: ['isolate'] },
365
+
366
+ // transition
367
+ duration: { isVar: 1 },
368
+ delay: { isVar: 1 },
369
+ ease: { isVar: 1 },
370
+ };
@@ -0,0 +1,42 @@
1
+ import getSvgUrl from '../helper/getSvgUrl.js';
2
+ // import minifyHtml from '../helper/minifyHtml.js';
3
+
4
+ export default {
5
+ isContainer: {
6
+ className: 'is--container',
7
+ preset: ['s', 'm', 'l'],
8
+ presetClass: '-container',
9
+ customVar: '--contentSz',
10
+ tokenKey: 'sz',
11
+ },
12
+ isLayer: 'is--layer',
13
+ isLinkBox: 'is--linkBox',
14
+ isSide: 'is--side',
15
+ isSkipFlow: 'is--skipFlow',
16
+ hasGutter: 'has--gutter',
17
+
18
+ // set class
19
+
20
+ setShadow: 'set-shadow',
21
+ setHov: 'set-hov',
22
+ setTransition: 'set-transition',
23
+ setSnap: 'set-snap',
24
+ setMask: {
25
+ // 'set-mask',
26
+ className: 'set-mask',
27
+ setStyles: (propVal) => {
28
+ // minify化
29
+ // propVal = minifyHtml(propVal);
30
+ let imgUrl = propVal;
31
+ if (imgUrl.startsWith('<svg')) {
32
+ imgUrl = getSvgUrl(propVal, 'base64');
33
+ }
34
+ return {
35
+ '--maskImg': imgUrl,
36
+ };
37
+ },
38
+ },
39
+ setPlain: 'set-plain',
40
+ setRevert: 'set-revert',
41
+ setInnerRs: 'set-innerRs',
42
+ };
@@ -0,0 +1,26 @@
1
+ export default {
2
+ fz: ['root', 'base', '5xl', '4xl', '3xl', '2xl', 'xl', 'l', 'm', 's', 'xs', '2xs'],
3
+ lh: ['base', 'xs', 's', 'l', 'xl'],
4
+ lts: ['base', 's', 'l'],
5
+ ff: ['base', 'accent', 'mono'],
6
+ fw: ['thin', 'light', 'normal', 'medium', 'bold', 'black'],
7
+ o: ['-10', '-20', '-30'],
8
+ bdrs: ['5', '10', '20', '30', '40', '50', '99', 'inner'],
9
+ bxsh: ['5', '10', '20', '30', '40', '50'],
10
+ sz: ['xs', 's', 'm', 'l', 'xl', 'min', 'full', 'outer'],
11
+ ar: ['og'],
12
+ space: {
13
+ pre: '--s',
14
+ values: ['5', '10', '20', '30', '40', '50', '60', '70', '80'],
15
+ },
16
+ c: {
17
+ pre: '--c--',
18
+ values: ['base', 'base-2', 'text', 'text-2', 'line', 'link', 'main', 'accent'],
19
+ },
20
+ palette: {
21
+ pre: '--',
22
+ values: ['red', 'blue', 'green', 'yellow', 'purple', 'orange', 'pink', 'gray', 'white', 'black', 'keycolor'],
23
+ },
24
+ writing: ['vertical'],
25
+ flow: ['s', 'base', 'l'],
26
+ };
@@ -0,0 +1,28 @@
1
+ // import minifyHtml from './minifyHtml.js';
2
+
3
+ /**
4
+ * svgをcssの image url に変換
5
+ */
6
+ const getSvgUrl = (svg, encode = '') => {
7
+ if (!svg) return '';
8
+
9
+ // minify化
10
+ // svg = minifyHtml(svg);
11
+
12
+ if ('base64' === encode) {
13
+ // memo: btoa() だけだとマルチバイト文字が入った時にエラーになる。
14
+ // encodeURIComponent() でそれを回避できるがそれだとSVGとして描画できず、 unescape() と組み合わせることで期待する動作になった。 see: https://www.softel.co.jp/blogs/tech/archives/4133
15
+ // svg = window.btoa(unescape(encodeURIComponent(svg)));
16
+
17
+ // memo: Buffer 使えば非推奨な関数を使わなくてもいい see: https://hackersheet.com/naopoyo/sheets/bvtrkwt
18
+ svg = Buffer.from(svg).toString('base64');
19
+ return `url(data:image/svg+xml;base64,${svg})`;
20
+ }
21
+
22
+ // シングルクォートをダブルクォートに変換
23
+ svg = svg.replace(/'/g, '"');
24
+ // カラーコードの先頭の # → %23 に置換
25
+ svg = svg.replace(/="#/g, '="%23');
26
+ return `url('data:image/svg+xml,${svg}')`;
27
+ };
28
+ export default getSvgUrl;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * html文字列をminify
3
+ */
4
+ const minifyHtml = (html) => {
5
+ if (!html) return '';
6
+
7
+ // 改行先に削除
8
+ html = html.replace(/\r?\n/g, '');
9
+
10
+ // タブ → スペース
11
+ html = html.replace(/\t/g, ' ');
12
+
13
+ // 複数のスペースを1つに
14
+ html = html.replace(/\s\s+/g, ' ');
15
+
16
+ // タグとタグの間のスペースを削除
17
+ html = html.replace(/> </g, '><');
18
+
19
+ return html;
20
+ };
21
+
22
+ export default minifyHtml;
@@ -0,0 +1,67 @@
1
+ function isObj(value) {
2
+ return value && typeof value === 'object' && !Array.isArray(value);
3
+ }
4
+
5
+ /**
6
+ * 深いマージを行う関数
7
+ * @param {Object} origin - マージ先となる元オブジェクト
8
+ * @param {Object} source - マージするソース(このデータに更新される)
9
+ * @returns {Object} マージされたオブジェクト
10
+ */
11
+ export function objDeepMerge(origin, source) {
12
+ // originとsourceがオブジェクトかどうかをチェック
13
+ if (!origin || typeof origin !== 'object' || Array.isArray(origin)) {
14
+ return source;
15
+ }
16
+ if (!source || typeof source !== 'object' || Array.isArray(source)) {
17
+ return origin;
18
+ }
19
+
20
+ const result = { ...origin };
21
+
22
+ for (const key in source) {
23
+ if (Object.hasOwn(source, key)) {
24
+ const originValue = result[key];
25
+ const sourceValue = source[key];
26
+
27
+ if (!originValue) {
28
+ // origin側に存在しない新たなキーの場合はそのまま追加する
29
+ result[key] = sourceValue;
30
+ } else if (isObj(sourceValue) && isObj(originValue)) {
31
+ // どちらもオブジェクトの場合は再帰的にマージ
32
+ result[key] = objDeepMerge(originValue, sourceValue);
33
+ } else {
34
+ // どちらかのデータがobjectではない場合、そのまま上書き
35
+ result[key] = sourceValue;
36
+ }
37
+ }
38
+ }
39
+
40
+ return result;
41
+ }
42
+
43
+ /**
44
+ * オブジェクト内の配列を再帰的にSetに変換する関数
45
+ * @param {any} obj - 変換対象のオブジェクト
46
+ * @returns {any} 変換されたオブジェクト
47
+ */
48
+ export function arrayConvertToSet(obj) {
49
+ // 配列の場合はSetに変換
50
+ if (Array.isArray(obj)) {
51
+ return new Set(obj);
52
+ }
53
+
54
+ // オブジェクトの場合は再帰的に処理
55
+ if (isObj(obj)) {
56
+ const result = {};
57
+ for (const key in obj) {
58
+ if (Object.hasOwn(obj, key)) {
59
+ result[key] = arrayConvertToSet(obj[key]);
60
+ }
61
+ }
62
+ return result;
63
+ }
64
+
65
+ // その他の値はそのまま返す
66
+ return obj;
67
+ }
@@ -0,0 +1,15 @@
1
+ import defaultConfig from './default-config.js';
2
+ import userConfig from 'lism-css/config.js'; // ユーザーが上書きできる
3
+ import { objDeepMerge, arrayConvertToSet } from './helper.js';
4
+
5
+ export const CONFIG = objDeepMerge(defaultConfig, userConfig);
6
+
7
+ const { tokens, props, states } = CONFIG;
8
+
9
+ // 配列を Set化.
10
+ export const TOKENS = arrayConvertToSet(structuredClone(tokens));
11
+ export const PROPS = arrayConvertToSet(structuredClone(props));
12
+ export const STATES = states;
13
+
14
+ // ブレイクポイント
15
+ export const BREAK_POINTS = ['sm', 'md', 'lg', 'xl'];
package/config.js ADDED
@@ -0,0 +1,2 @@
1
+ // ユーザーのプロジェクトファイルから上書きできる設定
2
+ export default {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { getAccIconProps as n } from "./getProps.js";
3
3
  import i from "../Lism/index.js";
4
- import e from "../Icon/index.js";
4
+ import e from "../atomic/Icon/index.js";
5
5
  function u({ icon: r = "caret-down", viewBox: c, children: t = null, ...m }) {
6
6
  return /* @__PURE__ */ o(i, { ...n(m), children: t || /* @__PURE__ */ o(e, { viewBox: c, icon: r }) });
7
7
  }
@@ -1,29 +1,27 @@
1
- import i from "../../lib/helper/atts.js";
2
- function c({ lismClass: a, ...o }) {
3
- return o.lismClass = i(a, "d--accordion"), o;
1
+ import n from "../../lib/helper/atts.js";
2
+ function r({ lismClass: a, ...o }) {
3
+ return o.lismClass = n(a, "d--accordion"), o;
4
4
  }
5
- function d({ isTrigger: a, ...o }) {
6
- const n = {
5
+ function t({ isTrigger: a, ...o }) {
6
+ const s = {
7
7
  lismClass: "d--accordion_icon",
8
- tag: "span",
9
- d: "inline-grid"
8
+ tag: "span"
9
+ // d: 'inline-grid',
10
10
  };
11
- return a && (n.tag = "button", o["data-role"] = "trigger"), { ...n, ...o };
11
+ return a && (s.tag = "button", o["data-role"] = "trigger"), { ...s, ...o };
12
12
  }
13
- const r = {
14
- header: { lismClass: "d--accordion_header", ai: "c" },
15
- label: { lismClass: "d--accordion_label", tag: "span", fx: "1" },
13
+ const i = {
14
+ header: { lismClass: "d--accordion_header" },
15
+ label: { lismClass: "d--accordion_label", tag: "span" },
16
16
  body: {
17
17
  lismClass: "d--accordion_body"
18
- // trs: true,
19
18
  },
20
19
  inner: {
21
- lismClass: "d--accordion_inner",
22
- ov: "hidden"
20
+ lismClass: "d--accordion_inner"
23
21
  }
24
22
  };
25
23
  export {
26
- r as defaultProps,
27
- d as getAccIconProps,
28
- c as getAccProps
24
+ i as defaultProps,
25
+ t as getAccIconProps,
26
+ r as getAccProps
29
27
  };
@@ -1,6 +1,6 @@
1
- import { Body as o, Label as c, Header as r, Accordion as e } from "./index2.js";
2
- import t from "./AccIcon.js";
3
- const a = { Root: e, Header: r, Label: c, Icon: t, Body: o };
1
+ import { HeaderLabel as o, Body as e, Label as r, Header as c, Accordion as a } from "./index2.js";
2
+ import d from "./AccIcon.js";
3
+ const i = { Root: a, Header: c, Label: r, Icon: d, Body: e, HeaderLabel: o };
4
4
  export {
5
- a as default
5
+ i as default
6
6
  };