@rarui/styles 1.0.0-rc.1 → 1.0.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/README.md +1 -0
- package/dist/index.js +1 -1
- package/dist/themes/dark.js +1 -1
- package/package.json +10 -6
- package/src/components/ThemeProvider.tsx +0 -30
- package/src/components/contexts/ThemeProviderContext/ThemeProviderContext.tsx +0 -6
- package/src/components/contexts/ThemeProviderContext/index.ts +0 -5
- package/src/components/contexts/ThemeProviderContext/themeProviderContext.types.ts +0 -7
- package/src/components/contexts/index.ts +0 -1
- package/src/components/hooks/index.ts +0 -1
- package/src/components/hooks/useTheme/index.ts +0 -1
- package/src/components/hooks/useTheme/useTheme.spec.tsx +0 -27
- package/src/components/hooks/useTheme/useTheme.ts +0 -9
- package/src/components/index.ts +0 -6
- package/src/components/themeProvider.definitions.ts +0 -6
- package/src/components/themeProvider.spec.tsx +0 -41
- package/src/components/themeProvider.types.ts +0 -10
- package/src/index.ts +0 -8
- package/src/index.types.ts +0 -71
- package/src/packages/atomic/button/index.ts +0 -6
- package/src/packages/atomic/button/rarui-button.commons.ts +0 -82
- package/src/packages/atomic/button/rarui-button.css.ts +0 -331
- package/src/packages/atomic/button/rarui-button.types.ts +0 -4
- package/src/themes/contract.css.ts +0 -241
- package/src/themes/globals.css.ts +0 -256
- package/src/themes/index.ts +0 -2
- package/src/themes/mediaQueries.ts +0 -10
- package/src/themes/rarui-theme-dark.css.ts +0 -126
- package/tsconfig.json +0 -4
- package/webpack.config.ts +0 -30
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports["@rarui/styles"]=r(require("react")):e["@rarui/styles"]=r(e.react)}(global,(e=>(()=>{"use strict";var r={4:(e,r,t)=>{t.r(r),t.d(r,{button:()=>l,overlay:()=>f});t(225);function n(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){var a,o,i;a=e,o=r,i=t[r],(o=n(o))in a?Object.defineProperty(a,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function i(e,r){var t={};for(var n in e)t[n]=r(e[n],n);return t}var u,c,s=(e,r,t)=>{for(var n of Object.keys(e)){var a;if(e[n]!==(null!==(a=r[n])&&void 0!==a?a:t[n]))return!1}return!0},l=(u={defaultClassName:"rarui-button__1a4hz7a0",variantClassNames:{appearance:{brand:"rarui-button_appearance_brand__1a4hz7a1","brand-secondary":"rarui-button_appearance_brand-secondary__1a4hz7a2",danger:"rarui-button_appearance_danger__1a4hz7a3",success:"rarui-button_appearance_success__1a4hz7a4",warning:"rarui-button_appearance_warning__1a4hz7a5",neutral:"rarui-button_appearance_neutral__1a4hz7a6",inverted:"rarui-button_appearance_inverted__1a4hz7a7"},size:{large:"rarui-button_size_large__1a4hz7a8",medium:"rarui-button_size_medium__1a4hz7a9",small:"rarui-button_size_small__1a4hz7aa"},variant:{solid:"rarui-button_variant_solid__1a4hz7ab",outlined:"rarui-button_variant_outlined__1a4hz7ac",text:"rarui-button_variant_text__1a4hz7ad",tonal:"rarui-button_variant_tonal__1a4hz7ae"}},defaultVariants:{},compoundVariants:[[{appearance:"brand",variant:"outlined"},"rarui-button_undefined_compound_0__1a4hz7af"],[{appearance:"brand-secondary",variant:"outlined"},"rarui-button_undefined_compound_1__1a4hz7ag"],[{appearance:"danger",variant:"outlined"},"rarui-button_undefined_compound_2__1a4hz7ah"],[{appearance:"success",variant:"outlined"},"rarui-button_undefined_compound_3__1a4hz7ai"],[{appearance:"warning",variant:"outlined"},"rarui-button_undefined_compound_4__1a4hz7aj"],[{appearance:"neutral",variant:"outlined"},"rarui-button_undefined_compound_5__1a4hz7ak"],[{appearance:"inverted",variant:"outlined"},"rarui-button_undefined_compound_6__1a4hz7al"],[{appearance:"brand",variant:"text"},"rarui-button_undefined_compound_7__1a4hz7am"],[{appearance:"brand-secondary",variant:"text"},"rarui-button_undefined_compound_8__1a4hz7an"],[{appearance:"danger",variant:"text"},"rarui-button_undefined_compound_9__1a4hz7ao"],[{appearance:"success",variant:"text"},"rarui-button_undefined_compound_10__1a4hz7ap"],[{appearance:"warning",variant:"text"},"rarui-button_undefined_compound_11__1a4hz7aq"],[{appearance:"neutral",variant:"text"},"rarui-button_undefined_compound_12__1a4hz7ar"],[{appearance:"inverted",variant:"text"},"rarui-button_undefined_compound_13__1a4hz7as"],[{appearance:"brand",variant:"tonal"},"rarui-button_undefined_compound_14__1a4hz7at"],[{appearance:"brand-secondary",variant:"tonal"},"rarui-button_undefined_compound_15__1a4hz7au"],[{appearance:"danger",variant:"tonal"},"rarui-button_undefined_compound_16__1a4hz7av"],[{appearance:"success",variant:"tonal"},"rarui-button_undefined_compound_17__1a4hz7aw"],[{appearance:"warning",variant:"tonal"},"rarui-button_undefined_compound_18__1a4hz7ax"],[{appearance:"neutral",variant:"tonal"},"rarui-button_undefined_compound_19__1a4hz7ay"],[{appearance:"brand",variant:"tonal"},"rarui-button_undefined_compound_20__1a4hz7az"]]},(c=e=>{var r=u.defaultClassName,t=o(o({},u.defaultVariants),e);for(var n in t){var a,i=null!==(a=t[n])&&void 0!==a?a:u.defaultVariants[n];if(null!=i){var c=i;"boolean"==typeof c&&(c=!0===c?"true":"false");var l=u.variantClassNames[n][c];l&&(r+=" "+l)}}for(var[f,_]of u.compoundVariants)s(f,t,u.defaultVariants)&&(r+=" "+_);return r}).variants=()=>Object.keys(u.variantClassNames),c.classNames={get base(){return u.defaultClassName.split(" ")[0]},get variants(){return i(u.variantClassNames,(e=>i(e,(e=>e.split(" ")[0]))))}},c),f="rarui-button__1a4hz7a10"},61:(e,r,t)=>{t.r(r),t.d(r,{default:()=>a,variables:()=>n});t(225);var n="rarui-theme-dark__t1161z0";const a="rarui-theme-dark__t1161z0"},225:()=>{},280:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProvider=void 0;const n=t(608).__importStar(t(155)),a=t(272),o=t(761),i=({children:e,theme:r="base",...t})=>{const i=n.default.useRef(null),u=(0,n.useMemo)((()=>({refThemeProvider:i,currentTheme:r})),[i,r]);return n.default.createElement("div",{className:a.themes[r],...t,ref:i},n.default.createElement(o.ThemeProviderContext.Provider,{value:u},e))};r.ThemeProvider=i,i.displayName="ThemeProvider"},414:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProviderContext=void 0;const n=t(155);r.ThemeProviderContext=(0,n.createContext)({})},105:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProviderContext=void 0;const n=t(414);var a=t(414);Object.defineProperty(r,"ThemeProviderContext",{enumerable:!0,get:function(){return a.ThemeProviderContext}}),r.default=n.ThemeProviderContext},761:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});t(608).__exportStar(t(105),r)},675:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;var n=t(496);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return n.useTheme}})},496:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;var n=t(370);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return n.useTheme}})},370:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;const n=t(155),a=t(761);r.useTheme=()=>(0,n.useContext)(a.ThemeProviderContext)},240:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=r.ThemeProvider=void 0;const n=t(280);var a=t(280);Object.defineProperty(r,"ThemeProvider",{enumerable:!0,get:function(){return a.ThemeProvider}});var o=t(675);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return o.useTheme}}),r.default=n.ThemeProvider},272:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.themes=void 0;const n=t(61);r.themes={dark:n.variables,base:""}},783:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.button=void 0;t(608).__exportStar(t(240),r);var n=t(976);Object.defineProperty(r,"button",{enumerable:!0,get:function(){return n.button}})},976:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.button=void 0;const n=t(608).__importStar(t(4));r.button={classnames:{...n}}},155:r=>{r.exports=e},608:(e,r,t)=>{t.r(r),t.d(r,{__addDisposableResource:()=>I,__assign:()=>o,__asyncDelegator:()=>x,__asyncGenerator:()=>j,__asyncValues:()=>T,__await:()=>P,__awaiter:()=>p,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>D,__createBinding:()=>b,__decorate:()=>u,__disposeResources:()=>R,__esDecorate:()=>s,__exportStar:()=>y,__extends:()=>a,__generator:()=>v,__importDefault:()=>C,__importStar:()=>E,__makeTemplateObject:()=>z,__metadata:()=>d,__param:()=>c,__propKey:()=>f,__read:()=>m,__rest:()=>i,__runInitializers:()=>l,__setFunctionName:()=>_,__spread:()=>w,__spreadArray:()=>O,__spreadArrays:()=>g,__values:()=>h,default:()=>A});var n=function(e,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},n(e,r)};function a(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var o=function(){return o=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},o.apply(this,arguments)};function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}function u(e,r,t,n){var a,o=arguments.length,i=o<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(i=(o<3?a(i):o>3?a(r,t,i):a(r,t))||i);return o>3&&i&&Object.defineProperty(r,t,i),i}function c(e,r){return function(t,n){r(t,n,e)}}function s(e,r,t,n,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var u,c=n.kind,s="getter"===c?"get":"setter"===c?"set":"value",l=!r&&e?n.static?e:e.prototype:null,f=r||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),_=!1,d=t.length-1;d>=0;d--){var p={};for(var v in n)p[v]="access"===v?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(e){if(_)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var b=(0,t[d])("accessor"===c?{get:f.get,set:f.set}:f[s],p);if("accessor"===c){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(u=i(b.get))&&(f.get=u),(u=i(b.set))&&(f.set=u),(u=i(b.init))&&a.unshift(u)}else(u=i(b))&&("field"===c?a.unshift(u):f[s]=u)}l&&Object.defineProperty(l,n.name,f),_=!0}function l(e,r,t){for(var n=arguments.length>2,a=0;a<r.length;a++)t=n?r[a].call(e,t):r[a].call(e);return n?t:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function _(e,r,t){return"symbol"==typeof r&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:t?"".concat(t," ",r):r})}function d(e,r){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,r)}function p(e,r,t,n){return new(t||(t=Promise))((function(a,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function u(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(i,u)}c((n=n.apply(e,r||[])).next())}))}function v(e,r){var t,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(t=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(6===u[0]&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=r.call(e,i)}catch(e){u=[6,e],n=0}finally{t=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var b=Object.create?function(e,r,t,n){void 0===n&&(n=t);var a=Object.getOwnPropertyDescriptor(r,t);a&&!("get"in a?!r.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,a)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]};function y(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||b(r,e,t)}function h(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,a,o=t.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function w(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(m(arguments[r]));return e}function g(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var n=Array(e),a=0;for(r=0;r<t;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n}function O(e,r,t){if(t||2===arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))}function P(e){return this instanceof P?(this.v=e,this):new P(e)}function j(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,a=t.apply(e,r||[]),o=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){a[e]&&(n[e]=function(r){return new Promise((function(t,n){o.push([e,r,t,n])>1||u(e,r)}))})}function u(e,r){try{(t=a[e](r)).value instanceof P?Promise.resolve(t.value.v).then(c,s):l(o[0][2],t)}catch(e){l(o[0][3],e)}var t}function c(e){u("next",e)}function s(e){u("throw",e)}function l(e,r){e(r),o.shift(),o.length&&u(o[0][0],o[0][1])}}function x(e){var r,t;return r={},n("next"),n("throw",(function(e){throw e})),n("return"),r[Symbol.iterator]=function(){return this},r;function n(n,a){r[n]=e[n]?function(r){return(t=!t)?{value:P(e[n](r)),done:!1}:a?a(r):r}:a}}function T(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=h(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise((function(n,a){(function(e,r,t,n){Promise.resolve(n).then((function(r){e({value:r,done:t})}),r)})(n,a,(r=e[t](r)).done,r.value)}))}}}function z(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}var S=Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r};function E(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&b(r,e,t);return S(r,e),r}function C(e){return e&&e.__esModule?e:{default:e}}function k(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}function D(e,r,t,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,t):a?a.value=t:r.set(e,t),t}function M(e,r){if(null===r||"object"!=typeof r&&"function"!=typeof r)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?r===e:e.has(r)}function I(e,r,t){if(null!=r){if("object"!=typeof r&&"function"!=typeof r)throw new TypeError("Object expected.");var n;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=r[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=r[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:r,dispose:n,async:t})}else t&&e.stack.push({async:!0});return r}var N="function"==typeof SuppressedError?SuppressedError:function(e,r,t){var n=new Error(t);return n.name="SuppressedError",n.error=e,n.suppressed=r,n};function R(e){function r(r){e.error=e.hasError?new N(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var a=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(a).then(t,(function(e){return r(e),t()}))}catch(e){r(e)}}if(e.hasError)throw e.error}()}const A={__extends:a,__assign:o,__rest:i,__decorate:u,__param:c,__metadata:d,__awaiter:p,__generator:v,__createBinding:b,__exportStar:y,__values:h,__read:m,__spread:w,__spreadArrays:g,__spreadArray:O,__await:P,__asyncGenerator:j,__asyncDelegator:x,__asyncValues:T,__makeTemplateObject:z,__importStar:E,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:D,__classPrivateFieldIn:M,__addDisposableResource:I,__disposeResources:R}}},t={};function n(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return r[e](o,o.exports,n),o.exports}return n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(783)})()));
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports["@rarui/styles"]=r(require("react")):e["@rarui/styles"]=r(e.react)}(global,(e=>(()=>{"use strict";var r={46:(e,r,t)=>{t.r(r),t.d(r,{button:()=>l,overlay:()=>f});t(765);function n(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){var a,o,i;a=e,o=r,i=t[r],(o=n(o))in a?Object.defineProperty(a,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function i(e,r){var t={};for(var n in e)t[n]=r(e[n],n);return t}var u,c,s=(e,r,t)=>{for(var n of Object.keys(e)){var a;if(e[n]!==(null!==(a=r[n])&&void 0!==a?a:t[n]))return!1}return!0},l=(u={defaultClassName:"rarui-button__1a4hz7a0",variantClassNames:{appearance:{brand:"rarui-button_appearance_brand__1a4hz7a1","brand-secondary":"rarui-button_appearance_brand-secondary__1a4hz7a2",danger:"rarui-button_appearance_danger__1a4hz7a3",success:"rarui-button_appearance_success__1a4hz7a4",warning:"rarui-button_appearance_warning__1a4hz7a5",neutral:"rarui-button_appearance_neutral__1a4hz7a6",inverted:"rarui-button_appearance_inverted__1a4hz7a7"},size:{large:"rarui-button_size_large__1a4hz7a8",medium:"rarui-button_size_medium__1a4hz7a9",small:"rarui-button_size_small__1a4hz7aa"},variant:{solid:"rarui-button_variant_solid__1a4hz7ab",outlined:"rarui-button_variant_outlined__1a4hz7ac",text:"rarui-button_variant_text__1a4hz7ad",tonal:"rarui-button_variant_tonal__1a4hz7ae"}},defaultVariants:{},compoundVariants:[[{appearance:"brand",variant:"outlined"},"rarui-button_undefined_compound_0__1a4hz7af"],[{appearance:"brand-secondary",variant:"outlined"},"rarui-button_undefined_compound_1__1a4hz7ag"],[{appearance:"danger",variant:"outlined"},"rarui-button_undefined_compound_2__1a4hz7ah"],[{appearance:"success",variant:"outlined"},"rarui-button_undefined_compound_3__1a4hz7ai"],[{appearance:"warning",variant:"outlined"},"rarui-button_undefined_compound_4__1a4hz7aj"],[{appearance:"neutral",variant:"outlined"},"rarui-button_undefined_compound_5__1a4hz7ak"],[{appearance:"inverted",variant:"outlined"},"rarui-button_undefined_compound_6__1a4hz7al"],[{appearance:"brand",variant:"text"},"rarui-button_undefined_compound_7__1a4hz7am"],[{appearance:"brand-secondary",variant:"text"},"rarui-button_undefined_compound_8__1a4hz7an"],[{appearance:"danger",variant:"text"},"rarui-button_undefined_compound_9__1a4hz7ao"],[{appearance:"success",variant:"text"},"rarui-button_undefined_compound_10__1a4hz7ap"],[{appearance:"warning",variant:"text"},"rarui-button_undefined_compound_11__1a4hz7aq"],[{appearance:"neutral",variant:"text"},"rarui-button_undefined_compound_12__1a4hz7ar"],[{appearance:"inverted",variant:"text"},"rarui-button_undefined_compound_13__1a4hz7as"],[{appearance:"brand",variant:"tonal"},"rarui-button_undefined_compound_14__1a4hz7at"],[{appearance:"brand-secondary",variant:"tonal"},"rarui-button_undefined_compound_15__1a4hz7au"],[{appearance:"danger",variant:"tonal"},"rarui-button_undefined_compound_16__1a4hz7av"],[{appearance:"success",variant:"tonal"},"rarui-button_undefined_compound_17__1a4hz7aw"],[{appearance:"warning",variant:"tonal"},"rarui-button_undefined_compound_18__1a4hz7ax"],[{appearance:"neutral",variant:"tonal"},"rarui-button_undefined_compound_19__1a4hz7ay"],[{appearance:"brand",variant:"tonal"},"rarui-button_undefined_compound_20__1a4hz7az"]]},(c=e=>{var r=u.defaultClassName,t=o(o({},u.defaultVariants),e);for(var n in t){var a,i=null!==(a=t[n])&&void 0!==a?a:u.defaultVariants[n];if(null!=i){var c=i;"boolean"==typeof c&&(c=!0===c?"true":"false");var l=u.variantClassNames[n][c];l&&(r+=" "+l)}}for(var[f,_]of u.compoundVariants)s(f,t,u.defaultVariants)&&(r+=" "+_);return r}).variants=()=>Object.keys(u.variantClassNames),c.classNames={get base(){return u.defaultClassName.split(" ")[0]},get variants(){return i(u.variantClassNames,(e=>i(e,(e=>e.split(" ")[0]))))}},c),f="rarui-button__1a4hz7a10"},475:(e,r,t)=>{t.r(r),t.d(r,{default:()=>a,variables:()=>n});t(765);var n="rarui-theme-dark__t1161z0";const a="rarui-theme-dark__t1161z0"},765:()=>{},280:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProvider=void 0;const n=t(608).__importStar(t(155)),a=t(272),o=t(761),i=({children:e,theme:r="base",...t})=>{const i=n.default.useRef(null),u=(0,n.useMemo)((()=>({refThemeProvider:i,currentTheme:r})),[i,r]);return n.default.createElement("div",{className:a.themes[r],...t,ref:i},n.default.createElement(o.ThemeProviderContext.Provider,{value:u},e))};r.ThemeProvider=i,i.displayName="ThemeProvider"},414:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProviderContext=void 0;const n=t(155);r.ThemeProviderContext=(0,n.createContext)({})},105:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeProviderContext=void 0;const n=t(414);var a=t(414);Object.defineProperty(r,"ThemeProviderContext",{enumerable:!0,get:function(){return a.ThemeProviderContext}}),r.default=n.ThemeProviderContext},761:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0});t(608).__exportStar(t(105),r)},675:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;var n=t(496);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return n.useTheme}})},496:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;var n=t(370);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return n.useTheme}})},370:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=void 0;const n=t(155),a=t(761);r.useTheme=()=>(0,n.useContext)(a.ThemeProviderContext)},240:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.useTheme=r.ThemeProvider=void 0;const n=t(280);var a=t(280);Object.defineProperty(r,"ThemeProvider",{enumerable:!0,get:function(){return a.ThemeProvider}});var o=t(675);Object.defineProperty(r,"useTheme",{enumerable:!0,get:function(){return o.useTheme}}),r.default=n.ThemeProvider},272:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.themes=void 0;const n=t(475);r.themes={dark:n.variables,base:""}},783:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.button=void 0;t(608).__exportStar(t(240),r);var n=t(976);Object.defineProperty(r,"button",{enumerable:!0,get:function(){return n.button}})},976:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.button=void 0;const n=t(608).__importStar(t(46));r.button={classnames:{...n}}},155:r=>{r.exports=e},608:(e,r,t)=>{t.r(r),t.d(r,{__addDisposableResource:()=>I,__assign:()=>o,__asyncDelegator:()=>x,__asyncGenerator:()=>j,__asyncValues:()=>T,__await:()=>P,__awaiter:()=>p,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>D,__createBinding:()=>b,__decorate:()=>u,__disposeResources:()=>R,__esDecorate:()=>s,__exportStar:()=>y,__extends:()=>a,__generator:()=>v,__importDefault:()=>C,__importStar:()=>E,__makeTemplateObject:()=>z,__metadata:()=>d,__param:()=>c,__propKey:()=>f,__read:()=>m,__rest:()=>i,__runInitializers:()=>l,__setFunctionName:()=>_,__spread:()=>w,__spreadArray:()=>O,__spreadArrays:()=>g,__values:()=>h,default:()=>A});var n=function(e,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},n(e,r)};function a(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}n(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}var o=function(){return o=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},o.apply(this,arguments)};function i(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}function u(e,r,t,n){var a,o=arguments.length,i=o<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(i=(o<3?a(i):o>3?a(r,t,i):a(r,t))||i);return o>3&&i&&Object.defineProperty(r,t,i),i}function c(e,r){return function(t,n){r(t,n,e)}}function s(e,r,t,n,a,o){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var u,c=n.kind,s="getter"===c?"get":"setter"===c?"set":"value",l=!r&&e?n.static?e:e.prototype:null,f=r||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),_=!1,d=t.length-1;d>=0;d--){var p={};for(var v in n)p[v]="access"===v?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(e){if(_)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var b=(0,t[d])("accessor"===c?{get:f.get,set:f.set}:f[s],p);if("accessor"===c){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(u=i(b.get))&&(f.get=u),(u=i(b.set))&&(f.set=u),(u=i(b.init))&&a.unshift(u)}else(u=i(b))&&("field"===c?a.unshift(u):f[s]=u)}l&&Object.defineProperty(l,n.name,f),_=!0}function l(e,r,t){for(var n=arguments.length>2,a=0;a<r.length;a++)t=n?r[a].call(e,t):r[a].call(e);return n?t:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function _(e,r,t){return"symbol"==typeof r&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:t?"".concat(t," ",r):r})}function d(e,r){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,r)}function p(e,r,t,n){return new(t||(t=Promise))((function(a,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function u(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?a(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(i,u)}c((n=n.apply(e,r||[])).next())}))}function v(e,r){var t,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(t=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(6===u[0]&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=r.call(e,i)}catch(e){u=[6,e],n=0}finally{t=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var b=Object.create?function(e,r,t,n){void 0===n&&(n=t);var a=Object.getOwnPropertyDescriptor(r,t);a&&!("get"in a?!r.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,a)}:function(e,r,t,n){void 0===n&&(n=t),e[n]=r[t]};function y(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||b(r,e,t)}function h(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,a,o=t.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function w(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(m(arguments[r]));return e}function g(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var n=Array(e),a=0;for(r=0;r<t;r++)for(var o=arguments[r],i=0,u=o.length;i<u;i++,a++)n[a]=o[i];return n}function O(e,r,t){if(t||2===arguments.length)for(var n,a=0,o=r.length;a<o;a++)!n&&a in r||(n||(n=Array.prototype.slice.call(r,0,a)),n[a]=r[a]);return e.concat(n||Array.prototype.slice.call(r))}function P(e){return this instanceof P?(this.v=e,this):new P(e)}function j(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,a=t.apply(e,r||[]),o=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){a[e]&&(n[e]=function(r){return new Promise((function(t,n){o.push([e,r,t,n])>1||u(e,r)}))})}function u(e,r){try{(t=a[e](r)).value instanceof P?Promise.resolve(t.value.v).then(c,s):l(o[0][2],t)}catch(e){l(o[0][3],e)}var t}function c(e){u("next",e)}function s(e){u("throw",e)}function l(e,r){e(r),o.shift(),o.length&&u(o[0][0],o[0][1])}}function x(e){var r,t;return r={},n("next"),n("throw",(function(e){throw e})),n("return"),r[Symbol.iterator]=function(){return this},r;function n(n,a){r[n]=e[n]?function(r){return(t=!t)?{value:P(e[n](r)),done:!1}:a?a(r):r}:a}}function T(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=h(e),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise((function(n,a){(function(e,r,t,n){Promise.resolve(n).then((function(r){e({value:r,done:t})}),r)})(n,a,(r=e[t](r)).done,r.value)}))}}}function z(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}var S=Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r};function E(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&b(r,e,t);return S(r,e),r}function C(e){return e&&e.__esModule?e:{default:e}}function k(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}function D(e,r,t,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,t):a?a.value=t:r.set(e,t),t}function M(e,r){if(null===r||"object"!=typeof r&&"function"!=typeof r)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?r===e:e.has(r)}function I(e,r,t){if(null!=r){if("object"!=typeof r&&"function"!=typeof r)throw new TypeError("Object expected.");var n;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=r[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=r[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:r,dispose:n,async:t})}else t&&e.stack.push({async:!0});return r}var N="function"==typeof SuppressedError?SuppressedError:function(e,r,t){var n=new Error(t);return n.name="SuppressedError",n.error=e,n.suppressed=r,n};function R(e){function r(r){e.error=e.hasError?new N(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}return function t(){for(;e.stack.length;){var n=e.stack.pop();try{var a=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(a).then(t,(function(e){return r(e),t()}))}catch(e){r(e)}}if(e.hasError)throw e.error}()}const A={__extends:a,__assign:o,__rest:i,__decorate:u,__param:c,__metadata:d,__awaiter:p,__generator:v,__createBinding:b,__exportStar:y,__values:h,__read:m,__spread:w,__spreadArrays:g,__spreadArray:O,__await:P,__asyncGenerator:j,__asyncDelegator:x,__asyncValues:T,__makeTemplateObject:z,__importStar:E,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:D,__classPrivateFieldIn:M,__addDisposableResource:I,__disposeResources:R}}},t={};function n(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return r[e](o,o.exports,n),o.exports}return n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(783)})()));
|
package/dist/themes/dark.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@rarui/styles"]=r():e["@rarui/styles"]=r()}(global,(()=>(()=>{"use strict";var e={
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@rarui/styles"]=r():e["@rarui/styles"]=r()}(global,(()=>(()=>{"use strict";var e={765:()=>{}},r={};function t(o){var a=r[o];if(void 0!==a)return a.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.exports}t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{t.r(o),t.d(o,{default:()=>r,variables:()=>e});t(765);var e="rarui-theme-dark__t1161z0";const r="rarui-theme-dark__t1161z0"})(),o})()));
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rarui/styles",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"README.md",
|
|
9
|
+
"CHANGELOG.md"
|
|
10
|
+
],
|
|
6
11
|
"sideEffects": false,
|
|
7
12
|
"scripts": {
|
|
8
13
|
"build": "webpack",
|
|
@@ -18,8 +23,8 @@
|
|
|
18
23
|
"url": "https://github.com/juniorconquista/boilerplate-design-system/issues"
|
|
19
24
|
},
|
|
20
25
|
"devDependencies": {
|
|
21
|
-
"@rarui/tokens": "
|
|
22
|
-
"@rarui/webpack": "
|
|
26
|
+
"@rarui/tokens": "^1.0.0",
|
|
27
|
+
"@rarui/webpack": "^1.0.0",
|
|
23
28
|
"@vanilla-extract/css": "^1.14.1",
|
|
24
29
|
"@vanilla-extract/dynamic": "^2.1.0",
|
|
25
30
|
"@vanilla-extract/recipes": "^0.5.2",
|
|
@@ -28,6 +33,5 @@
|
|
|
28
33
|
"webpack": "^5.90.3",
|
|
29
34
|
"webpack-merge": "^5.10.0",
|
|
30
35
|
"webpack-shell-plugin-next": "^2.3.1"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
2
|
-
|
|
3
|
-
import { themes } from "./themeProvider.definitions";
|
|
4
|
-
import { ThemeProviderProps } from "./themeProvider.types";
|
|
5
|
-
import { ThemeProviderContext } from "./contexts";
|
|
6
|
-
|
|
7
|
-
const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
8
|
-
children,
|
|
9
|
-
theme = "base",
|
|
10
|
-
...rest
|
|
11
|
-
}) => {
|
|
12
|
-
const refThemeProvider = React.useRef(null);
|
|
13
|
-
|
|
14
|
-
const context = useMemo(
|
|
15
|
-
() => ({ refThemeProvider, currentTheme: theme }),
|
|
16
|
-
[refThemeProvider, theme],
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className={themes[theme]} {...rest} ref={refThemeProvider}>
|
|
21
|
-
<ThemeProviderContext.Provider value={context}>
|
|
22
|
-
{children}
|
|
23
|
-
</ThemeProviderContext.Provider>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
ThemeProvider.displayName = "ThemeProvider";
|
|
29
|
-
|
|
30
|
-
export { ThemeProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ThemeProviderContext";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useTheme } from "./useTheme";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useTheme } from "./useTheme";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { renderHook } from "@testing-library/react";
|
|
3
|
-
|
|
4
|
-
import { useTheme } from "./useTheme";
|
|
5
|
-
import { ThemeProvider } from "../../ThemeProvider";
|
|
6
|
-
import { Theme } from "../../themeProvider.types";
|
|
7
|
-
|
|
8
|
-
const makeSut = (theme?: Theme) =>
|
|
9
|
-
renderHook(() => useTheme(), {
|
|
10
|
-
wrapper: ({ children }: { children: React.ReactNode }) => (
|
|
11
|
-
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
12
|
-
),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
describe("GIVEN useTheme", () => {
|
|
16
|
-
describe("WHEN the hook runs", () => {
|
|
17
|
-
it("THEN should correctly return currentTheme default", () => {
|
|
18
|
-
const { result } = makeSut();
|
|
19
|
-
expect(result.current.currentTheme).toEqual("base");
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("THEN should correctly return currentTheme dark", () => {
|
|
23
|
-
const { result } = makeSut("dark");
|
|
24
|
-
expect(result.current.currentTheme).toEqual("dark");
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
});
|
package/src/components/index.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render, screen } from "@testing-library/react";
|
|
3
|
-
|
|
4
|
-
import { ThemeProvider } from ".";
|
|
5
|
-
import { ThemeProviderProps } from "./themeProvider.types";
|
|
6
|
-
|
|
7
|
-
const makeSut = (props: ThemeProviderProps) => {
|
|
8
|
-
render(<ThemeProvider {...props} data-testid="theme-provider-element" />);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
describe("GIVEN <ThemeProvider />", () => {
|
|
12
|
-
describe("WHEN rendered", () => {
|
|
13
|
-
it("THEN should render the submitted children", () => {
|
|
14
|
-
makeSut({ children: "My children" });
|
|
15
|
-
expect(screen.getByText("My children")).toBeDefined();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
describe("THEN should correctly render the submitted theme", () => {
|
|
20
|
-
it("THEN should correctly render the padding default", () => {
|
|
21
|
-
makeSut({ children: "My children" });
|
|
22
|
-
expect(
|
|
23
|
-
screen.getByTestId("theme-provider-element").getAttribute("class"),
|
|
24
|
-
).toEqual("");
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("THEN should correctly render the padding base", () => {
|
|
28
|
-
makeSut({ children: "My children", theme: "base" });
|
|
29
|
-
expect(
|
|
30
|
-
screen.getByTestId("theme-provider-element").getAttribute("class"),
|
|
31
|
-
).toEqual("");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("THEN should correctly render the padding dark", () => {
|
|
35
|
-
makeSut({ children: "My children", theme: "dark" });
|
|
36
|
-
expect(
|
|
37
|
-
screen.getByTestId("theme-provider-element").getAttribute("class"),
|
|
38
|
-
).toContain("dark");
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
});
|
package/src/index.ts
DELETED
package/src/index.types.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export interface Conditions<T> {
|
|
2
|
-
xs?: T;
|
|
3
|
-
md?: T;
|
|
4
|
-
lg?: T;
|
|
5
|
-
xl?: T;
|
|
6
|
-
}
|
|
7
|
-
export type AspectRatio =
|
|
8
|
-
| "1/1"
|
|
9
|
-
| "16/9"
|
|
10
|
-
| "9/16"
|
|
11
|
-
| "4/3"
|
|
12
|
-
| "3/4"
|
|
13
|
-
| "2/1"
|
|
14
|
-
| "1/2";
|
|
15
|
-
export type BorderStyle = "solid" | "none" | "hidden" | "dashed" | "dotted";
|
|
16
|
-
export type BoxSizing = "border-box" | "content-box";
|
|
17
|
-
export type Cursor = "auto" | "pointer" | "not-allowed" | "grab" | "inherit";
|
|
18
|
-
export type Display =
|
|
19
|
-
| "block"
|
|
20
|
-
| "flex"
|
|
21
|
-
| "inline-flex"
|
|
22
|
-
| "grid"
|
|
23
|
-
| "inline-grid"
|
|
24
|
-
| "none";
|
|
25
|
-
export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
26
|
-
export type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
|
|
27
|
-
export type JustifyContent =
|
|
28
|
-
| "flex-start"
|
|
29
|
-
| "flex-end"
|
|
30
|
-
| "center"
|
|
31
|
-
| "space-between"
|
|
32
|
-
| "space-around"
|
|
33
|
-
| "space-evenly";
|
|
34
|
-
export type AlignItems =
|
|
35
|
-
| "stretch"
|
|
36
|
-
| "flex-start"
|
|
37
|
-
| "flex-end"
|
|
38
|
-
| "center"
|
|
39
|
-
| "baseline";
|
|
40
|
-
export type AlignSelf =
|
|
41
|
-
| "auto"
|
|
42
|
-
| "flex-start"
|
|
43
|
-
| "flex-end"
|
|
44
|
-
| "center"
|
|
45
|
-
| "baseline"
|
|
46
|
-
| "stretch";
|
|
47
|
-
export type TextAlign = "left" | "right" | "center" | "justify";
|
|
48
|
-
export type TextDecoration = "none" | "underline";
|
|
49
|
-
export type Position = "absolute" | "fixed" | "relative" | "static" | "sticky";
|
|
50
|
-
export type Overflow = "visible" | "hidden" | "scroll" | "auto";
|
|
51
|
-
export type PointerEvents =
|
|
52
|
-
| "auto"
|
|
53
|
-
| "none"
|
|
54
|
-
| "visiblePainted"
|
|
55
|
-
| "visibleFill"
|
|
56
|
-
| "visibleStroke"
|
|
57
|
-
| "visible"
|
|
58
|
-
| "painted"
|
|
59
|
-
| "fill"
|
|
60
|
-
| "stroke"
|
|
61
|
-
| "all"
|
|
62
|
-
| "inherit";
|
|
63
|
-
export type TransitionTiming =
|
|
64
|
-
| "ease"
|
|
65
|
-
| "ease-in"
|
|
66
|
-
| "ease-out"
|
|
67
|
-
| "ease-in-out"
|
|
68
|
-
| "linear"
|
|
69
|
-
| "step-start"
|
|
70
|
-
| "step-end";
|
|
71
|
-
export type WordBreak = "normal" | "break-all" | "keep-all" | "break-word";
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { varsThemeBase } from "../../../themes";
|
|
2
|
-
|
|
3
|
-
export const buttonOutlined = {
|
|
4
|
-
brand: {
|
|
5
|
-
":hover": {
|
|
6
|
-
backgroundColor: varsThemeBase.colors.surface["brand-hover"],
|
|
7
|
-
},
|
|
8
|
-
":active": {
|
|
9
|
-
backgroundColor: varsThemeBase.colors.surface["brand-press"],
|
|
10
|
-
},
|
|
11
|
-
color: varsThemeBase.colors.content.brand,
|
|
12
|
-
},
|
|
13
|
-
"brand-secondary": {
|
|
14
|
-
":hover": {
|
|
15
|
-
backgroundColor: varsThemeBase.colors.surface["brand-secondary-hover"],
|
|
16
|
-
},
|
|
17
|
-
":active": {
|
|
18
|
-
backgroundColor: varsThemeBase.colors.surface["brand-secondary-press"],
|
|
19
|
-
},
|
|
20
|
-
color: varsThemeBase.colors.content["brand-secondary"],
|
|
21
|
-
},
|
|
22
|
-
danger: {
|
|
23
|
-
":hover": {
|
|
24
|
-
backgroundColor: varsThemeBase.colors.surface["error-hover"],
|
|
25
|
-
},
|
|
26
|
-
":active": {
|
|
27
|
-
backgroundColor: varsThemeBase.colors.surface["error-press"],
|
|
28
|
-
},
|
|
29
|
-
color: varsThemeBase.colors.content.error,
|
|
30
|
-
},
|
|
31
|
-
success: {
|
|
32
|
-
":hover": {
|
|
33
|
-
backgroundColor: varsThemeBase.colors.surface["success-hover"],
|
|
34
|
-
},
|
|
35
|
-
":active": {
|
|
36
|
-
backgroundColor: varsThemeBase.colors.surface["success-press"],
|
|
37
|
-
},
|
|
38
|
-
color: varsThemeBase.colors.content.success,
|
|
39
|
-
},
|
|
40
|
-
warning: {
|
|
41
|
-
":hover": {
|
|
42
|
-
backgroundColor: varsThemeBase.colors.surface["warning-hover"],
|
|
43
|
-
},
|
|
44
|
-
":active": {
|
|
45
|
-
backgroundColor: varsThemeBase.colors.surface["warning-press"],
|
|
46
|
-
},
|
|
47
|
-
color: varsThemeBase.colors.content.warning,
|
|
48
|
-
},
|
|
49
|
-
neutral: {
|
|
50
|
-
":hover": {
|
|
51
|
-
backgroundColor: varsThemeBase.colors.surface.hover,
|
|
52
|
-
},
|
|
53
|
-
":active": {
|
|
54
|
-
backgroundColor: varsThemeBase.colors.surface.press,
|
|
55
|
-
},
|
|
56
|
-
color: varsThemeBase.colors.content.primary,
|
|
57
|
-
},
|
|
58
|
-
inverted: {
|
|
59
|
-
":hover": {
|
|
60
|
-
backgroundColor: varsThemeBase.colors.surface["invert-hover"],
|
|
61
|
-
},
|
|
62
|
-
":active": {
|
|
63
|
-
backgroundColor: varsThemeBase.colors.surface["invert-press"],
|
|
64
|
-
},
|
|
65
|
-
color: varsThemeBase.colors.content.invert,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const buttonText = {
|
|
70
|
-
brand: buttonOutlined.brand,
|
|
71
|
-
"brand-secondary": buttonOutlined["brand-secondary"],
|
|
72
|
-
danger: buttonOutlined.danger,
|
|
73
|
-
success: buttonOutlined.success,
|
|
74
|
-
warning: buttonOutlined.warning,
|
|
75
|
-
neutral: buttonOutlined.neutral,
|
|
76
|
-
inverted: buttonOutlined.inverted,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const buttonVariants = {
|
|
80
|
-
outlined: buttonOutlined,
|
|
81
|
-
text: buttonText,
|
|
82
|
-
};
|