rechtspilot-ui 0.1.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/.prettierrc ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "arrowParens": "always",
3
+ "bracketSpacing": true,
4
+ "endOfLine": "lf",
5
+ "htmlWhitespaceSensitivity": "css",
6
+ "insertPragma": false,
7
+ "singleAttributePerLine": false,
8
+ "bracketSameLine": false,
9
+ "jsxBracketSameLine": false,
10
+ "jsxSingleQuote": false,
11
+ "printWidth": 120,
12
+ "proseWrap": "preserve",
13
+ "quoteProps": "as-needed",
14
+ "requirePragma": false,
15
+ "semi": true,
16
+ "singleQuote": true,
17
+ "tabWidth": 2,
18
+ "trailingComma": "es5",
19
+ "useTabs": false,
20
+ "embeddedLanguageFormatting": "auto",
21
+ "vueIndentScriptAndStyle": false,
22
+ "importOrder": [
23
+ "<THIRD_PARTY_MODULES>",
24
+ "@\\w*.\/(.*)",
25
+ "@\/.*.",
26
+ "^[./]"
27
+ ],
28
+ "importOrderSeparation": true,
29
+ "importOrderSortSpecifiers": true,
30
+ "plugins": [
31
+ "@trivago/prettier-plugin-sort-imports"
32
+ ]
33
+ }
@@ -0,0 +1,19 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/stories/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
+ addons: [
6
+ '@storybook/addon-links',
7
+ '@storybook/addon-essentials',
8
+ '@chromatic-com/storybook',
9
+ '@storybook/addon-interactions',
10
+ ],
11
+ docs: {
12
+ defaultName: 'Docs',
13
+ },
14
+ framework: {
15
+ name: '@storybook/react-vite',
16
+ options: {},
17
+ },
18
+ };
19
+ export default config;
@@ -0,0 +1,8 @@
1
+ <link rel="preconnect" href="https://fonts.googleapis.com">
2
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3
+ <link
4
+ href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
5
+ rel="stylesheet">
6
+ <link
7
+ href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lora:ital,wght@0,400..700;1,400..700&display=swap"
8
+ rel="stylesheet">
@@ -0,0 +1,17 @@
1
+ import 'tailwindcss/tailwind.css';
2
+
3
+ import type { Preview } from '@storybook/react';
4
+
5
+ const preview: Preview = {
6
+ tags: ['autodocs'],
7
+ parameters: {
8
+ controls: {
9
+ matchers: {
10
+ color: /(background|color)$/i,
11
+ date: /Date$/i,
12
+ },
13
+ },
14
+ },
15
+ };
16
+
17
+ export default preview;
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Rechstpilot UI Library
2
+
3
+ ### Install dependencies
4
+
5
+ `pnpm install`
6
+
7
+ ### Run locally
8
+
9
+ `pnpm run storybook`
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.ts",
8
+ "css": "index.css",
9
+ "baseColor": "neutral",
10
+ "cssVariables": false,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/components",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/lib/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ }
20
+ }
@@ -0,0 +1,19 @@
1
+ (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();var ve={exports:{}},B={},xe={exports:{}},d={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var G=Symbol.for("react.element"),Ge=Symbol.for("react.portal"),Te=Symbol.for("react.fragment"),Le=Symbol.for("react.strict_mode"),We=Symbol.for("react.profiler"),Ue=Symbol.for("react.provider"),Fe=Symbol.for("react.context"),qe=Symbol.for("react.forward_ref"),Be=Symbol.for("react.suspense"),He=Symbol.for("react.memo"),De=Symbol.for("react.lazy"),fe=Symbol.iterator;function Je(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var we={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ce=Object.assign,ke={};function z(e,r,t){this.props=e,this.context=r,this.refs=ke,this.updater=t||we}z.prototype.isReactComponent={};z.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")};z.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Se(){}Se.prototype=z.prototype;function ee(e,r,t){this.props=e,this.context=r,this.refs=ke,this.updater=t||we}var re=ee.prototype=new Se;re.constructor=ee;Ce(re,z.prototype);re.isPureReactComponent=!0;var pe=Array.isArray,_e=Object.prototype.hasOwnProperty,te={current:null},Re={key:!0,ref:!0,__self:!0,__source:!0};function Ee(e,r,t){var o,n={},s=null,l=null;if(r!=null)for(o in r.ref!==void 0&&(l=r.ref),r.key!==void 0&&(s=""+r.key),r)_e.call(r,o)&&!Re.hasOwnProperty(o)&&(n[o]=r[o]);var i=arguments.length-2;if(i===1)n.children=t;else if(1<i){for(var a=Array(i),u=0;u<i;u++)a[u]=arguments[u+2];n.children=a}if(e&&e.defaultProps)for(o in i=e.defaultProps,i)n[o]===void 0&&(n[o]=i[o]);return{$$typeof:G,type:e,key:s,ref:l,props:n,_owner:te.current}}function Ke(e,r){return{$$typeof:G,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}function oe(e){return typeof e=="object"&&e!==null&&e.$$typeof===G}function Xe(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(t){return r[t]})}var be=/\/+/g;function X(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Xe(""+e.key):r.toString(36)}function F(e,r,t,o,n){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case G:case Ge:l=!0}}if(l)return l=e,n=n(l),e=o===""?"."+X(l,0):o,pe(n)?(t="",e!=null&&(t=e.replace(be,"$&/")+"/"),F(n,r,t,"",function(u){return u})):n!=null&&(oe(n)&&(n=Ke(n,t+(!n.key||l&&l.key===n.key?"":(""+n.key).replace(be,"$&/")+"/")+e)),r.push(n)),1;if(l=0,o=o===""?".":o+":",pe(e))for(var i=0;i<e.length;i++){s=e[i];var a=o+X(s,i);l+=F(s,r,t,a,n)}else if(a=Je(e),typeof a=="function")for(e=a.call(e),i=0;!(s=e.next()).done;)s=s.value,a=o+X(s,i++),l+=F(s,r,t,a,n);else if(s==="object")throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function U(e,r,t){if(e==null)return e;var o=[],n=0;return F(e,o,"","",function(s){return r.call(t,s,n++)}),o}function Ye(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var w={current:null},q={transition:null},Ze={ReactCurrentDispatcher:w,ReactCurrentBatchConfig:q,ReactCurrentOwner:te};function je(){throw Error("act(...) is not supported in production builds of React.")}d.Children={map:U,forEach:function(e,r,t){U(e,function(){r.apply(this,arguments)},t)},count:function(e){var r=0;return U(e,function(){r++}),r},toArray:function(e){return U(e,function(r){return r})||[]},only:function(e){if(!oe(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};d.Component=z;d.Fragment=Te;d.Profiler=We;d.PureComponent=ee;d.StrictMode=Le;d.Suspense=Be;d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ze;d.act=je;d.cloneElement=function(e,r,t){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=Ce({},e.props),n=e.key,s=e.ref,l=e._owner;if(r!=null){if(r.ref!==void 0&&(s=r.ref,l=te.current),r.key!==void 0&&(n=""+r.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(a in r)_e.call(r,a)&&!Re.hasOwnProperty(a)&&(o[a]=r[a]===void 0&&i!==void 0?i[a]:r[a])}var a=arguments.length-2;if(a===1)o.children=t;else if(1<a){i=Array(a);for(var u=0;u<a;u++)i[u]=arguments[u+2];o.children=i}return{$$typeof:G,type:e.type,key:n,ref:s,props:o,_owner:l}};d.createContext=function(e){return e={$$typeof:Fe,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ue,_context:e},e.Consumer=e};d.createElement=Ee;d.createFactory=function(e){var r=Ee.bind(null,e);return r.type=e,r};d.createRef=function(){return{current:null}};d.forwardRef=function(e){return{$$typeof:qe,render:e}};d.isValidElement=oe;d.lazy=function(e){return{$$typeof:De,_payload:{_status:-1,_result:e},_init:Ye}};d.memo=function(e,r){return{$$typeof:He,type:e,compare:r===void 0?null:r}};d.startTransition=function(e){var r=q.transition;q.transition={};try{e()}finally{q.transition=r}};d.unstable_act=je;d.useCallback=function(e,r){return w.current.useCallback(e,r)};d.useContext=function(e){return w.current.useContext(e)};d.useDebugValue=function(){};d.useDeferredValue=function(e){return w.current.useDeferredValue(e)};d.useEffect=function(e,r){return w.current.useEffect(e,r)};d.useId=function(){return w.current.useId()};d.useImperativeHandle=function(e,r,t){return w.current.useImperativeHandle(e,r,t)};d.useInsertionEffect=function(e,r){return w.current.useInsertionEffect(e,r)};d.useLayoutEffect=function(e,r){return w.current.useLayoutEffect(e,r)};d.useMemo=function(e,r){return w.current.useMemo(e,r)};d.useReducer=function(e,r,t){return w.current.useReducer(e,r,t)};d.useRef=function(e){return w.current.useRef(e)};d.useState=function(e){return w.current.useState(e)};d.useSyncExternalStore=function(e,r,t){return w.current.useSyncExternalStore(e,r,t)};d.useTransition=function(){return w.current.useTransition()};d.version="18.3.1";xe.exports=d;var x=xe.exports;/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Qe=x,er=Symbol.for("react.element"),rr=Symbol.for("react.fragment"),tr=Object.prototype.hasOwnProperty,or=Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0};function Ae(e,r,t){var o,n={},s=null,l=null;t!==void 0&&(s=""+t),r.key!==void 0&&(s=""+r.key),r.ref!==void 0&&(l=r.ref);for(o in r)tr.call(r,o)&&!nr.hasOwnProperty(o)&&(n[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps,r)n[o]===void 0&&(n[o]=r[o]);return{$$typeof:er,type:e,key:s,ref:l,props:n,_owner:or.current}}B.Fragment=rr;B.jsx=Ae;B.jsxs=Ae;ve.exports=B;var V=ve.exports;function sr(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function ir(...e){return r=>e.forEach(t=>sr(t,r))}var Pe=x.forwardRef((e,r)=>{const{children:t,...o}=e,n=x.Children.toArray(t),s=n.find(ar);if(s){const l=s.props.children,i=n.map(a=>a===s?x.Children.count(l)>1?x.Children.only(null):x.isValidElement(l)?l.props.children:null:a);return V.jsx(Z,{...o,ref:r,children:x.isValidElement(l)?x.cloneElement(l,void 0,i):null})}return V.jsx(Z,{...o,ref:r,children:t})});Pe.displayName="Slot";var Z=x.forwardRef((e,r)=>{const{children:t,...o}=e;if(x.isValidElement(t)){const n=ur(t);return x.cloneElement(t,{...cr(o,t.props),ref:r?ir(r,n):n})}return x.Children.count(t)>1?x.Children.only(null):null});Z.displayName="SlotClone";var lr=({children:e})=>V.jsx(V.Fragment,{children:e});function ar(e){return x.isValidElement(e)&&e.type===lr}function cr(e,r){const t={...r};for(const o in r){const n=e[o],s=r[o];/^on[A-Z]/.test(o)?n&&s?t[o]=(...i)=>{s(...i),n(...i)}:n&&(t[o]=n):o==="style"?t[o]={...n,...s}:o==="className"&&(t[o]=[n,s].filter(Boolean).join(" "))}return{...e,...t}}function ur(e){var o,n;let r=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=r&&"isReactWarning"in r&&r.isReactWarning;return t?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,t=r&&"isReactWarning"in r&&r.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}function ze(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=ze(e[r]))&&(o&&(o+=" "),o+=t);else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function dr(){for(var e,r,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(r=ze(e))&&(o&&(o+=" "),o+=r);return o}const ge=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,me=dr,fr=(e,r)=>t=>{var o;if((r==null?void 0:r.variants)==null)return me(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:n,defaultVariants:s}=r,l=Object.keys(n).map(u=>{const g=t==null?void 0:t[u],h=s==null?void 0:s[u];if(g===null)return null;const y=ge(g)||ge(h);return n[u][y]}),i=t&&Object.entries(t).reduce((u,g)=>{let[h,y]=g;return y===void 0||(u[h]=y),u},{}),a=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((u,g)=>{let{class:h,className:y,...S}=g;return Object.entries(S).every(C=>{let[m,f]=C;return Array.isArray(f)?f.includes({...s,...i}[m]):{...s,...i}[m]===f})?[...u,h,y]:u},[]);return me(e,l,a,t==null?void 0:t.class,t==null?void 0:t.className)},pr={default:"bg-sf-primary text-fg-primary border border-primary-600 box-border"},br=fr(`px-[23px] py-[18px] inline-flex items-center justify-center whitespace-nowrap rounded ring-offset-background
18
+ transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
19
+ disabled:pointer-events-none disabled:opacity-50 prose-mobile-label-2`,{variants:{variant:{...pr},fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",fullWidth:!1}});function Oe(e){var r,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=Oe(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function gr(){for(var e,r,t=0,o="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=Oe(e))&&(o&&(o+=" "),o+=r);return o}const ne="-",mr=e=>{const r=hr(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const i=l.split(ne);return i[0]===""&&i.length!==1&&i.shift(),$e(i,r)||yr(l)},getConflictingClassGroupIds:(l,i)=>{const a=t[l]||[];return i&&o[l]?[...a,...o[l]]:a}}},$e=(e,r)=>{var l;if(e.length===0)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),n=o?$e(e.slice(1),o):void 0;if(n)return n;if(r.validators.length===0)return;const s=e.join(ne);return(l=r.validators.find(({validator:i})=>i(s)))==null?void 0:l.classGroupId},ye=/^\[(.+)\]$/,yr=e=>{if(ye.test(e)){const r=ye.exec(e)[1],t=r==null?void 0:r.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},hr=e=>{const{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return xr(Object.entries(e.classGroups),t).forEach(([s,l])=>{Q(l,o,s,r)}),o},Q=(e,r,t,o)=>{e.forEach(n=>{if(typeof n=="string"){const s=n===""?r:he(r,n);s.classGroupId=t;return}if(typeof n=="function"){if(vr(n)){Q(n(o),r,t,o);return}r.validators.push({validator:n,classGroupId:t});return}Object.entries(n).forEach(([s,l])=>{Q(l,he(r,s),t,o)})})},he=(e,r)=>{let t=e;return r.split(ne).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},vr=e=>e.isThemeGetter,xr=(e,r)=>r?e.map(([t,o])=>{const n=o.map(s=>typeof s=="string"?r+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,i])=>[r+l,i])):s);return[t,n]}):e,wr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;const n=(s,l)=>{t.set(s,l),r++,r>e&&(r=0,o=t,t=new Map)};return{get(s){let l=t.get(s);if(l!==void 0)return l;if((l=o.get(s))!==void 0)return n(s,l),l},set(s,l){t.has(s)?t.set(s,l):n(s,l)}}},Ne="!",Cr=e=>{const{separator:r,experimentalParseClassName:t}=e,o=r.length===1,n=r[0],s=r.length,l=i=>{const a=[];let u=0,g=0,h;for(let f=0;f<i.length;f++){let v=i[f];if(u===0){if(v===n&&(o||i.slice(f,f+s)===r)){a.push(i.slice(g,f)),g=f+s;continue}if(v==="/"){h=f;continue}}v==="["?u++:v==="]"&&u--}const y=a.length===0?i:i.substring(g),S=y.startsWith(Ne),C=S?y.substring(1):y,m=h&&h>g?h-g:void 0;return{modifiers:a,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:m}};return t?i=>t({className:i,parseClassName:l}):l},kr=e=>{if(e.length<=1)return e;const r=[];let t=[];return e.forEach(o=>{o[0]==="["?(r.push(...t.sort(),o),t=[]):t.push(o)}),r.push(...t.sort()),r},Sr=e=>({cache:wr(e.cacheSize),parseClassName:Cr(e),...mr(e)}),_r=/\s+/,Rr=(e,r)=>{const{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,s=[],l=e.trim().split(_r);let i="";for(let a=l.length-1;a>=0;a-=1){const u=l[a],{modifiers:g,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:S}=t(u);let C=!!S,m=o(C?y.substring(0,S):y);if(!m){if(!C){i=u+(i.length>0?" "+i:i);continue}if(m=o(y),!m){i=u+(i.length>0?" "+i:i);continue}C=!1}const f=kr(g).join(":"),v=h?f+Ne:f,k=v+m;if(s.includes(k))continue;s.push(k);const $=n(m,C);for(let A=0;A<$.length;++A){const T=$[A];s.push(v+T)}i=u+(i.length>0?" "+i:i)}return i};function Er(){let e=0,r,t,o="";for(;e<arguments.length;)(r=arguments[e++])&&(t=Ie(r))&&(o&&(o+=" "),o+=t);return o}const Ie=e=>{if(typeof e=="string")return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=Ie(e[o]))&&(t&&(t+=" "),t+=r);return t};function jr(e,...r){let t,o,n,s=l;function l(a){const u=r.reduce((g,h)=>h(g),e());return t=Sr(u),o=t.cache.get,n=t.cache.set,s=i,i(a)}function i(a){const u=o(a);if(u)return u;const g=Rr(a,t);return n(a,g),g}return function(){return s(Er.apply(null,arguments))}}const p=e=>{const r=t=>t[e]||[];return r.isThemeGetter=!0,r},Me=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ar=/^\d+\/\d+$/,Pr=new Set(["px","full","screen"]),zr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Or=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$r=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ir=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,R=e=>P(e)||Pr.has(e)||Ar.test(e),E=e=>O(e,"length",Fr),P=e=>!!e&&!Number.isNaN(Number(e)),Y=e=>O(e,"number",P),I=e=>!!e&&Number.isInteger(Number(e)),Mr=e=>e.endsWith("%")&&P(e.slice(0,-1)),c=e=>Me.test(e),j=e=>zr.test(e),Vr=new Set(["length","size","percentage"]),Gr=e=>O(e,Vr,Ve),Tr=e=>O(e,"position",Ve),Lr=new Set(["image","url"]),Wr=e=>O(e,Lr,Br),Ur=e=>O(e,"",qr),M=()=>!0,O=(e,r,t)=>{const o=Me.exec(e);return o?o[1]?typeof r=="string"?o[1]===r:r.has(o[1]):t(o[2]):!1},Fr=e=>Or.test(e)&&!$r.test(e),Ve=()=>!1,qr=e=>Nr.test(e),Br=e=>Ir.test(e),Hr=()=>{const e=p("colors"),r=p("spacing"),t=p("blur"),o=p("brightness"),n=p("borderColor"),s=p("borderRadius"),l=p("borderSpacing"),i=p("borderWidth"),a=p("contrast"),u=p("grayscale"),g=p("hueRotate"),h=p("invert"),y=p("gap"),S=p("gradientColorStops"),C=p("gradientColorStopPositions"),m=p("inset"),f=p("margin"),v=p("opacity"),k=p("padding"),$=p("saturate"),A=p("scale"),T=p("sepia"),se=p("skew"),ie=p("space"),le=p("translate"),H=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",c,r],b=()=>[c,r],ae=()=>["",R,E],L=()=>["auto",P,c],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",c],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[P,c];return{cacheSize:500,separator:":",theme:{colors:[M],spacing:[R,E],blur:["none","",j,c],brightness:_(),borderColor:[e],borderRadius:["none","","full",j,c],borderSpacing:b(),borderWidth:ae(),contrast:_(),grayscale:N(),hueRotate:_(),invert:N(),gap:b(),gradientColorStops:[e],gradientColorStopPositions:[Mr,E],inset:J(),margin:J(),opacity:_(),padding:b(),saturate:_(),scale:_(),sepia:N(),skew:_(),space:b(),translate:b()},classGroups:{aspect:[{aspect:["auto","square","video",c]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ce(),c]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,c]}],basis:[{basis:J()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",c]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",I,c]}],"grid-cols":[{"grid-cols":[M]}],"col-start-end":[{col:["auto",{span:["full",I,c]},c]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[M]}],"row-start-end":[{row:["auto",{span:[I,c]},c]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",c]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",c]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ie]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ie]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",c,r]}],"min-w":[{"min-w":[c,r,"min","max","fit"]}],"max-w":[{"max-w":[c,r,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[c,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[c,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[c,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[c,r,"auto","min","max","fit"]}],"font-size":[{text:["base",j,E]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Y]}],"font-family":[{font:[M]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",c]}],"line-clamp":[{"line-clamp":["none",P,Y]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",R,c]}],"list-image":[{"list-image":["none",c]}],"list-style-type":[{list:["none","disc","decimal",c]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",R,E]}],"underline-offset":[{"underline-offset":["auto",R,c]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),Tr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Gr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Wr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:W()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[R,c]}],"outline-w":[{outline:[R,E]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[R,E]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,Ur]}],"shadow-color":[{shadow:[M]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...ue(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ue()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",j,c]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[h]}],saturate:[{saturate:[$]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[$]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",c]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",c]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",c]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[I,c]}],"translate-x":[{"translate-x":[le]}],"translate-y":[{"translate-y":[le]}],"skew-x":[{"skew-x":[se]}],"skew-y":[{"skew-y":[se]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",c]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[R,E,Y]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Dr=jr(Hr);function Jr(...e){return Dr(gr(e))}x.forwardRef(({label:e,className:r,variant:t,fullWidth:o,asChild:n=!1,...s},l)=>{const i=n?Pe:"button";return V.jsx(i,{className:Jr(br({variant:t,fullWidth:o,className:r})),ref:l,...s,children:e})});
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Rechtspilot UI Library</title>
8
+ <script type="module" crossorigin src="/assets/index-Btt6mzhG.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+
15
+ </html>
@@ -0,0 +1,28 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
9
+ {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
+ files: ['**/*.{ts,tsx}'],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ 'react-refresh/only-export-components': [
23
+ 'warn',
24
+ { allowConstantExport: true },
25
+ ],
26
+ },
27
+ },
28
+ )
package/index.css ADDED
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
package/index.html ADDED
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Rechtspilot UI Library</title>
8
+ </head>
9
+
10
+ <body>
11
+ <div id="root"></div>
12
+ <script type="module" src="/src/index.ts"></script>
13
+ </body>
14
+
15
+ </html>
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "rechtspilot-ui",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc -b && vite build",
8
+ "lint": "eslint .",
9
+ "preview": "vite preview",
10
+ "storybook": "storybook dev -p 6006 --no-open",
11
+ "build-storybook": "storybook build"
12
+ },
13
+ "dependencies": {
14
+ "@radix-ui/react-slot": "^1.1.0",
15
+ "@tailwindcss/typography": "^0.5.15",
16
+ "auto": "^11.3.0",
17
+ "class-variance-authority": "^0.7.0",
18
+ "clsx": "^2.1.1",
19
+ "lucide-react": "^0.447.0",
20
+ "react": "^18.3.1",
21
+ "react-dom": "^18.3.1",
22
+ "tailwind-merge": "^2.5.2",
23
+ "tailwindcss-animate": "^1.0.7",
24
+ "ts-node": "^10.9.2"
25
+ },
26
+ "devDependencies": {
27
+ "@chromatic-com/storybook": "^1.9.0",
28
+ "@eslint/js": "^9.9.0",
29
+ "@storybook/addon-docs": "^8.3.5",
30
+ "@storybook/addon-essentials": "^8.3.4",
31
+ "@storybook/addon-interactions": "^8.3.4",
32
+ "@storybook/addon-links": "^8.3.4",
33
+ "@storybook/addon-onboarding": "^8.3.4",
34
+ "@storybook/blocks": "^8.3.4",
35
+ "@storybook/react": "^8.3.4",
36
+ "@storybook/react-vite": "^8.3.4",
37
+ "@storybook/test": "^8.3.4",
38
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
39
+ "@types/node": "^22.7.4",
40
+ "@types/react": "^18.3.3",
41
+ "@types/react-dom": "^18.3.0",
42
+ "@typescript-eslint/eslint-plugin": "^8.8.0",
43
+ "@typescript-eslint/parser": "^8.8.0",
44
+ "@vitejs/plugin-react": "^4.3.1",
45
+ "autoprefixer": "^10.4.20",
46
+ "eslint": "^9.11.1",
47
+ "eslint-config-prettier": "^9.1.0",
48
+ "eslint-plugin-prettier": "^5.2.1",
49
+ "eslint-plugin-react-hooks": "^5.1.0-rc.0",
50
+ "eslint-plugin-react-refresh": "^0.4.9",
51
+ "eslint-plugin-storybook": "^0.9.0",
52
+ "globals": "^15.9.0",
53
+ "postcss": "^8.4.47",
54
+ "prettier": "^3.3.3",
55
+ "storybook": "^8.3.4",
56
+ "tailwindcss": "^3.4.13",
57
+ "typescript": "^5.5.3",
58
+ "typescript-eslint": "^8.0.1",
59
+ "vite": "^5.4.1"
60
+ },
61
+ "eslintConfig": {
62
+ "extends": [
63
+ "plugin:storybook/recommended"
64
+ ]
65
+ },
66
+ "description": "Rechtspilot UI Library",
67
+ "main": "dist/cjs/index.js",
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "git+https://github.com/vertragswecker/rechtspilot-ui-library.git"
71
+ },
72
+ "author": "Rechtspilot",
73
+ "license": "ISC",
74
+ "bugs": {
75
+ "url": "https://github.com/vertragswecker/rechtspilot-ui-library/issues"
76
+ },
77
+ "homepage": "https://github.com/vertragswecker/rechtspilot-ui-library#readme"
78
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
@@ -0,0 +1,41 @@
1
+ import commonjs from "@rollup/plugin-commonjs";
2
+ import resolve from "@rollup/plugin-node-resolve";
3
+ import typescript from "@rollup/plugin-typescript";
4
+ import dts from "rollup-plugin-dts";
5
+ import postcss from "rollup-plugin-postcss";
6
+ import packageJson from "./package.json" assert { type: "json" };
7
+
8
+
9
+ export default [
10
+ {
11
+ preserveModules: true,
12
+ input: "src/index.ts",
13
+ output: [
14
+ {
15
+ file: packageJson.main,
16
+ format: "cjs",
17
+ sourcemap: true,
18
+ },
19
+ {
20
+ file: packageJson.module,
21
+ format: "esm",
22
+ sourcemap: true,
23
+ },
24
+ ],
25
+ plugins: [
26
+ resolve(),
27
+ commonjs(),
28
+ typescript({
29
+ tsconfig: "./tsconfig.json",
30
+ exclude: ["**/*.test.tsx", "**/*.test.ts", "**/*.stories.ts"],
31
+ }),
32
+ postcss({ extensions: [".css"], inject: true, extract: false }),
33
+ ],
34
+ },
35
+ {
36
+ input: "dist/esm/types/index.d.ts",
37
+ output: [{ file: "dist/index.d.ts", format: "esm" }],
38
+ plugins: [dts()],
39
+ external: [/\.css$/],
40
+ },
41
+ ];
@@ -0,0 +1,25 @@
1
+ import { Slot } from '@radix-ui/react-slot';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import * as React from 'react';
4
+
5
+ import { buttonVariants } from '@/components/Button/buttonVariants';
6
+ import { cn } from '@/lib/utils';
7
+
8
+ export interface ButtonProps
9
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
10
+ VariantProps<typeof buttonVariants> {
11
+ label: string;
12
+ fullWidth?: boolean;
13
+ asChild?: boolean;
14
+ }
15
+
16
+ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
17
+ ({ label, className, variant, fullWidth, asChild = false, ...props }, ref) => {
18
+ const Comp = asChild ? Slot : 'button';
19
+ return (
20
+ <Comp className={cn(buttonVariants({ variant, fullWidth, className }))} ref={ref} {...props}>
21
+ {label}
22
+ </Comp>
23
+ );
24
+ }
25
+ );
@@ -0,0 +1,29 @@
1
+ import { cva } from 'class-variance-authority';
2
+
3
+ export const buttonVariantsStyle = {
4
+ default: 'bg-sf-primary text-fg-primary border border-primary-600 box-border',
5
+ // outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
6
+ // secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
7
+ // link: 'text-primary underline-offset-4 hover:underline',
8
+ };
9
+
10
+ export const buttonVariants = cva(
11
+ `px-[23px] py-[18px] inline-flex items-center justify-center whitespace-nowrap rounded ring-offset-background
12
+ transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
13
+ disabled:pointer-events-none disabled:opacity-50 prose-mobile-label-2`,
14
+ {
15
+ variants: {
16
+ variant: {
17
+ ...buttonVariantsStyle,
18
+ },
19
+ fullWidth: {
20
+ true: 'w-full',
21
+ },
22
+ },
23
+
24
+ defaultVariants: {
25
+ variant: 'default',
26
+ fullWidth: false,
27
+ },
28
+ }
29
+ );
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { Button } from './components/Button/Button';
2
+ // export { default as Chat } from './components/Chat/Chat';
3
+ // export { default as Message } from './components/Message/Message';
4
+ // export { default as OptionButton } from './components/OptionButton/OptionButton';
5
+ // export { default as ReplyBadge } from './components/ReplyBadge/ReplyBadge';
@@ -0,0 +1,61 @@
1
+ export const colors = {
2
+ primary: {
3
+ 25: 'hsla(100, 71%, 96%, 1)',
4
+ 50: 'hsla(100, 31%, 92%, 1)',
5
+ 100: 'hsla(100, 71%, 88%, 1)',
6
+ 200: 'hsla(100, 71%, 84%, 1)',
7
+ 300: 'hsla(100, 70%, 75%, 1)',
8
+ 400: 'hsla(100, 71%, 67%, 1)',
9
+ 500: 'hsla(100, 71%, 58%, 1)',
10
+ 600: 'hsla(110, 51%, 47%, 1)',
11
+ 700: 'hsla(110, 51%, 35%, 1)',
12
+ 800: 'hsla(120, 50%, 24%, 1)',
13
+ 900: 'hsla(130, 52%, 18%, 1)',
14
+ 950: 'hsla(99, 51%, 12%, 1)',
15
+ },
16
+ fg: {
17
+ primary: 'hsla(130, 52%, 18%, 1)',
18
+ secondary: 'hsla(150, 8%, 39%, 1)',
19
+ tertiary: 'hsla(150, 5%, 64%, 1)',
20
+ accent: {
21
+ action: 'hsla(110, 51%, 35%, 1)',
22
+ error: 'hsla(18, 100%, 50%, 1)',
23
+ },
24
+ },
25
+ bg: {
26
+ primary: 'hsla(0, 0%, 100%, 1)',
27
+ secondary: 'hsla(100, 31%, 92%, 1)',
28
+ elevated: 'hsla(0, 0%, 100%, 0.8)',
29
+ },
30
+ sf: {
31
+ primary: 'hsla(100, 71%, 58%, 1)',
32
+ secondary: 'hsla(150, 7%, 12%, 1)',
33
+ tertiary: 'hsla(180, 7%, 97%, 1))',
34
+ light: {
35
+ action: 'hsla(100, 71%, 96%, 1)',
36
+ error: 'hsla(17, 100%, 97%, 1)',
37
+ },
38
+ },
39
+ };
40
+
41
+ export const typography = {
42
+ title: {
43
+ fontFamily: 'Lora',
44
+ fontWeight: 500,
45
+ letterSpacing: '0px',
46
+ },
47
+ label: {
48
+ fontFamily: 'Inter',
49
+ fontWeight: 500,
50
+ },
51
+ body: {
52
+ fontFamily: 'Inter',
53
+ fontWeight: 400,
54
+ },
55
+ caption: {
56
+ fontFamily: 'Inter',
57
+ fontWeight: 400,
58
+ fontSize: '12px',
59
+ lineHeight: '15px',
60
+ },
61
+ };
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -0,0 +1,25 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+
3
+ import { Button } from '@/components/Button/Button';
4
+
5
+ const meta: Meta<typeof Button> = {
6
+ component: Button,
7
+ argTypes: {
8
+ variant: {
9
+ options: ['default', 'outline', 'secondary', 'link'],
10
+ control: { type: 'select' },
11
+ },
12
+ },
13
+ };
14
+
15
+ export default meta;
16
+
17
+ type Story = StoryObj<typeof Button>;
18
+
19
+ export const Primary: Story = {
20
+ args: {
21
+ label: 'Label',
22
+ variant: 'default',
23
+ fullWidth: false,
24
+ },
25
+ };
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,42 @@
1
+ import type { Config } from 'tailwindcss';
2
+ import tailwindAnimate from 'tailwindcss-animate';
3
+
4
+ import tailwindTypography from '@tailwindcss/typography';
5
+
6
+ import { colors, typography } from './src/lib/theme';
7
+
8
+ export default {
9
+ darkMode: ['class'],
10
+ content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
11
+ theme: {
12
+ extend: {
13
+ borderRadius: {
14
+ DEFAULT: '12px',
15
+ },
16
+ colors,
17
+ fontFamily: {
18
+ sans: ['Inter', 'sans-serif'],
19
+ serif: ['Lora', 'serif'],
20
+ },
21
+ typography: {
22
+ 'mobile-label-1': {
23
+ css: {
24
+ ...typography.label,
25
+ fontSize: '17px',
26
+ lineHeight: '26px',
27
+ letterSpacing: '-0.4px',
28
+ },
29
+ },
30
+ 'mobile-label-2': {
31
+ css: {
32
+ ...typography.label,
33
+ fontSize: '15px',
34
+ lineHeight: '24px',
35
+ letterSpacing: '-0.2px',
36
+ },
37
+ },
38
+ },
39
+ },
40
+ },
41
+ plugins: [tailwindAnimate, tailwindTypography],
42
+ } satisfies Config;
@@ -0,0 +1,42 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": [
6
+ "ES2020",
7
+ "DOM",
8
+ "DOM.Iterable"
9
+ ],
10
+ "module": "ESNext",
11
+ "skipLibCheck": true,
12
+ "incremental": false,
13
+ /* Bundler mode */
14
+ "moduleResolution": "bundler",
15
+ "allowImportingTsExtensions": true,
16
+ "isolatedModules": true,
17
+ "moduleDetection": "force",
18
+ "noEmit": true,
19
+ "jsx": "react-jsx",
20
+ /* Linting */
21
+ "strict": true,
22
+ "noUnusedLocals": true,
23
+ "noUnusedParameters": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ /* Paths */
26
+ "baseUrl": ".",
27
+ "paths": {
28
+ "@/*": [
29
+ "./src/*"
30
+ ],
31
+ "@public/*": [
32
+ "./public/*"
33
+ ],
34
+ "@assets/*": [
35
+ "./assets/*"
36
+ ]
37
+ },
38
+ },
39
+ "include": [
40
+ "src"
41
+ ]
42
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ],
11
+ "compilerOptions": {
12
+ "baseUrl": ".",
13
+ "paths": {
14
+ "@/*": [
15
+ "./src/*"
16
+ ],
17
+ "@public/*": [
18
+ "./public/*"
19
+ ],
20
+ "@assets/*": [
21
+ "./assets/*"
22
+ ]
23
+ },
24
+ },
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": [
5
+ "ES2023"
6
+ ],
7
+ "module": "ESNext",
8
+ "skipLibCheck": true,
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "isolatedModules": true,
13
+ "moduleDetection": "force",
14
+ "noEmit": true,
15
+ "incremental": false,
16
+ /* Linting */
17
+ "strict": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noFallthroughCasesInSwitch": true
21
+ },
22
+ "include": [
23
+ "vite.config.ts"
24
+ ]
25
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { defineConfig } from 'vite';
3
+
4
+ import react from '@vitejs/plugin-react';
5
+
6
+ export default defineConfig({
7
+ resolve: {
8
+ alias: {
9
+ '@': path.resolve(__dirname, './src'),
10
+ '@assets': path.resolve(__dirname, './assets'),
11
+ '@public': path.resolve(__dirname, './public'),
12
+ },
13
+ },
14
+ plugins: [react()],
15
+ });