sate-lib 1.1.11 → 1.1.14

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
@@ -7,27 +7,17 @@ A lightweight and modular React component library designed for modern web interf
7
7
 
8
8
  ## Tech Stack
9
9
 
10
- - [Vite](https://vite.dev/guide/)
10
+ - [RSLib](https://rslib.rs/)
11
11
  - [React](https://react.dev/)
12
12
  - [Typescript](https://www.typescriptlang.org/)
13
13
  - [Storybook](https://storybook.js.org/)
14
- - [Sass](https://sass-lang.com/)
15
- - [Rollup](https://www.npmjs.com/package/rollup)
14
+ - [Biome](https://biomejs.dev/)
16
15
 
17
16
  ## Installation
18
17
 
19
18
  ```bash
20
19
  pnpm install
21
- pnpm dev
22
- ```
23
-
24
- ## Fonts
25
-
26
- SATE Lib uses custom fonts to define the typographic styles used in components like Typography.
27
- To keep the bundle lightweight and flexible, fonts are not bundled with the main library output but are still included in the dist/assets/fonts directory.
28
-
29
- ```bash
30
- import "sate-lib/dist/assets/styles/fonts.scss";
20
+ pnpm storybook
31
21
  ```
32
22
 
33
23
  ## Component usage
@@ -0,0 +1,10 @@
1
+ import './button.css';
2
+ interface ButtonProps {
3
+ primary?: boolean;
4
+ backgroundColor?: string;
5
+ size?: 'small' | 'medium' | 'large';
6
+ label: string;
7
+ onClick?: () => void;
8
+ }
9
+ export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
package/dist/Button.js ADDED
@@ -0,0 +1,19 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "./button.css";
3
+ const Button = ({ primary = false, size = 'medium', backgroundColor, label, ...props })=>{
4
+ const mode = primary ? 'demo-button--primary' : 'demo-button--secondary';
5
+ return /*#__PURE__*/ jsx("button", {
6
+ type: "button",
7
+ className: [
8
+ 'demo-button',
9
+ `demo-button--${size}`,
10
+ mode
11
+ ].join(' '),
12
+ style: {
13
+ backgroundColor
14
+ },
15
+ ...props,
16
+ children: label
17
+ });
18
+ };
19
+ export { Button };
@@ -0,0 +1,35 @@
1
+ .demo-button {
2
+ cursor: pointer;
3
+ border: 0;
4
+ border-radius: 3em;
5
+ font-weight: 700;
6
+ line-height: 1;
7
+ display: inline-block;
8
+ }
9
+
10
+ .demo-button--primary {
11
+ color: #fff;
12
+ background-color: #1ea7fd;
13
+ }
14
+
15
+ .demo-button--secondary {
16
+ color: #333;
17
+ background-color: #0000;
18
+ box-shadow: inset 0 0 0 1px #00000026;
19
+ }
20
+
21
+ .demo-button--small {
22
+ padding: 10px 16px;
23
+ font-size: 12px;
24
+ }
25
+
26
+ .demo-button--medium {
27
+ padding: 11px 20px;
28
+ font-size: 14px;
29
+ }
30
+
31
+ .demo-button--large {
32
+ padding: 12px 24px;
33
+ font-size: 16px;
34
+ }
35
+
@@ -0,0 +1 @@
1
+ export { Button } from './Button';
package/dist/index.js CHANGED
@@ -1,11 +1,2 @@
1
- import*as e from"react";import r from"react";var t,n={exports:{}},o={};var a,i,l={};
2
- /**
3
- * @license React
4
- * react-jsx-runtime.development.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */function s(){return a||(a=1,"production"!==process.env.NODE_ENV&&function(){function e(r){if(null==r)return null;if("function"==typeof r)return r.$$typeof===O?null:r.displayName||r.name||null;if("string"==typeof r)return r;switch(r){case m:return"Fragment";case h:return"Profiler";case d:return"StrictMode";case _:return"Suspense";case k:return"SuspenseList";case S:return"Activity"}if("object"==typeof r)switch("number"==typeof r.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case f:return"Portal";case g:return(r.displayName||"Context")+".Provider";case b:return(r._context.displayName||"Context")+".Consumer";case v:var t=r.render;return(r=r.displayName)||(r=""!==(r=t.displayName||t.name||"")?"ForwardRef("+r+")":"ForwardRef"),r;case w:return null!==(t=r.displayName||null)?t:e(r.type)||"Memo";case j:t=r._payload,r=r._init;try{return e(r(t))}catch(e){}}return null}function t(e){return""+e}function n(e){try{t(e);var r=!1}catch(e){r=!0}if(r){var n=(r=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function o(r){if(r===m)return"<>";if("object"==typeof r&&null!==r&&r.$$typeof===j)return"<...>";try{var t=e(r);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function a(){return Error("react-stack-top-frame")}function i(){var r=e(this.type);return $[r]||($[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(r=this.props.ref)?r:null}function s(r,t,o,a,l,s,p,f){var m,d=t.children;if(void 0!==d)if(a)if(E(d)){for(a=0;a<d.length;a++)c(d[a]);Object.freeze&&Object.freeze(d)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(d);if(N.call(t,"key")){d=e(r);var h=Object.keys(t).filter((function(e){return"key"!==e}));a=0<h.length?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}",A[d+a]||(h=0<h.length?"{"+h.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,d,h,d),A[d+a]=!0)}if(d=null,void 0!==o&&(n(o),d=""+o),function(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return void 0!==e.key}(t)&&(n(t.key),d=""+t.key),"key"in t)for(var b in o={},t)"key"!==b&&(o[b]=t[b]);else o=t;return d&&function(e,r){function t(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof r?r.displayName||r.name||"Unknown":r),function(e,r,t,n,o,a,l,s){return t=a.ref,e={$$typeof:y,type:e,key:r,props:a,_owner:o},null!==(void 0!==t?t:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(r,d,s,0,null===(m=x.A)?null:m.getOwner(),o,p,f)}function c(e){"object"==typeof e&&null!==e&&e.$$typeof===y&&e._store&&(e._store.validated=1)}var u,p=r,y=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),x=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,E=Array.isArray,T=console.createTask?console.createTask:function(){return null},$={},P=(p={"react-stack-bottom-frame":function(e){return e()}})["react-stack-bottom-frame"].bind(p,a)(),R=T(o(a)),A={};l.Fragment=m,l.jsx=function(e,r,t,n,a){var i=1e4>x.recentlyCreatedOwnerStacks++;return s(e,r,t,!1,0,a,i?Error("react-stack-top-frame"):P,i?T(o(e)):R)},l.jsxs=function(e,r,t,n,a){var i=1e4>x.recentlyCreatedOwnerStacks++;return s(e,r,t,!0,0,a,i?Error("react-stack-top-frame"):P,i?T(o(e)):R)}}()),l}var c,u=(i||(i=1,"production"===process.env.NODE_ENV?n.exports=function(){if(t)return o;t=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(r,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:e,type:r,key:o,ref:void 0!==t?t:null,props:n}}return o.Fragment=r,o.jsx=n,o.jsxs=n,o}():n.exports=s()),n.exports),p="badge-styles-module_badge__0T5Ik";function y({className:e="",children:r,...t}){return u.jsx("span",{className:`${p} ${e}`.trim(),...t,children:r})}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},f.apply(null,arguments)}var m;function d(){return d=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},d.apply(null,arguments)}const h={Bed:function(r){return e.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},r),c||(c=e.createElement("path",{d:"M20.25 6.75H3V4.5a.75.75 0 0 0-1.5 0v15a.75.75 0 1 0 1.5 0v-3h19.5v3a.75.75 0 1 0 1.5 0v-9a3.75 3.75 0 0 0-3.75-3.75M3 8.25h6.75V15H3zM11.25 15V8.25h9a2.25 2.25 0 0 1 2.25 2.25V15z"})))},Building:function(r){return e.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},r),m||(m=e.createElement("path",{d:"M21.75 21H19.5V3h.75a.75.75 0 1 0 0-1.5H3.75a.75.75 0 0 0 0 1.5h.75v18H2.25a.75.75 0 1 0 0 1.5h19.5a.75.75 0 1 0 0-1.5M6 3h12v18h-3v-3.75a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0-.75.75V21H6zm7.5 18h-3v-3h3zM8.25 6A.75.75 0 0 1 9 5.25h1.5a.75.75 0 1 1 0 1.5H9A.75.75 0 0 1 8.25 6m4.5 0a.75.75 0 0 1 .75-.75H15a.75.75 0 1 1 0 1.5h-1.5a.75.75 0 0 1-.75-.75m-4.5 3.75A.75.75 0 0 1 9 9h1.5a.75.75 0 1 1 0 1.5H9a.75.75 0 0 1-.75-.75m4.5 0A.75.75 0 0 1 13.5 9H15a.75.75 0 1 1 0 1.5h-1.5a.75.75 0 0 1-.75-.75m-4.5 3.75a.75.75 0 0 1 .75-.75h1.5a.75.75 0 1 1 0 1.5H9a.75.75 0 0 1-.75-.75m4.5 0a.75.75 0 0 1 .75-.75H15a.75.75 0 1 1 0 1.5h-1.5a.75.75 0 0 1-.75-.75"})))}};function b({name:e,size:r=24,...t}){const n=h[e];return n?u.jsx(n,{width:r,height:r,fill:"currentColor",...t}):("production"!==process.env.NODE_ENV&&console.warn(`Icon "${e}" not found.`),null)}var g={typography:"typography-styles-module_typography__h3ta9",typographyTitle:"typography-styles-module_typographyTitle__9V99m",typographyHeader:"typography-styles-module_typographyHeader__k4mIZ",typographyBody:"typography-styles-module_typographyBody__4rtGZ",typographyCaption:"typography-styles-module_typographyCaption__-ci4T"};const v=({as:e="p",variant:r="body",className:t="",children:n,...o})=>{const a=`${g.typography} ${g[`typography${r.charAt(0).toUpperCase()+r.slice(1)}`]} ${t}`.trim();return u.jsx(e,{className:a,...o,children:n})};export{y as Badge,b as Icon,v as Typography};
11
- //# sourceMappingURL=index.js.map
1
+ import { Button } from "./Button.js";
2
+ export { Button };
package/package.json CHANGED
@@ -1,86 +1,48 @@
1
1
  {
2
2
  "name": "sate-lib",
3
- "version": "1.1.11",
4
- "author": "Tiago Sousa (tiagorsousa0@gmail.com)",
5
- "license": "MIT",
3
+ "version": "1.1.14",
6
4
  "type": "module",
7
- "main": "dist/index.js",
8
- "module": "dist/index.js",
9
- "css": "dist/assets/styles/index.css",
10
- "types": "dist/types/index.d.ts",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "types": "./dist/index.d.ts",
11
12
  "files": [
12
- "dist/"
13
+ "dist"
13
14
  ],
14
15
  "scripts": {
15
- "dev": "storybook dev -p 6006",
16
- "lint": "eslint ./src",
17
- "prepare": "husky",
18
- "build": "pnpm build:package && pnpm build:storybook",
19
- "build:package": "rollup --config rollup.config.ts --configPlugin typescript",
20
- "build:storybook": "storybook build"
21
- },
22
- "keywords": [
23
- "design-system",
24
- "react",
25
- "vite",
26
- "storybook",
27
- "components",
28
- "tokens",
29
- "sass",
30
- "ui-kit",
31
- "SATE"
32
- ],
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/TiagoSousa123/sate-lib.git"
36
- },
37
- "dependencies": {
38
- "sass": "^1.89.0"
16
+ "build": "rslib build",
17
+ "build:storybook": "storybook build",
18
+ "check": "biome check --write",
19
+ "dev": "rslib build --watch",
20
+ "format": "biome format --write",
21
+ "storybook": "storybook dev"
39
22
  },
40
23
  "devDependencies": {
41
- "@commitlint/cli": "19.8.0",
42
- "@commitlint/config-conventional": "19.8.0",
43
- "@eslint/js": "^9.25.0",
44
- "@rollup/plugin-babel": "^6.0.4",
45
- "@rollup/plugin-commonjs": "28.0.6",
46
- "@rollup/plugin-node-resolve": "16.0.1",
47
- "@rollup/plugin-terser": "0.4.4",
48
- "@rollup/plugin-typescript": "12.1.3",
49
- "@storybook/addon-a11y": "^9.0.11",
24
+ "@biomejs/biome": "^1.9.4",
25
+ "@rsbuild/core": "1.4.0-beta.4",
26
+ "@rsbuild/plugin-react": "^1.3.2",
27
+ "@rslib/core": "^0.10.2",
50
28
  "@storybook/addon-docs": "^9.0.11",
51
- "@storybook/builder-vite": "^9.0.11",
52
- "@storybook/react-vite": "^9.0.11",
53
- "@svgr/rollup": "^8.1.0",
54
- "@types/react": "^19.1.2",
55
- "@types/react-dom": "^19.1.2",
56
- "@vitejs/plugin-react": "^4.4.1",
57
- "cssnano": "^7.0.7",
58
- "eslint": "^9.25.0",
59
- "eslint-plugin-react-hooks": "^5.2.0",
60
- "eslint-plugin-react-refresh": "^0.4.19",
61
- "eslint-plugin-storybook": "^9.0.11",
62
- "globals": "^16.0.0",
63
- "husky": "^9.1.7",
64
- "postcss": "^8.5.6",
65
- "rollup": "4.44.0",
66
- "rollup-plugin-bundle-stats": "^4.20.2",
67
- "rollup-plugin-copy": "^3.5.0",
68
- "rollup-plugin-postcss": "^4.0.2",
69
- "semantic-release": "^24.2.5",
29
+ "@storybook/addon-essentials": "^9.0.0-alpha.12",
30
+ "@storybook/addon-interactions": "^9.0.0-alpha.10",
31
+ "@storybook/addon-links": "^9.0.11",
32
+ "@storybook/addon-onboarding": "^9.0.11",
33
+ "@storybook/blocks": "^9.0.0-alpha.17",
34
+ "@storybook/react": "^9.0.11",
35
+ "@storybook/test": "^9.0.0-alpha.2",
36
+ "@types/react": "^19.1.8",
37
+ "react": "^19.1.0",
70
38
  "storybook": "^9.0.11",
71
- "typescript": "~5.8.3",
72
- "typescript-eslint": "^8.30.1",
73
- "vite": "^6.3.5",
74
- "vite-plugin-dynamic-import": "^1.6.0",
75
- "vite-plugin-svgr": "^4.3.0"
39
+ "storybook-addon-rslib": "^2.0.1",
40
+ "storybook-react-rsbuild": "^2.0.1",
41
+ "typescript": "^5.8.3"
76
42
  },
77
43
  "peerDependencies": {
78
- "react": "^19.1.0",
79
- "react-dom": "^19.1.0"
44
+ "react": ">=16.9.0",
45
+ "react-dom": ">=16.9.0"
80
46
  },
81
- "eslintConfig": {
82
- "extends": [
83
- "plugin:storybook/recommended"
84
- ]
85
- }
47
+ "private": false
86
48
  }
@@ -1 +0,0 @@
1
- .badge-styles-module_badge__0T5Ik{border-radius:.25rem;color:var(--color-system-content-secondary,#474747);padding:var(--spacing-size-4,.25rem)}.typography-styles-module_typography__h3ta9{color:#111;margin:0}.typography-styles-module_typographyTitle__9V99m{font-family:Author,Arial Black,Impact,sans-serif;font-size:4rem;font-weight:700;line-height:1.1}.typography-styles-module_typographyBody__4rtGZ,.typography-styles-module_typographyCaption__-ci4T,.typography-styles-module_typographyHeader__k4mIZ{font-family:Golos UI,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.typography-styles-module_typographyHeader__k4mIZ{font-size:2rem;font-weight:500;line-height:1.3}.typography-styles-module_typographyBody__4rtGZ{font-size:1rem;font-weight:400;line-height:1.6}.typography-styles-module_typographyCaption__-ci4T{font-size:.875rem;font-weight:400;line-height:1.4;opacity:.7}
@@ -1,87 +0,0 @@
1
- *,
2
- *::before,
3
- *::after {
4
- box-sizing: border-box;
5
- }
6
-
7
- * {
8
- margin: 0;
9
- padding: 0;
10
- outline: none;
11
- }
12
-
13
- ul,
14
- ol {
15
- list-style: none;
16
- }
17
-
18
- html:focus-within {
19
- scroll-behavior: smooth;
20
- }
21
-
22
- a:not([class]) {
23
- text-decoration-skip-ink: auto;
24
- color: inherit;
25
- }
26
-
27
- img,
28
- picture,
29
- svg,
30
- video,
31
- canvas {
32
- max-width: 100%;
33
- height: auto;
34
- vertical-align: middle;
35
- background-repeat: no-repeat;
36
- background-size: cover;
37
- }
38
-
39
- input,
40
- button,
41
- textarea,
42
- select {
43
- font: inherit;
44
- color: inherit;
45
- border: none;
46
- background: none;
47
- outline: none;
48
- }
49
-
50
- @media (prefers-reduced-motion: reduce) {
51
- html:focus-within {
52
- scroll-behavior: auto;
53
- }
54
- *,
55
- *::before,
56
- *::after {
57
- animation-duration: 0.01ms !important;
58
- animation-iteration-count: 1 !important;
59
- transition-duration: 0.01ms !important;
60
- scroll-behavior: auto !important;
61
- transition: none;
62
- }
63
- }
64
-
65
- body,
66
- html {
67
- height: 100%;
68
- scroll-behavior: smooth;
69
- }
70
-
71
- body {
72
- -webkit-font-smoothing: antialiased;
73
- }
74
-
75
- p,
76
- h1,
77
- h2,
78
- h3,
79
- h4,
80
- h5,
81
- h6 {
82
- overflow-wrap: break-word;
83
- }
84
-
85
- button {
86
- cursor: pointer;
87
- }
@@ -1,41 +0,0 @@
1
- :root {
2
- --box-shadow-1: 0px 1px 0px 0px rgba(17, 17, 26, 0.1);
3
- --box-shadow-2: 0px 1px 0px rgba(17, 17, 26, 0.05),
4
- 0px 0px 8px rgba(17, 17, 26, 0.1);
5
-
6
- --opacity-disabled: 0.38;
7
-
8
- --color-theme-core-bright: #317c6c;
9
- --color-theme-core-dark: #b80f0f;
10
- --color-system-content-primary: #0e0e0e;
11
- --color-system-content-secondary: #474747;
12
- --color-system-content-tertiary: #767676;
13
-
14
- --radius-radii-10: 0.625rem;
15
- --radius-radii-16: 1rem;
16
- --radius-radii-24: 1.5rem;
17
- --radius-large-container: 1rem;
18
- --radius-chip: 0.5rem;
19
- --radius-medium-container: 0.75rem;
20
-
21
- --spacing-size-4: 0.25rem;
22
- --spacing-size-154: 9.625rem;
23
- --spacing-size-0: 0;
24
-
25
- --padding-x-small: 0.5rem;
26
- --padding-small: 1rem;
27
- --padding-medium: 1.5rem;
28
- --padding-large: 2rem;
29
-
30
- --size-x-small: 1.5rem;
31
- --size-medium: 2.5rem;
32
- --size-large: 3rem;
33
- --size-x-large: 3.5rem;
34
- --size-small: 2rem;
35
- --size-2x-large: 4.5rem;
36
- --size-2x-small: 1rem;
37
-
38
- --spacing-column-gap-cards: 0.75rem;
39
- --spacing-column-gap-chips: 0.5rem;
40
- --spacing-column-margin-screen-mobile: 1.5rem;
41
- }