@medyll/cssfabric 0.2.0 → 0.2.3

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 (211) hide show
  1. package/.github/workflows/main.yml +33 -0
  2. package/.idea/cssfabric.iml +11 -0
  3. package/.idea/misc.xml +9 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/vcs.xml +6 -0
  6. package/.vscode/settings.json +24 -0
  7. package/bin/index.js +8 -0
  8. package/cssfabric.sass.js +8 -0
  9. package/gulpfile.js +532 -0
  10. package/package.json +17 -61
  11. package/src/app.css +107 -0
  12. package/src/app.d.ts +15 -0
  13. package/src/app.html +13 -0
  14. package/src/components/Header.svelte +17 -0
  15. package/src/components/HeaderSiteTitle.svelte +12 -0
  16. package/src/components/InnerMenu.svelte +27 -0
  17. package/src/components/SubHeader.svelte +10 -0
  18. package/src/components/SubHeaderH.svelte +3 -0
  19. package/src/components/SubSubHeader.svelte +22 -0
  20. package/src/components/demo/DemoElement.svelte +86 -0
  21. package/src/components/demo/elements/DemoElementBackgroundColor.svelte +7 -0
  22. package/src/components/demo/elements/DemoElementBorder.svelte +8 -0
  23. package/src/components/demo/elements/DemoElementBorderColor.svelte +8 -0
  24. package/src/components/demo/elements/DemoElementColor.svelte +8 -0
  25. package/src/components/demo/elements/DemoElementGrid.svelte +53 -0
  26. package/src/components/demo/elements/DemoElementMargin.svelte +8 -0
  27. package/src/components/demo/elements/DemoElementPadding.svelte +10 -0
  28. package/src/components/demo/elements/DemoElementScale.svelte +9 -0
  29. package/src/components/demo/elements/DemoElementTable.svelte +34 -0
  30. package/src/components/demo/elements/DemoElementText.svelte +10 -0
  31. package/src/components/demo/proxy/ProxyDsp.svelte +12 -0
  32. package/src/components/demo/proxy/ProxyDspArray.svelte +19 -0
  33. package/src/components/demo/proxy/ProxyDspObject.svelte +17 -0
  34. package/src/components/docs/Docs.svelte +97 -0
  35. package/src/components/docs/DocsClassNames.svelte +34 -0
  36. package/src/components/docs/DocsDemo.svelte +84 -0
  37. package/src/components/header/Header.svelte +105 -0
  38. package/src/components/header/svelte-logo.svg +1 -0
  39. package/src/cssfabric/_utils.scss +203 -0
  40. package/{_generated → src/cssfabric}/index.d.ts +0 -0
  41. package/src/cssfabric/modules/_cssfabric-config.scss +173 -0
  42. package/src/cssfabric/modules/_mixins.scss +1 -0
  43. package/src/cssfabric/modules/animation/_animation-vars.scss +17 -0
  44. package/src/cssfabric/modules/animation/animation.scss +3 -0
  45. package/src/cssfabric/modules/base/_base-vars.scss +19 -0
  46. package/src/cssfabric/modules/base/base.scss +75 -0
  47. package/src/cssfabric/modules/box/_box-build.scss +304 -0
  48. package/src/cssfabric/modules/box/_box-vars.scss +121 -0
  49. package/src/cssfabric/modules/box/box-responsive.scss +18 -0
  50. package/src/cssfabric/modules/box/box.scss +3 -0
  51. package/src/cssfabric/modules/color/_color-build.scss +196 -0
  52. package/src/cssfabric/modules/color/_color-vars.scss +80 -0
  53. package/src/cssfabric/modules/color/color-responsive.scss +23 -0
  54. package/src/cssfabric/modules/color/color.scss +9 -0
  55. package/src/cssfabric/modules/css-fabric.scss +2 -0
  56. package/src/cssfabric/modules/flex/_flex-build.scss +150 -0
  57. package/src/cssfabric/modules/flex/_flex-vars.scss +84 -0
  58. package/src/cssfabric/modules/flex/flex-responsive.scss +25 -0
  59. package/src/cssfabric/modules/flex/flex.scss +3 -0
  60. package/src/cssfabric/modules/grid/_grid-build.scss +84 -0
  61. package/src/cssfabric/modules/grid/_grid-vars.scss +88 -0
  62. package/src/cssfabric/modules/grid/grid-responsive.scss +25 -0
  63. package/src/cssfabric/modules/grid/grid.scss +6 -0
  64. package/src/cssfabric/modules/menu/_menu-build.scss +120 -0
  65. package/src/cssfabric/modules/menu/_menu-vars.scss +29 -0
  66. package/src/cssfabric/modules/menu/menu-responsive.scss +19 -0
  67. package/src/cssfabric/modules/menu/menu.scss +6 -0
  68. package/src/cssfabric/modules/overflow/_overflow-build.scss +22 -0
  69. package/src/cssfabric/modules/overflow/_overflow-vars.scss +31 -0
  70. package/src/cssfabric/modules/overflow/overflow-responsive.scss +25 -0
  71. package/src/cssfabric/modules/overflow/overflow.scss +7 -0
  72. package/src/cssfabric/modules/scale/_scale-build.scss +142 -0
  73. package/src/cssfabric/modules/scale/_scale-vars.scss +84 -0
  74. package/src/cssfabric/modules/scale/scale-responsive.scss +23 -0
  75. package/src/cssfabric/modules/scale/scale.scss +8 -0
  76. package/src/cssfabric/modules/table/_table-build.scss +134 -0
  77. package/src/cssfabric/modules/table/_table-vars.scss +30 -0
  78. package/src/cssfabric/modules/table/table-responsive.scss +24 -0
  79. package/src/cssfabric/modules/table/table.scss +8 -0
  80. package/src/cssfabric/modules/text/_text-build.scss +166 -0
  81. package/src/cssfabric/modules/text/_text-vars.scss +87 -0
  82. package/src/cssfabric/modules/text/text-responsive.scss +26 -0
  83. package/src/cssfabric/modules/text/text.scss +6 -0
  84. package/src/cssfabric/modules/theme/_theme-build.scss +133 -0
  85. package/src/cssfabric/modules/theme/_theme-vars.scss +46 -0
  86. package/src/cssfabric/modules/theme/theme.scss +6 -0
  87. package/src/cssfabric/modules/vars.scss +49 -0
  88. package/src/cssfabric/modules/zindex/_zindex-vars.scss +14 -0
  89. package/src/cssfabric/modules/zindex/zindex.scss +15 -0
  90. package/src/hooks.ts +27 -0
  91. package/src/index.d.ts +3 -0
  92. package/src/index.ts +4 -0
  93. package/{_generated → src/lib/_generated}/cssFabric.vars.json +1 -1
  94. package/{_generated → src/lib/_generated}/export.variables.md +0 -0
  95. package/src/lib/_generated/index.d.ts +3 -0
  96. package/{_generated → src/lib/_generated}/readme.md +0 -0
  97. package/{init/importCssVars.js → src/lib/init/importCssVars.ts} +3 -2
  98. package/src/lib/scripts/cssfabric.ts +54 -0
  99. package/{scripts/cssfabricClassNames.js → src/lib/scripts/cssfabricClassNames.ts} +112 -42
  100. package/{scripts → src/lib/scripts}/index.d.ts +0 -0
  101. package/src/lib/scripts/index.ts +8 -0
  102. package/src/lib/scripts/utils.ts +37 -0
  103. package/{styles → src/lib/styles}/animation/animation.css +0 -0
  104. package/{styles → src/lib/styles}/animation/animation.min.css +0 -0
  105. package/{styles → src/lib/styles}/base/base.css +0 -0
  106. package/{styles → src/lib/styles}/base/base.min.css +0 -0
  107. package/{styles → src/lib/styles}/box/box.css +0 -0
  108. package/{styles → src/lib/styles}/box/box.min.css +0 -0
  109. package/{styles → src/lib/styles}/box/box.responsive.css +0 -0
  110. package/{styles → src/lib/styles}/box/box.responsive.min.css +0 -0
  111. package/{styles → src/lib/styles}/color/color.css +0 -0
  112. package/{styles → src/lib/styles}/color/color.min.css +0 -0
  113. package/{styles → src/lib/styles}/color/color.responsive.css +0 -0
  114. package/{styles → src/lib/styles}/color/color.responsive.min.css +0 -0
  115. package/src/lib/styles/cssfabric.css +129144 -0
  116. package/src/lib/styles/cssfabric.min.css +350 -0
  117. package/src/lib/styles/cssfabric.responsive.css +418463 -0
  118. package/src/lib/styles/cssfabric.responsive.min.css +225 -0
  119. package/{styles → src/lib/styles}/flex/flex.css +0 -0
  120. package/{styles → src/lib/styles}/flex/flex.min.css +0 -0
  121. package/{styles → src/lib/styles}/flex/flex.responsive.css +0 -0
  122. package/{styles → src/lib/styles}/flex/flex.responsive.min.css +0 -0
  123. package/{styles → src/lib/styles}/grid/grid.css +0 -0
  124. package/{styles → src/lib/styles}/grid/grid.min.css +0 -0
  125. package/{styles → src/lib/styles}/grid/grid.responsive.css +0 -0
  126. package/{styles → src/lib/styles}/grid/grid.responsive.min.css +0 -0
  127. package/{styles → src/lib/styles}/menu/menu.css +0 -0
  128. package/{styles → src/lib/styles}/menu/menu.min.css +0 -0
  129. package/{styles → src/lib/styles}/menu/menu.responsive.css +0 -0
  130. package/{styles → src/lib/styles}/menu/menu.responsive.min.css +0 -0
  131. package/{styles → src/lib/styles}/overflow/overflow.css +0 -0
  132. package/{styles → src/lib/styles}/overflow/overflow.min.css +0 -0
  133. package/{styles → src/lib/styles}/overflow/overflow.responsive.css +0 -0
  134. package/{styles → src/lib/styles}/overflow/overflow.responsive.min.css +0 -0
  135. package/{styles → src/lib/styles}/scale/scale.css +0 -0
  136. package/{styles → src/lib/styles}/scale/scale.min.css +0 -0
  137. package/{styles → src/lib/styles}/scale/scale.responsive.css +0 -0
  138. package/{styles → src/lib/styles}/scale/scale.responsive.min.css +0 -0
  139. package/{styles → src/lib/styles}/table/table.css +0 -0
  140. package/{styles → src/lib/styles}/table/table.min.css +0 -0
  141. package/{styles → src/lib/styles}/table/table.responsive.css +0 -0
  142. package/{styles → src/lib/styles}/table/table.responsive.min.css +0 -0
  143. package/{styles → src/lib/styles}/text/text.css +0 -0
  144. package/{styles → src/lib/styles}/text/text.min.css +0 -0
  145. package/{styles → src/lib/styles}/text/text.responsive.css +0 -0
  146. package/{styles → src/lib/styles}/text/text.responsive.min.css +0 -0
  147. package/{styles → src/lib/styles}/theme/theme.css +48 -0
  148. package/{styles → src/lib/styles}/theme/theme.min.css +1 -1
  149. package/{styles → src/lib/styles}/vars.css +1 -1
  150. package/{styles → src/lib/styles}/vars.min.css +0 -0
  151. package/{styles → src/lib/styles}/zindex/zindex.css +0 -0
  152. package/{styles → src/lib/styles}/zindex/zindex.min.css +0 -0
  153. package/src/routes/__layout.svelte +91 -0
  154. package/src/routes/cssfabric-modules/[module]/__layout.svelte +75 -0
  155. package/src/routes/cssfabric-modules/[module]/classnames/index.svelte +24 -0
  156. package/src/routes/cssfabric-modules/[module]/demo/index.svelte +24 -0
  157. package/src/routes/cssfabric-modules/[module]/docs/index.svelte +30 -0
  158. package/src/routes/cssfabric-modules/[module]/index.svelte +3 -0
  159. package/src/routes/cssfabric-modules/__layout.svelte +26 -0
  160. package/src/routes/cssfabric-modules/index.svelte +0 -0
  161. package/src/routes/index.svelte +62 -0
  162. package/src/routes/installation/__layout.svelte +1 -0
  163. package/src/routes/installation/index.svelte +28 -0
  164. package/src/scripts/utils.ts +26 -0
  165. package/src/utils.ts +71 -0
  166. package/src/vendor/index.d.ts +3 -0
  167. package/src/vendor/normalize/normalize.min.css +2 -0
  168. package/src/vendor/sass-json-export/CHANGELOG.md +26 -0
  169. package/src/vendor/sass-json-export/Gruntfile.js +60 -0
  170. package/src/vendor/sass-json-export/LICENSE +20 -0
  171. package/src/vendor/sass-json-export/README.md +90 -0
  172. package/src/vendor/sass-json-export/package.json +60 -0
  173. package/src/vendor/sass-json-export/stylesheets/encode/api/_json.scss +26 -0
  174. package/src/vendor/sass-json-export/stylesheets/encode/encode.scss +17 -0
  175. package/src/vendor/sass-json-export/stylesheets/encode/helpers/_quote.scss +9 -0
  176. package/src/vendor/sass-json-export/stylesheets/encode/mixins/_json.scss +42 -0
  177. package/src/vendor/sass-json-export/stylesheets/encode/types/_bool.scss +7 -0
  178. package/src/vendor/sass-json-export/stylesheets/encode/types/_color.scss +8 -0
  179. package/src/vendor/sass-json-export/stylesheets/encode/types/_list.scss +14 -0
  180. package/src/vendor/sass-json-export/stylesheets/encode/types/_map.scss +15 -0
  181. package/src/vendor/sass-json-export/stylesheets/encode/types/_null.scss +7 -0
  182. package/src/vendor/sass-json-export/stylesheets/encode/types/_number.scss +8 -0
  183. package/src/vendor/sass-json-export/stylesheets/encode/types/_string.scss +8 -0
  184. package/src/vendor/sass-json-export/stylesheets/sass-json-export.scss +2 -0
  185. package/src/vendor/sass-json-export/test/encode/_index.scss +14 -0
  186. package/src/vendor/sass-json-export/test/encode/api/_json.scss +29 -0
  187. package/src/vendor/sass-json-export/test/encode/helpers/_quote.scss +6 -0
  188. package/src/vendor/sass-json-export/test/encode/types/_bool.scss +6 -0
  189. package/src/vendor/sass-json-export/test/encode/types/_color.scss +7 -0
  190. package/src/vendor/sass-json-export/test/encode/types/_list.scss +25 -0
  191. package/src/vendor/sass-json-export/test/encode/types/_map.scss +17 -0
  192. package/src/vendor/sass-json-export/test/encode/types/_null.scss +8 -0
  193. package/src/vendor/sass-json-export/test/encode/types/_number.scss +68 -0
  194. package/src/vendor/sass-json-export/test/encode/types/_string.scss +9 -0
  195. package/src/vendor/sass-json-export/test/test.scss +9 -0
  196. package/static/favicon.png +0 -0
  197. package/static/robots.txt +3 -0
  198. package/svelte.config.js +25 -0
  199. package/tsconfig.json +3 -0
  200. package/webpack.config.js +55 -0
  201. package/init/importCssVars.d.ts +0 -1
  202. package/scripts/cssfabric.d.ts +0 -24
  203. package/scripts/cssfabric.js +0 -43
  204. package/scripts/cssfabricClassNames.d.ts +0 -14
  205. package/scripts/index.js +0 -4
  206. package/scripts/utils.d.ts +0 -5
  207. package/scripts/utils.js +0 -38
  208. package/styles/cssfabric.css +0 -61792
  209. package/styles/cssfabric.min.css +0 -168
  210. package/styles/cssfabric.responsive.css +0 -200596
  211. package/styles/cssfabric.responsive.min.css +0 -108
@@ -0,0 +1,49 @@
1
+ @use "../_utils";
2
+ @use "sass:color";
3
+ @use '../../cssfabric/modules/color/color-vars';
4
+ @use '../../cssfabric/modules/color/color-build' as colorBuild;
5
+ @use "../../cssfabric/modules/box/box-vars" as box;
6
+ @use "../../cssfabric/modules/box/box-build" as boxBuild;
7
+ @use "../../cssfabric/modules/theme/theme-build" as themeBuild;
8
+ @use "../../cssfabric/modules/text/text-build" as textBuild;
9
+
10
+ @import 'cssfabric-config';
11
+
12
+ $themes: map-get($cssfabric-config, themes) !default;
13
+ $theme-light: map-get($themes, light) !default;
14
+ $theme-dark: map-get($themes, dark) !default;
15
+
16
+ /* cssFabric vars yes */
17
+ :root {
18
+ @include themeBuild.themeCssVars($theme-color-primary,$theme-color-secondary,$theme-color-tertiary);
19
+ @include colorBuild.buildColorCssVars();
20
+ /* boxes */
21
+ @include boxBuild.pmbCssVars();
22
+ /* text */
23
+ @include textBuild.textCssVars();
24
+ /* shadows */
25
+ @include boxBuild.shadowsCssVars();
26
+ /* themes */
27
+ @include themeBuild.themeBaseVars($theme-light);
28
+
29
+ --theme-color-border: #{color.change($theme-color-foreground,$alpha:0.2)};
30
+ &,[data-theme="light"] {
31
+ @include themeBuild.themeBaseVars($theme-light);
32
+
33
+ --theme-color-border: #{color.change($theme-color-foreground,$alpha:0.2)};
34
+ --theme-color-overlay: rgba(208, 191, 151, 0.2);
35
+ }
36
+
37
+ [data-theme="dark"] {
38
+ @include themeBuild.themeBaseVars($theme-dark);
39
+
40
+ --theme-color-border: #{color.change($theme-dark-color-foreground,$alpha:0.3)};
41
+ --theme-color-overlay: rgba(255, 255, 255, 0.1);
42
+ }
43
+ }
44
+
45
+
46
+
47
+
48
+
49
+
@@ -0,0 +1,14 @@
1
+ $zindex-metadata: (
2
+ title: zindex,
3
+ tag: zI,
4
+ description: "cssfabric zindex module to set z-index on all html elements",
5
+ );
6
+ $zindex-config: (
7
+ z_groups: (
8
+ a,
9
+ z
10
+ ),
11
+ );
12
+ $zindex-docs: (
13
+ z_groups: _,
14
+ );
@@ -0,0 +1,15 @@
1
+
2
+ @use 'zindex-vars';
3
+ $zindex-config: zindex-vars.$zindex-config;
4
+ // load scss config file
5
+ @use '../../_utils';
6
+
7
+ // read variables
8
+ $z_groups: map-get($zindex-config, z_groups);
9
+
10
+
11
+ @for $z_value from 0 through 10 {
12
+ .zI-#{$z_value} {
13
+ z-index: (($z_value) * 100);
14
+ }
15
+ }
package/src/hooks.ts ADDED
@@ -0,0 +1,27 @@
1
+ import cookie from 'cookie';
2
+ import {v4 as uuid} from '@lukeed/uuid';
3
+ import type {Handle} from '@sveltejs/kit';
4
+
5
+ export const handle: Handle = async ({event, resolve}) => {
6
+ const cookies = cookie.parse(event.request.headers.get('cookie') || '');
7
+ event.locals.userid = cookies.userid || uuid();
8
+
9
+ const response = await resolve(event, {
10
+ ssr : false,
11
+ transformPage: ({html}) => html.replace('old', 'new')
12
+ });
13
+
14
+ if (!cookies.userid) {
15
+ // if this is the first time the user has visited this app,
16
+ // set a cookie so that we recognise them when they return
17
+ response.headers.set(
18
+ 'set-cookie',
19
+ cookie.serialize('userid', event.locals.userid, {
20
+ path : '/',
21
+ httpOnly: true
22
+ })
23
+ );
24
+ }
25
+
26
+ return response;
27
+ };
package/src/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const cssfabric;
2
+
3
+ export default cssfabric;
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+
2
+ import cssfabric from "./lib/scripts/cssfabric"
3
+
4
+ export default cssfabric
@@ -1,8 +1,8 @@
1
1
  {"cssfabric":{"modules":{"animation":{"_data": {"attention_props": [], "in_out_props": {"back": []}}, "_metadata": {"title": "animation", "description": "cssfabric simplest animation module"}, "_docs": {"attention_props": "", "in_out_props": ""}},
2
2
  "box":{"_data": {"unit-config": "rem", "border-unit-config": "px", "unit-size-config": 0.5, "unit-border-size-config": 1, "sizes-config": 12, "border-sizes-px-config": 3, "shadows-steps": 5, "shadows_step_multiplier": 2, "position-shorthand-config": "pos", "display-shorthand-config": "dsp", "shadow-shorthand-config": "shad", "border-shorthand-config": "border", "padding-shorthand-config": "pad", "margin-shorthand-config": "marg", "cssProps": {"borderShorthands": {"_": ["top", "bottom", "left", "right"], "t": "top", "b": "bottom", "l": "left", "r": "right", "all": ["top", "bottom", "left", "right"], "u": ["bottom", "left", "right"], "ii": ["left", "right"], "tb": ["top", "bottom"]}, "positionProps": {"abs": "absolute", "rel": "relative", "stat": "static", "fix": "fixed", "sticky": "sticky"}, "displayProps": {"block": "block", "none": "none", "inline": "inline", "block-inline": "inline-block", "flex-inline": "inline-flex", "tbl": "table", "tbl-row": "table-row", "tbl-cell": "table-cell", "tbl-column": "table-column"}}}, "_metadata": {"title": "box", "tag": "box", "description": "cssfabric box module to set heights, paddings, margins and shadows on all html elements"}, "_docs": {"attributes": {"padding": {"tag": "pad", "keys": ["_", "t", "b", "l", "r", "all", "u", "ii", "tb"], "values": {"_": "_", "1": "0.5rem", "2": "1rem", "3": "1.5rem", "4": "2rem", "5": "2.5rem", "6": "3rem", "7": "3.5rem", "8": "4rem", "9": "4.5rem", "10": "5rem", "11": "5.5rem", "12": "6rem"}, "levels": {"_": ["_", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}, "about": "padding properties for html elements"}, "margin": {"tag": "marg", "keys": ["_", "t", "b", "l", "r", "all", "u", "ii", "tb"], "values": {"_": "_", "1": "0.5rem", "2": "1rem", "3": "1.5rem", "4": "2rem", "5": "2.5rem", "6": "3rem", "7": "3.5rem", "8": "4rem", "9": "4.5rem", "10": "5rem", "11": "5.5rem", "12": "6rem"}, "levels": {"_": ["_", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]}, "about": "margin properties for html elements"}, "border": {"tag": "border", "keys": ["_", "t", "b", "l", "r", "all", "u", "ii", "tb"], "values": {"_": "_", "1": "1px", "2": "2px", "3": "3px"}, "levels": {"_": ["_", 1, 2, 3]}, "about": "border properties for html elements"}, "radius": {"tag": "radiusGuy"}, "shadow": {"tag": "shad", "values": {"2": "0.83333333331.724137931", "4": "1.66666666673.4482758621", "8": "3.33333333336.8965517241", "16": "6.666666666713.7931034483", "32": "13.333333333327.5862068966"}, "levels": {"_": [2, 4, 8, 16, 32]}, "about": "applying shadows give depth and levels to your design"}}}},
3
3
  "base":{"_data": {"cfg-has-dimension-strict": true, "CFG_HAS_DIMENSION_MIN": true, "CFG_HAS_DIMENSION_MAX": true, "size_step": "0.5rem", "sizes": {"tiny": 32, "small": 64, "medium": 128, "large": 256, "full": "100%"}}, "_metadata": {"title": "base", "tag": "base", "description": "cssfabric base config variables"}, "_docs": []},
4
- "color":{"_data": {"gray-config": {"start": "#f4f4f4", "end": "#999", "steps": 5}, "color-types-config": ["color", "bg", "bg-themed", "border-color"], "theme": {"primary": "#201700", "secondary": "#D14B02", "tertiary": "#88D102", "foreground": "#282230", "background": "#ffffff", "paper": "#f1f1f1"}, "scheme": {"discrete": "#ccc", "success": "green", "info": "#FFDD57FF", "warning": "#e6b905", "alert": "#ff7300", "error": "red"}, "palette": {"yellow": "#ffb900", "orange": "#d83b01", "red": "#d13438", "magenta": "#b4009e", "purple": "#5c2d91", "green": "#107c10", "teal": "#008272", "blue": "#0078d4", "dark": "#323232"}, "gray": "getGraySteps(5, #f4f4f4, #999)"}, "_metadata": {"title": "color", "title_tag": "its about colors", "description": "cssfabric color system: its about colors"}, "_docs": {"attributes": {"color": {"tag": "color", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"], "gray": ["getGraySteps(5, #f4f4f4, #999)"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "color for text level html elements"}, "background-color": {"tag": "bg", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"], "gray": ["getGraySteps(5, #f4f4f4, #999)"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "background colors"}, "background-themed": {"tag": "bg-themed", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"gray": ["getGraySteps(5, #f4f4f4, #999)"], "scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "same as background-color, but with added contrasted color to text"}, "border-color": {"tag": "border-color", "keys": ["palette", "gray"], "levelsLinked": {"gray": ["getGraySteps(5, #f4f4f4, #999)"], "scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"]}, "about": "border colors are slightly darker to maximize surrounding effect"}}}},
5
4
  "flex":{"_data": {"moduleName": "flex", "moduleNameShort": "flex", "horCode": "h", "vertCode": "v", "gridFullWidth": "main", "grow-shrink-steps": 2, "cssProps": {"flexWrap": {"wrap": "wrap", "wrap-reverse": "wrap-reverse"}, "grid-justify": {"start": "flex-start", "end": "flex-end", "between": "space-between", "stretch": "stretch", "center": "flex-center"}, "grid-items": {"baseline": "baseline", "stretch": "stretch", "start": "flex-start", "center": "center", "end": "flex-end"}, "grid-content": {"start": "flex-start", "center": "center", "end": "flex-end", "between": "space-between", "equal": "space-evenly"}}, "cssItemsProps": {"self": {"start": "flex-start", "end": "flex-end", "stretch": "stretch"}}}, "_metadata": {"title": "flex", "tag": "flex", "description": "cssfabric flex system module"}, "_docs": {"attributes": {"grid": {"tag": "flex", "keys": ["v", "h"], "classNames": {"align": ["top", "middle", "bottom", "left", "right", "center", "middle-center", "stretch"], "grid": ["wrap", "wrap-reverse"]}, "about": "a classic flex grid system, and hey, it gets height !"}, "self": {"tag": "self", "keys": ["start", "end", "stretch"], "about": "flex children specific classnames"}}}},
5
+ "color":{"_data": {"gray-config": {"start": "#f4f4f4", "end": "#999", "steps": 5}, "color-types-config": ["color", "bg", "bg-themed", "border-color"], "theme": {"primary": "#201700", "secondary": "#D14B02", "tertiary": "#88D102", "foreground": "#282230", "background": "#ffffff", "paper": "#f1f1f1"}, "scheme": {"discrete": "#ccc", "success": "green", "info": "#FFDD57FF", "warning": "#e6b905", "alert": "#ff7300", "error": "red"}, "palette": {"yellow": "#ffb900", "orange": "#d83b01", "red": "#d13438", "magenta": "#b4009e", "purple": "#5c2d91", "green": "#107c10", "teal": "#008272", "blue": "#0078d4", "dark": "#323232"}, "gray": "getGraySteps(5, #f4f4f4, #999)"}, "_metadata": {"title": "color", "title_tag": "its about colors", "description": "cssfabric color system: its about colors"}, "_docs": {"attributes": {"color": {"tag": "color", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"], "gray": ["getGraySteps(5, #f4f4f4, #999)"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "color for text level html elements"}, "background-color": {"tag": "bg", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"], "gray": ["getGraySteps(5, #f4f4f4, #999)"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "background colors"}, "background-themed": {"tag": "bg-themed", "keys": ["scheme", "palette", "gray"], "levelsLinked": {"gray": ["getGraySteps(5, #f4f4f4, #999)"], "scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"]}, "levelsDeclin": {"palette": ["_", "lighter", "light", "dark", "darker", "complement"]}, "about": "same as background-color, but with added contrasted color to text"}, "border-color": {"tag": "border-color", "keys": ["palette", "gray"], "levelsLinked": {"gray": ["getGraySteps(5, #f4f4f4, #999)"], "scheme": ["discrete", "success", "info", "warning", "alert", "error"], "palette": ["yellow", "orange", "red", "magenta", "purple", "green", "teal", "blue", "dark"]}, "about": "border colors are slightly darker to maximize surrounding effect"}}}},
6
6
  "grid":{"_data": {"moduleName": "grid", "moduleNameShort": "grid", "horCode": "h", "vertCode": "v", "gridFullWidth": "main", "grow-shrink-steps": 4, "cssProps": {"flexWrap": {"wrap": "wrap", "wrap-reverse": "wrap-reverse"}, "grid-justify": {"start": "flex-start", "end": "flex-end", "between": "space-between", "stretch": "stretch", "center": "flex-center"}, "grid-items": {"baseline": "baseline", "stretch": "stretch", "start": "flex-start", "center": "center", "end": "flex-end"}, "grid-content": {"start": "flex-start", "center": "center", "end": "flex-end", "between": "space-between", "equal": "space-evenly"}}, "cssItemsProps": {"self": {"start": "flex-start", "end": "flex-end", "stretch": "stretch"}}, "grid-max-rows": 8, "grid-max-cols": 12}, "_metadata": {"title": "grid", "tag": "grid", "description": "cssfabric flex grid system module"}, "_docs": {"attributes": {"grid": {"tag": "grid", "keys": ["v", "h"], "classNames": {"align": ["top", "middle", "bottom", "left", "right", "center", "middle-center", "stretch"], "grid": ["wrap", "wrap-reverse"]}, "about": "a classic grid system"}, "self": {"tag": "self", "keys": ["start", "end", "stretch"], "about": "grid children specific classnames"}}}},
7
7
  "menu":{"_data": {"menu_class_name": "menu", "menu_class_name_short": "ul", "orientations": {"v": "vertical", "h": "horizontal"}, "menu_item_class_name": "menu-item", "menu_item_class_name_short": "li", "menu_item_disabled_tag": "disabled", "menu_item_selected_tag": "selected", "menu_dropdown_tag": "drop", "menu_dropdown_open": "open", "menu_dropdown_close": "close"}, "_metadata": {"title": "menu", "tag": "ul", "description": "cssfabric menu module to set menu style"}, "_docs": {"attributes": {"menu": {"tag": "menu", "keys": ["h", "v"]}}}},
8
8
  "overflow":{"_data": {"overflow_props": ["overflow", "overflow-x", "overflow-y"], "overflow_values": ["visible", "hidden", "clip", "scroll", "auto"], "cssProps": {"overflow": {"visible": "visible", "hidden": "hidden", "clip": "clip", "scroll": "scroll", "_": "auto"}}}, "_metadata": {"title": "overflow", "tag": "flow", "description": "cssfabric overflow module to set overflow styles on all html elements"}, "_docs": {"attributes": {"overflow": {"tag": "flow", "keys": ["visible", "hidden", "clip", "scroll", "auto"]}, "overflowX": {"tag": "flowX", "keys": ["visible", "hidden", "clip", "scroll", "auto"]}, "overflowY": {"tag": "flowY", "keys": ["visible", "hidden", "clip", "scroll", "auto"]}}}},
@@ -0,0 +1,3 @@
1
+ declare const module;
2
+
3
+ export default module;
File without changes
@@ -1,2 +1,3 @@
1
- // copy css vars file
2
- export {};
1
+ // copy css vars file
2
+
3
+ export {}
@@ -0,0 +1,54 @@
1
+ import jsonConfig from "../_generated/cssFabric.vars.json" ;
2
+ import cssfabricClassNames from "./cssfabricClassNames";
3
+
4
+ export type IFabricConfModulePart = Record<string, any>;
5
+ export type IFabricConfModuleDataPart = Record<string, any>;
6
+ export type IFabricConfModuleMetaDataPart = Record<string, any>;
7
+ export type IFabricConfModuleDocsPart = Record<string, any>;
8
+ export type TFabricConfModuleDocsAttributesPart = Record<string, any>;
9
+
10
+ //
11
+ const getModuleList = (): Record<string, any> => {
12
+ return jsonConfig["cssfabric"]?.["modules"] || {};
13
+ };
14
+
15
+ const getModuleConfig = (module?: string): IFabricConfModulePart => {
16
+ if (module) return jsonConfig["cssfabric"]?.["modules"]?.[module] || {};
17
+ return jsonConfig;
18
+ };
19
+
20
+ const getModuleData = (module?: string): IFabricConfModuleDataPart => {
21
+ if (module) return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_data"] || {};
22
+ return jsonConfig;
23
+ };
24
+
25
+ const getModuleMetaData = (module?: string): IFabricConfModuleMetaDataPart => {
26
+ if (module)
27
+ return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_metadata"] || {};
28
+ return jsonConfig;
29
+ };
30
+
31
+ const getModuleDocs = (module?: string): IFabricConfModuleDocsPart => {
32
+ if (module)
33
+ return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"] || {};
34
+ return jsonConfig;
35
+ };
36
+
37
+ const getModuleDocsAttributes = (module?: string): TFabricConfModuleDocsAttributesPart => {
38
+ if (module)
39
+ return jsonConfig["cssfabric"]?.["modules"]?.[module]?.["_docs"]?.["attributes"] || {};
40
+ return jsonConfig;
41
+ };
42
+
43
+ export default {
44
+ getModuleList,
45
+ getModuleConfig,
46
+ getModuleData,
47
+ getModuleMetaData,
48
+ getModuleDocs,
49
+ getModuleDocsAttributes,
50
+ getClassNames: cssfabricClassNames,
51
+ getModuleClassNames: cssfabricClassNames,
52
+ getModuleTagClassNames: cssfabricClassNames.getModuleTagClassNames,
53
+ getModuleTagDebug: cssfabricClassNames.getModuleTagDebug,
54
+ };
@@ -1,48 +1,94 @@
1
- import cssfabric from "./cssfabric";
2
- import utils from "./utils";
3
- function loopIt(props) {
4
- const { module } = props;
5
- const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
1
+ import cssfabric from "./cssfabric"
2
+ import utils from "./utils";
3
+
4
+ export interface IListCssfabricClassNamesProps {
5
+ module: string;
6
+ moduleAttribute: any;
7
+ outputStyle?: 'default' | 'debug';
8
+ }
9
+
10
+ type TFabricClassName = string;
11
+ type TClassNameFragment = string | number;
12
+
13
+ type TCollect = string[];
14
+ type TFabricClassNameList = TFabricClassName[];
15
+ type TFabricClassNameListFragments = TClassNameFragment[];
16
+
17
+ type TGuess = any;
18
+ type TLevelKey = string;
19
+
20
+ type level = string[];
21
+
22
+ type IModuleLevels = level | level[] | [] | any[] | Record<string, any[]>;
23
+
24
+
25
+ export interface ILoopIt {
26
+ module: string;
6
27
  }
7
- function cssfabricClassNames(props) {
8
- const { module, moduleAttribute, outputStyle } = props;
28
+
29
+ function loopIt(props: ILoopIt) {
30
+
31
+ const {module} = props;
9
32
  const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
10
- const fabricAttributes = moduleAttributes[moduleAttribute];
11
- const moduleTag = fabricAttributes["tag"];
12
- const moduleKeys = fabricAttributes["keys"] || undefined;
13
- const moduleLevels = fabricAttributes["levels"] || undefined;
14
- const moduleLevelsLinked = fabricAttributes["levelsLinked"] || undefined;
15
- const moduleLevelsExtended = fabricAttributes["levelsDeclin"] || undefined;
16
- const moduleClassNames = fabricAttributes["classNames"] || undefined;
17
- let finalOutput = [];
18
- let finalOutputDebug = {};
33
+
34
+ }
35
+
36
+ function cssfabricClassNames(props: IListCssfabricClassNamesProps) {
37
+
38
+ const {module, moduleAttribute, outputStyle} = props;
39
+ const moduleAttributes = cssfabric.getModuleDocsAttributes(module);
40
+
41
+ const fabricAttributes = moduleAttributes[moduleAttribute];
42
+ const moduleTag = fabricAttributes["tag"];
43
+ const moduleKeys: any[] = fabricAttributes["keys"] || undefined;
44
+ const moduleLevels: IModuleLevels = fabricAttributes["levels"] || undefined;
45
+ const moduleLevelsLinked: IModuleLevels = fabricAttributes["levelsLinked"] || undefined;
46
+ const moduleLevelsExtended = fabricAttributes["levelsDeclin"] || undefined;
47
+ const moduleClassNames = fabricAttributes["classNames"] || undefined;
48
+
49
+ let finalOutput: TCollect = [];
50
+ let finalOutputDebug: Record<string, any> = {};
51
+
52
+
19
53
  return doParse(outputStyle);
20
- function doParse(mode) {
21
- let keyList, levelList, levelListLinked, levelListDeclin;
54
+
55
+ function doParse(mode?: string) {
56
+
57
+ let keyList,
58
+ levelList,
59
+ levelListLinked,
60
+ levelListDeclin;
61
+
22
62
  const finalOut = [];
23
63
  const debugOut = {};
64
+
24
65
  if (moduleKeys && moduleKeys.length) {
25
66
  // beware of any [][]
26
67
  keyList = concatenateWithKey(moduleTag, moduleKeys);
27
68
  }
69
+
28
70
  if (moduleLevels && Object.keys(moduleLevels).length) { // object !!!
29
71
  levelList = Object.keys(moduleLevels).map((level) => {
30
- let val = moduleLevels[level];
72
+ let val = moduleLevels[level]
31
73
  return concatenateWithKey(level, val);
32
74
  }).flat();
33
75
  }
76
+
34
77
  if (moduleLevelsLinked && Object.keys(moduleLevelsLinked).length) {
35
78
  levelListLinked = Object.keys(moduleLevelsLinked).map((level) => {
36
- let val = moduleLevelsLinked[level];
79
+ let val = moduleLevelsLinked[level]
37
80
  return concatenateWithKey(level, val);
38
81
  }).flat();
39
82
  }
83
+
84
+
40
85
  if (moduleLevelsExtended && Object.keys(moduleLevelsExtended).length) {
41
86
  levelListDeclin = Object.keys(moduleLevelsExtended).map((level) => {
42
- let val = moduleLevelsLinked[level];
87
+ let val = moduleLevelsLinked[level]
43
88
  return concatenateWithKey(level, val);
44
89
  }).flat();
45
90
  }
91
+
46
92
  // prefix all now , and link
47
93
  // colors :
48
94
  if (keyList && !moduleLevels && !moduleLevelsLinked) {
@@ -50,18 +96,24 @@ function cssfabricClassNames(props) {
50
96
  finalOut.push(keyList);
51
97
  registerDebug('default', keyList);
52
98
  }
99
+
53
100
  if (moduleKeys && (moduleLevels || moduleLevelsLinked)) {
54
101
  // base
55
102
  if (moduleLevels) {
56
103
  let tg = keyList.map(x => {
104
+
57
105
  let tre = Object.keys(moduleLevels).map((level) => {
58
- let val = moduleLevels[level];
106
+ let val = moduleLevels[level]
107
+
59
108
  let debugKey = (x !== '_' && x.toString().charAt(0) !== '_') ? x : level;
60
- debugKey = (level.toString().charAt(0) === '_') ? debugKey : debugKey + '-' + level;
61
- registerDebug(x, concatenateWithKey(debugKey, val), level);
109
+ debugKey = (level.toString().charAt(0)==='_')? debugKey : debugKey + '-' + level
110
+ registerDebug(x, concatenateWithKey(debugKey , val), level);
111
+
62
112
  return concatenateWithKey(level, val);
63
- }).flat(4);
113
+ }).flat(4)
114
+
64
115
  return concatenateWithKey(x, tre);
116
+
65
117
  });
66
118
  // is it declinated ? only colors, so nope
67
119
  // export
@@ -71,10 +123,12 @@ function cssfabricClassNames(props) {
71
123
  if (moduleLevelsLinked) {
72
124
  //
73
125
  let yt = Object.values(moduleKeys).map(moduleKey => {
126
+
74
127
  if (moduleKeys.includes(moduleKey)) {
75
128
  let out = [];
76
129
  // linked are here !!
77
130
  registerDebug('linked', concatenateWithKey(moduleTag + '-' + moduleKey, moduleLevelsLinked[moduleKey]), moduleKey);
131
+
78
132
  out.push(concatenateWithKey(moduleKey, moduleLevelsLinked[moduleKey]));
79
133
  // is it declinated ?
80
134
  if (moduleLevelsExtended && moduleLevelsExtended[moduleKey]) {
@@ -82,65 +136,81 @@ function cssfabricClassNames(props) {
82
136
  out.push(moduleLevelsLinked[moduleKey].map((z) => {
83
137
  // iddem
84
138
  registerDebug('declinated', concatenateWithKey(moduleTag + '-' + moduleKey + '-' + z, moduleLevelsExtended[moduleKey]), z);
139
+
85
140
  return concatenateWithKey(z, moduleLevelsExtended[moduleKey]);
86
- }).flat(2));
141
+ }).flat(2))
87
142
  }
143
+
88
144
  // flatten for group here
89
145
  return out.flat(2);
90
146
  }
91
147
  }).flat();
148
+
92
149
  // export
93
150
  finalOut.push(concatenateWithKey(moduleTag, yt));
151
+
94
152
  }
95
153
  if (levelListDeclin) {
96
154
  } // only colors ? don't go there
155
+
97
156
  }
98
157
  if (!keyList && levelList) {
99
158
  // export
100
159
  let kkk = concatenateWithKey(moduleTag, levelList);
101
160
  finalOut.push(kkk);
102
161
  }
162
+
103
163
  if (moduleClassNames) {
104
- let kk = parseClassNames();
164
+ let kk = parseClassNames();
105
165
  let kkk = concatenateWithKey(moduleTag, kk);
166
+
106
167
  registerDebug('classnames', kk);
168
+
107
169
  // export
108
170
  finalOut.push(kkk);
109
171
  }
172
+
110
173
  if (mode && mode === 'debug') {
111
- return finalOutputDebug;
112
- }
113
- else {
174
+ return finalOutputDebug
175
+
176
+ } else {
114
177
  return finalOut.flat(2);
115
178
  }
116
179
  }
117
- function registerDebug(tag, data, nestedTag) {
180
+
181
+ function registerDebug(tag: string, data: string[], nestedTag?: string) {
118
182
  if (nestedTag) {
119
- if (!finalOutputDebug[tag])
120
- finalOutputDebug[tag] = {};
183
+ if (!finalOutputDebug[tag]) finalOutputDebug[tag] = {}
121
184
  finalOutputDebug[tag][nestedTag] = finalOutputDebug[tag][nestedTag] ? finalOutputDebug[tag][nestedTag].concat(data) : data;
122
- }
123
- else {
185
+
186
+ } else {
187
+
124
188
  finalOutputDebug[tag] = finalOutputDebug[tag] ? finalOutputDebug[tag].concat(data) : data;
125
189
  }
126
190
  }
191
+
127
192
  function parseClassNames() {
128
193
  return Object.keys(moduleClassNames).map((klass) => {
129
194
  return concatenateWithKey(klass, moduleClassNames[klass]);
130
195
  }).flat();
131
196
  }
132
- function concatenateWithKey(key, levelLine) {
133
- return levelLine.map((levelTag) => {
197
+
198
+
199
+ function concatenateWithKey(key, levelLine: string[]) {
200
+ return levelLine.map((levelTag: string) => {
134
201
  return [key, levelTag].filter((val) => {
135
- return (val !== '_' && val.toString().charAt(0) !== '_');
202
+ return (val !== '_' && val.toString().charAt(0) !== '_')
136
203
  }).filter(x => Boolean(x)).join('-');
137
- });
204
+ })
138
205
  }
206
+
207
+
139
208
  }
209
+
140
210
  export default {
141
211
  getModuleTagClassNames: cssfabricClassNames,
142
- getModuleTagDebug: function doIt(props) {
143
- props.outputStyle = 'debug';
212
+ getModuleTagDebug: function doIt(props: IListCssfabricClassNamesProps) {
213
+ props.outputStyle = 'debug'
144
214
  return cssfabricClassNames(props);
145
215
  }
146
- };
216
+ }
File without changes
@@ -0,0 +1,8 @@
1
+
2
+
3
+ function buildReadme(vars: string){
4
+ return "readme"
5
+ }
6
+
7
+
8
+ export default buildReadme;
@@ -0,0 +1,37 @@
1
+ const utils = {
2
+
3
+ isArrayOfTypes: (arr: any): any => {
4
+ let ret = '';
5
+
6
+ if (!Array.isArray(arr)) {
7
+ return false;
8
+ }
9
+ if (arr.every(x => Array.isArray(x))) ret = 'arrays'
10
+ if (arr.every(x => typeof x === 'number' || typeof x === 'string' ) ) ret = 'strings'
11
+ if (arr.every(x => typeof x === 'string')) ret = 'strings'
12
+ if (arr.every(x => typeof x === 'number')) ret = 'numbers'
13
+ if (arr.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
14
+
15
+ return ret;
16
+ },
17
+
18
+ isObjectOfTypes: (arr: any): any => {
19
+
20
+ if (Array.isArray(arr)) {
21
+ return false;
22
+ }
23
+
24
+ let ret = '';
25
+ let arrValues = Object.values(arr);
26
+
27
+ if (arrValues.every(x => typeof x === 'number' || typeof x === 'string' ) ) ret = 'strings'
28
+ if (arrValues.every(x => Array.isArray(x))) ret = 'arrays'
29
+ if (arrValues.every(x => typeof x === 'string')) ret = 'strings'
30
+ if (arrValues.every(x => typeof x === 'number')) ret = 'numbers'
31
+ if (arrValues.every(x => typeof x === 'object' && !Array.isArray(x))) ret = 'objects'
32
+
33
+ return ret;
34
+ }
35
+ }
36
+
37
+ export default utils;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes