najwer23morsels 0.0.1 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # najwer23morsels
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - TextBox
8
+
3
9
  ## 0.0.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1 +1,19 @@
1
- Morsels!
1
+ # Morsels!
2
+
3
+ ### Global css variables available
4
+
5
+ ```CSS
6
+ :root {
7
+ /* Main */
8
+ --najwer23morselsFontFamily: --fontFamily, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica,
9
+ Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
10
+
11
+ /* MorselsTextBox */
12
+ --najwer23morselsTextBoxMargin: 20px;
13
+ --najwer23morselsTextBoxColor: red;
14
+ --najwer23morselsTextBoxColorHover: orange;
15
+ --najwer23morselsTextBoxLineHeight: 1.42857;
16
+ --najwer23morselsTextBoxFontWeight: 400;
17
+ --najwer23morselsTextBoxFontWeightHover: 800
18
+ }
19
+ ```
@@ -0,0 +1,18 @@
1
+ export type TextBoxTag = 'h1' | 'h2' | 'h3' | 'p' | 'div';
2
+ interface TextBoxProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ tag?: TextBoxTag;
5
+ mobileSize: number;
6
+ desktopSize: number;
7
+ lineHeight?: number | string;
8
+ target?: string;
9
+ rel?: string;
10
+ href?: string;
11
+ color?: string;
12
+ colorHover?: string;
13
+ margin?: string | 0;
14
+ fontWeight?: number;
15
+ fontWeightHover?: number;
16
+ }
17
+ export declare const TextBox: React.FC<TextBoxProps>;
18
+ export {};
package/lib/Textbox.js ADDED
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";var r={morselsTextBox:"TextBox-module_morselsTextBox__h97Ta"};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("@layer najwer23morselsTextBox{.TextBox-module_morselsTextBox__h97Ta{--mobileFontSize:var(--ms);--desktopFontSize:var(--ds);--minViewport:400;--maxViewport:1400;--textBoxFontFamilyDefault:-apple-system,BlinkMacSystemFont,avenir next,avenir,segoe ui,helvetica neue,helvetica,Cantarell,Ubuntu,roboto,noto,arial,sans-serif;--clampMinSize:min(var(--mobileFontSize),var(--desktopFontSize));--clampMaxSize:max(var(--mobileFontSize),var(--desktopFontSize));--fluidStartSize:var(--mobileFontSize);--fluidEndSize:var(--desktopFontSize);--sizeDifference:calc(var(--fluidEndSize) - var(--fluidStartSize));--viewportRange:calc(var(--maxViewport) - var(--minViewport));--slope:calc(var(--sizeDifference)/var(--viewportRange));--intercept:calc(var(--fluidStartSize) - var(--slope)*var(--minViewport));color:var(--najwer23morselsTextBoxColor,var(--c));font-family:var(--najwer23morselsFontFamily,var(--textBoxFontFamilyDefault));font-size:clamp(calc(var(--clampMinSize)/16*1rem),calc(var(--slope)*100vw + var(--intercept)/16*1rem),calc(var(--clampMaxSize)/16*1rem));font-weight:var(--najwer23morselsTextBoxFontWeight,var(--fw));line-height:var(--najwer23morselsTextBoxLineHeight,var(--lh,1.42857));margin:var(--najwer23morselsTextBoxMargin,var(--m));& a{color:var(--najwer23morselsTextBoxColor,var(--c));font-weight:var(--najwer23morselsTextBoxFontWeight,var(--fw));text-decoration:unset;transition:color .3s ease-in-out;&:active,&:focus-visible,&:hover{color:var(--najwer23morselsTextBoxColorHover,var(--ch,var(--c)));font-weight:var(--najwer23morselsTextBoxFontWeightHover,var(--fwh,var(--fw)));text-decoration:underline}}}}");const o=({tag:o="div",children:a,className:i,target:l,rel:n,mobileSize:s,desktopSize:m,lineHeight:c,color:v,href:x,colorHover:d,margin:f,fontWeight:h,fontWeightHover:p,...w})=>e(o,{style:{"--fw":h,"--fwh":p,"--ch":d,"--c":v,"--ms":s,"--ds":m,"--lh":c,...null!=f?{"--m":f}:{}},className:[r.morselsTextBox,"MorselsTextBox",i].filter(Boolean).join(" "),...w,children:[x&&t("a",{className:"MorselsTextBoxLink",href:x,target:l,rel:n,children:a}),!x&&a]});o.displayName="TextBox";export{o as TextBox};
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { Button } from './Button';
2
- export { Button };
1
+ import { TextBox } from './TextBox';
2
+ export { TextBox };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najwer23morsels",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.ts",
@@ -16,54 +16,45 @@
16
16
  "publish:minor": "yarn build && npm version minor --force && npm publish && rimraf ./lib && rimraf ./.yarn/cache",
17
17
  "publish:major": "yarn build && npm version major --force && npm publish && rimraf ./lib && rimraf ./.yarn/cache",
18
18
  "god": "yarn publish:patch",
19
- "plop": "plop && yarn format",
19
+ "plop": "plop && yarn format && yarn start",
20
20
  "format": "prettier --write \"**/*.{json,mdx,ts,tsx,md,css,mjs}\"",
21
21
  "release": "yarn build && yarn && changeset && changeset version && changeset publish && rimraf ./lib && rimraf ./.yarn/cache"
22
22
  },
23
23
  "devDependencies": {
24
- "@changesets/cli": "^2.27.11",
25
- "@rollup/plugin-node-resolve": "^16.0.0",
24
+ "@changesets/cli": "^2.29.5",
25
+ "@rollup/plugin-node-resolve": "^16.0.1",
26
26
  "@rollup/plugin-terser": "0.4.4",
27
- "@storybook/addon-actions": "^8.4.7",
28
- "@storybook/addon-console": "^3.0.0",
29
- "@storybook/addon-essentials": "^8.4.7",
30
- "@storybook/addon-interactions": "^8.4.7",
31
- "@storybook/addon-links": "^8.4.7",
32
- "@storybook/addon-onboarding": "^8.4.7",
33
- "@storybook/blocks": "^8.4.7",
34
- "@storybook/react": "^8.4.7",
35
- "@storybook/react-vite": "^8.4.7",
36
- "@storybook/test": "^8.4.7",
37
- "@types/react": "^19.0.2",
38
- "@types/react-dom": "^19.0.2",
39
- "@vitejs/plugin-react": "^4.3.4",
40
- "gh-pages": "^6.2.0",
27
+ "@storybook/react-vite": "^9.0.13",
28
+ "@types/react": "^19.1.8",
29
+ "@types/react-dom": "^19.1.6",
30
+ "@vitejs/plugin-react": "^4.6.0",
31
+ "gh-pages": "^6.3.0",
41
32
  "plop": "^4.0.1",
42
- "postcss": "^8.4.49",
43
- "prettier": "^3.4.2",
44
- "react": "^19.0.0",
45
- "react-dom": "^19.0.0",
33
+ "postcss": "^8.5.6",
34
+ "prettier": "^3.6.2",
35
+ "react": "^19.1.0",
36
+ "react-dom": "^19.1.0",
46
37
  "rimraf": "^6.0.1",
47
- "rollup": "^4.29.1",
48
- "rollup-plugin-dts": "6.1.1",
49
- "rollup-plugin-output-size": "^1.5.0",
38
+ "rollup": "^4.44.1",
39
+ "rollup-plugin-dts": "6.2.1",
40
+ "rollup-plugin-output-size": "^2.0.0",
50
41
  "rollup-plugin-peer-deps-external": "^2.2.4",
51
42
  "rollup-plugin-postcss": "^4.0.2",
52
43
  "rollup-plugin-typescript2": "0.36.0",
53
- "storybook": "^8.4.7",
44
+ "storybook": "^9.0.13",
54
45
  "storybook-css-modules-preset": "^1.1.1",
55
- "typescript": "^5.7.2",
56
- "vite": "^6.0.5"
46
+ "typescript": "^5.8.3",
47
+ "vite": "^7.0.0"
57
48
  },
58
49
  "peerDependencies": {
59
- "react": "^19.0.0",
60
- "react-dom": "^19.0.0"
50
+ "react": "^19.1.0",
51
+ "react-dom": "^19.1.0"
61
52
  },
62
53
  "keywords": [
63
54
  "react",
64
55
  "react 19",
65
56
  "storybook",
66
- "storybook 8",
57
+ "storybook 9",
67
58
  "design-system",
68
59
  "gh-pages",
69
60
  "typescript",
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1080" height="1080" viewBox="0 0 1080 1080">
2
+ <rect width="1080" height="1080" fill="black"/>
3
+ </svg>
Binary file
package/lib/Button.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
2
- kind?: 'classic' | 'strawberry' | 'close' | 'calendar';
3
- }>;
package/lib/Button.js DELETED
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";var e={classic:"Button-module_classic__WXpHW",close:"Button-module_close__huc4i",calendar:"Button-module_calendar__ae4lP",strawberry:"Button-module_strawberry__4z7d-"};!function(o,e){void 0===e&&(e={});var t=e.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=o:n.appendChild(document.createTextNode(o))}}('@layer najwer23snacksButton{.Button-module_calendar__ae4lP,.Button-module_classic__WXpHW,.Button-module_close__huc4i,.Button-module_strawberry__4z7d-{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);background-color:var(--najwer23snacks-button-bg-color);border:unset;border-radius:8px;color:var(--najwer23snacks-button-font-color);cursor:pointer;font-family:var(--najwer23snacks-font-family);font-size:var(--najwer23snacks-button-font-size);font-weight:var(--najwer23snacks-button-font-weight);letter-spacing:normal;padding:10px 17px;transition:.1s;transition:background-color .3s,box-shadow .3s;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;@media (hover:hover) and (pointer:fine){&:hover{background-color:var(--najwer23snacks-button-bg-color-hover);box-shadow:var(--najwer23snacks-button-shadow)}}&:active{background-color:var(--najwer23snacks-button-bg-color-active);box-shadow:var(--najwer23snacks-button-shadow)}&:focus-visible{background-color:var(--najwer23snacks-button-bg-color-focus);box-shadow:var(--najwer23snacks-button-shadow);outline:none}&:disabled{background-color:var(--najwer23snacks-button-bg-color-disabled);box-shadow:none;cursor:not-allowed}}.Button-module_calendar__ae4lP{padding:7px 10px}.Button-module_strawberry__4z7d-{height:50px;padding:12px;&>*{display:flex;position:relative;&>*{background-color:#fff;border-radius:10px;height:4px;width:30px;&:after,&:before{background-color:#fff;border-radius:10px;content:"";position:absolute}&:after{bottom:-10px;left:0;right:0;top:10px}&:before{bottom:10px;left:0;right:0;top:-10px}}}}.Button-module_close__huc4i{height:50px;&>*{height:25px;position:relative;width:20px;&>*{&:after,&:before{background-color:#fff;border-radius:10px;content:"";height:4px;left:-9px;position:absolute;width:40px}&:before{top:10.5px;transform:rotate(45deg)}&:after{top:10.5px;transform:rotate(-45deg)}}}}}');const t=({children:t,kind:r="classic",...n})=>o("button",{type:"button",...n,className:e[r],children:"close"===r||"strawberry"===r?o("div",{children:o("div",{})}):t});t.displayName="Button";export{t as Button};