@takecasper/acuity-design-system 1.0.3 → 1.0.5
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 +84 -4
- package/dist/index.cjs.js +10 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -21
- package/dist/index.es.js +342 -1024
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +18 -2
package/README.md
CHANGED
|
@@ -15,8 +15,24 @@ Project is using Vite as a build tool. It's a very fast build tool that consists
|
|
|
15
15
|
- A dev server that provides rich feature enhancements over native ES modules, for example extremely fast Hot Module Replacement (HMR).
|
|
16
16
|
- A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production.
|
|
17
17
|
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
Before installing the library to your project, make sure to have `.npmrc` file in the root of your project.
|
|
21
|
+
You should add `//registry.npmjs.org/:_authToken="auth token"` as this is a private package.
|
|
22
|
+
|
|
23
|
+
Then run:
|
|
24
|
+
|
|
25
|
+
`npm install @takecasper/acuity-design-system`
|
|
26
|
+
|
|
18
27
|
## IDE Setup
|
|
19
28
|
|
|
29
|
+
### Quick Start
|
|
30
|
+
|
|
31
|
+
1. Install docker desktop via. https://www.docker.com/products/docker-desktop/
|
|
32
|
+
2. To start storybook as a standalone service you can simply navigate to the root project directory and run the command `docker-compose up`
|
|
33
|
+
3. Storybook can then be accessed via `localhost:6006`
|
|
34
|
+
4. Access the prompt shell from the container, you can use the following command: $ docker exec -it <name_staging_container> bash
|
|
35
|
+
|
|
20
36
|
### 1. Install Dependencies
|
|
21
37
|
|
|
22
38
|
```
|
|
@@ -37,27 +53,91 @@ npm i
|
|
|
37
53
|
- Hover Previews. See the complete CSS for a Tailwind class name by hovering over it.
|
|
38
54
|
- Syntax Highlighting. Provides syntax definitions so that Tailwind features are highlighted correctly.
|
|
39
55
|
|
|
56
|
+
#### Setup with clsx lib
|
|
57
|
+
|
|
58
|
+
Add following to your `settings.json`:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
{
|
|
62
|
+
"tailwindCSS.experimental.classRegex": [
|
|
63
|
+
["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
40
68
|
2. [Automatic class sorting plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) - A Prettier v3+ plugin for Tailwind CSS v3.0+ that automatically sorts classes based on [their recommended class order](https://tailwindcss.com/blog/automatic-class-sorting-with-prettier#how-classes-are-sorted)
|
|
41
69
|
|
|
42
70
|
3. [Tailwind Fold](https://marketplace.visualstudio.com/items?itemName=stivo.tailwind-fold) - This extension helps improve the readability of your code by automatically "folding" long class attributes.
|
|
43
|
-
|
|
71
|
+
|
|
72
|
+
- By default, automatic folding is enabled, but you can customize this behavior in the settings. Quickly toggle folding using the keyboard shortcut `Ctrl+Alt+A`
|
|
44
73
|
|
|
45
74
|
## Publishing to NPM
|
|
46
75
|
|
|
47
76
|
To trigger build and publishing to npm automatically, follow [this guide](https://github.com/semantic-release/semantic-release/blob/master/docs/support/FAQ.md#how-can-i-change-the-type-of-commits-that-trigger-a-release).
|
|
48
77
|
|
|
78
|
+
Essentially, the github action for publishing a new library version will be triggered only when certain keywords are included in the git commit message, and only on commits to the `main` branch (`fix`, `feat`, `perf`, etc.).
|
|
79
|
+
Therefore, we should make sure that each time we squash and merge our feature branches to the main branch we should include those keywords in the commit message, if we want to publish a new lib version.
|
|
80
|
+
Certain changes don't need to trigger lib publishing, such as adding new stories, Storybook changes or tests.
|
|
81
|
+
|
|
49
82
|
## Development
|
|
50
83
|
|
|
51
84
|
- For faster search and usage of tailwind utility classes use [Tailwind Cheat Sheet](https://tailwindcomponents.com/cheatsheet/)
|
|
52
85
|
|
|
53
86
|
### Project structure
|
|
54
87
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### Best practices
|
|
88
|
+
## Best practices
|
|
58
89
|
|
|
59
90
|
### Adding new components
|
|
60
91
|
|
|
92
|
+
For easier development and conditional rendering of tailwind's utility classes it is recommended to use the following 3 libraries when adding new components:
|
|
93
|
+
|
|
94
|
+
1. [`clsx`](ttps://www.npmjs.com/package/clsx) - A tiny (239B) utility for constructing `className` strings conditionally.
|
|
95
|
+
Also serves as a faster & smaller drop-in replacement for the classnames module.
|
|
96
|
+
2. [`tailwind-merge`](https://www.npmjs.com/package/tailwind-merge) - Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
import { twMerge } from 'tailwind-merge'
|
|
100
|
+
|
|
101
|
+
twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
|
|
102
|
+
// → 'hover:bg-dark-red p-3 bg-[#B91C1C]'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
3. [`class-variance-authority`](https://cva.style/docs) - Specifically important to follow [these guidelines](https://cva.style/docs/getting-started/installation#tailwind-css) for using cva lib with Tailwind CSS
|
|
106
|
+
Example using cva with tailwind merge:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
110
|
+
import { twMerge } from "tailwind-merge";
|
|
111
|
+
|
|
112
|
+
const buttonVariants = cva(["your", "base", "classes"], {
|
|
113
|
+
variants: {
|
|
114
|
+
intent: {
|
|
115
|
+
primary: ["your", "primary", "classes"],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
defaultVariants: {
|
|
119
|
+
intent: "primary",
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export interface ButtonVariants extends VariantProps<typeof buttonVariants> {}
|
|
124
|
+
|
|
125
|
+
export const button = (variants: ButtonVariants) =>
|
|
126
|
+
twMerge(buttonVariants(variants));
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### PR Review process
|
|
131
|
+
|
|
132
|
+
- **Creating commits**:
|
|
133
|
+
|
|
134
|
+
- The first commit of the new branch should include the context, description, and Jira ticket in the bottom of the commit.
|
|
135
|
+
- When the feature is approved and we squash all the commits from the pr branch into one and then merge into the `main` branch, git will pick up the first commit message and add asterisks with subsequent commits, that means you can adjust the final commit description based on the secondary commits, and because you added the JIRA link in the first commit, from then on it will be tracked by JIRA.
|
|
136
|
+
|
|
137
|
+
- **Using "Squash and merge"** option when merging pr branches into main. Here is [some documentation](https://acuityinsights.atlassian.net/wiki/spaces/SE/pages/2858319936/Coding+Guidelines#Squash-Merge) about why to use squash and merge.
|
|
138
|
+
|
|
139
|
+
- **Two approvals** are needed per open PR
|
|
140
|
+
|
|
61
141
|
## Expanding the ESLint configuration
|
|
62
142
|
|
|
63
143
|
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("react");var H={exports:{}},A={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Re;function ir(){if(Re)return A;Re=1;var j=Oe,m=Symbol.for("react.element"),k=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,O=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function _(b,f,w){var v,g={},R=null,$=null;w!==void 0&&(R=""+w),f.key!==void 0&&(R=""+f.key),f.ref!==void 0&&($=f.ref);for(v in f)E.call(f,v)&&!C.hasOwnProperty(v)&&(g[v]=f[v]);if(b&&b.defaultProps)for(v in f=b.defaultProps,f)g[v]===void 0&&(g[v]=f[v]);return{$$typeof:m,type:b,key:R,ref:$,props:g,_owner:O.current}}return A.Fragment=k,A.jsx=_,A.jsxs=_,A}var I={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,34 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var Te;function ur(){return Te||(Te=1,process.env.NODE_ENV!=="production"&&function(){var j=Oe,m=Symbol.for("react.element"),k=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),b=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),X=Symbol.iterator,Ce="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=X&&e[X]||e[Ce];return typeof r=="function"?r:null}var S=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Se("error",e,t)}}function Se(e,r,t){{var n=S.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Pe=!1,xe=!1,je=!1,ke=!1,De=!1,Z;Z=Symbol.for("react.module.reference");function Fe(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===C||De||e===O||e===w||e===v||ke||e===$||Pe||xe||je||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===g||e.$$typeof===_||e.$$typeof===b||e.$$typeof===f||e.$$typeof===Z||e.getModuleId!==void 0))}function Ae(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function Q(e){return e.displayName||"Context"}function y(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case k:return"Portal";case C:return"Profiler";case O:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return Q(r)+".Consumer";case _:var t=e;return Q(t._context)+".Provider";case f:return Ae(e,e.render,"ForwardRef");case g:var n=e.displayName||null;return n!==null?n:y(e.type)||"Memo";case R:{var i=e,u=i._payload,o=i._init;try{return y(o(u))}catch{return null}}}return null}var T=Object.assign,D=0,ee,re,te,ne,ae,oe,ie;function ue(){}ue.__reactDisabledLog=!0;function Ie(){{if(D===0){ee=console.log,re=console.info,te=console.warn,ne=console.error,ae=console.group,oe=console.groupCollapsed,ie=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function $e(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},e,{value:ee}),info:T({},e,{value:re}),warn:T({},e,{value:te}),error:T({},e,{value:ne}),group:T({},e,{value:ae}),groupCollapsed:T({},e,{value:oe}),groupEnd:T({},e,{value:ie})})}D<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var V=S.ReactCurrentDispatcher,U;function W(e,r,t){{if(U===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);U=n&&n[1]||""}return`
|
|
18
|
+
`+U+e}}var B=!1,Y;{var We=typeof WeakMap=="function"?WeakMap:Map;Y=new We}function se(e,r){if(!e||B)return"";{var t=Y.get(e);if(t!==void 0)return t}var n;B=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=V.current,V.current=null,Ie();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(h){n=h}Reflect.construct(e,[],o)}else{try{o.call()}catch(h){n=h}e.call(o.prototype)}}else{try{throw Error()}catch(h){n=h}e()}}catch(h){if(h&&n&&typeof h.stack=="string"){for(var a=h.stack.split(`
|
|
19
|
+
`),d=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,l=d.length-1;s>=1&&l>=0&&a[s]!==d[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==d[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==d[l]){var p=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,p),p}while(s>=1&&l>=0);break}}}finally{B=!1,V.current=u,$e(),Error.prepareStackTrace=i}var x=e?e.displayName||e.name:"",_e=x?W(x):"";return typeof e=="function"&&Y.set(e,_e),_e}function Ye(e,r,t){return se(e,!1)}function Ne(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return se(e,Ne(e));if(typeof e=="string")return W(e);switch(e){case w:return W("Suspense");case v:return W("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ye(e.render);case g:return N(e.type,r,t);case R:{var n=e,i=n._payload,u=n._init;try{return N(u(i),r,t)}catch{}}}return""}var L=Object.prototype.hasOwnProperty,le={},fe=S.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);fe.setExtraStackFrame(t)}else fe.setExtraStackFrame(null)}function Le(e,r,t,n,i){{var u=Function.call.bind(L);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(M(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),M(null)),a instanceof Error&&!(a.message in le)&&(le[a.message]=!0,M(i),c("Failed %s type: %s",t,a.message),M(null))}}}var Me=Array.isArray;function q(e){return Me(e)}function Ve(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ue(e){try{return ce(e),!1}catch{return!0}}function ce(e){return""+e}function de(e){if(Ue(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ve(e)),ce(e)}var F=S.ReactCurrentOwner,Be={key:!0,ref:!0,__self:!0,__source:!0},ve,pe,J;J={};function qe(e){if(L.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Je(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ge(e,r){if(typeof e.ref=="string"&&F.current&&r&&F.current.stateNode!==r){var t=y(F.current.type);J[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',y(F.current.type),e.ref),J[t]=!0)}}function ze(e,r){{var t=function(){ve||(ve=!0,c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ke(e,r){{var t=function(){pe||(pe=!0,c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var He=function(e,r,t,n,i,u,o){var a={$$typeof:m,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Xe(e,r,t,n,i){{var u,o={},a=null,d=null;t!==void 0&&(de(t),a=""+t),Je(r)&&(de(r.key),a=""+r.key),qe(r)&&(d=r.ref,Ge(r,i));for(u in r)L.call(r,u)&&!Be.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||d){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ze(o,l),d&&Ke(o,l)}return He(e,a,d,i,n,F.current,o)}}var G=S.ReactCurrentOwner,be=S.ReactDebugCurrentFrame;function P(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);be.setExtraStackFrame(t)}else be.setExtraStackFrame(null)}var z;z=!1;function K(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function ge(){{if(G.current){var e=y(G.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Ze(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var ye={};function Qe(e){{var r=ge();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
28
|
-
* react-is.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Ze;function kr(){if(Ze)return j;Ze=1;var u=typeof Symbol=="function"&&Symbol.for,D=u?Symbol.for("react.element"):60103,I=u?Symbol.for("react.portal"):60106,d=u?Symbol.for("react.fragment"):60107,w=u?Symbol.for("react.strict_mode"):60108,f=u?Symbol.for("react.profiler"):60114,S=u?Symbol.for("react.provider"):60109,c=u?Symbol.for("react.context"):60110,b=u?Symbol.for("react.async_mode"):60111,P=u?Symbol.for("react.concurrent_mode"):60111,l=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113,$=u?Symbol.for("react.suspense_list"):60120,F=u?Symbol.for("react.memo"):60115,z=u?Symbol.for("react.lazy"):60116,M=u?Symbol.for("react.block"):60121,V=u?Symbol.for("react.fundamental"):60117,U=u?Symbol.for("react.responder"):60118,Y=u?Symbol.for("react.scope"):60119;function N(o){if(typeof o=="object"&&o!==null){var ee=o.$$typeof;switch(ee){case D:switch(o=o.type,o){case b:case P:case d:case f:case w:case E:return o;default:switch(o=o&&o.$$typeof,o){case c:case l:case z:case F:case S:return o;default:return ee}}case I:return ee}}}function q(o){return N(o)===P}return j.AsyncMode=b,j.ConcurrentMode=P,j.ContextConsumer=c,j.ContextProvider=S,j.Element=D,j.ForwardRef=l,j.Fragment=d,j.Lazy=z,j.Memo=F,j.Portal=I,j.Profiler=f,j.StrictMode=w,j.Suspense=E,j.isAsyncMode=function(o){return q(o)||N(o)===b},j.isConcurrentMode=q,j.isContextConsumer=function(o){return N(o)===c},j.isContextProvider=function(o){return N(o)===S},j.isElement=function(o){return typeof o=="object"&&o!==null&&o.$$typeof===D},j.isForwardRef=function(o){return N(o)===l},j.isFragment=function(o){return N(o)===d},j.isLazy=function(o){return N(o)===z},j.isMemo=function(o){return N(o)===F},j.isPortal=function(o){return N(o)===I},j.isProfiler=function(o){return N(o)===f},j.isStrictMode=function(o){return N(o)===w},j.isSuspense=function(o){return N(o)===E},j.isValidElementType=function(o){return typeof o=="string"||typeof o=="function"||o===d||o===P||o===f||o===w||o===E||o===$||typeof o=="object"&&o!==null&&(o.$$typeof===z||o.$$typeof===F||o.$$typeof===S||o.$$typeof===c||o.$$typeof===l||o.$$typeof===V||o.$$typeof===U||o.$$typeof===Y||o.$$typeof===M)},j.typeOf=N,j}var A={};/** @license React v16.13.1
|
|
35
|
-
* react-is.development.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Qe;function Dr(){return Qe||(Qe=1,process.env.NODE_ENV!=="production"&&function(){var u=typeof Symbol=="function"&&Symbol.for,D=u?Symbol.for("react.element"):60103,I=u?Symbol.for("react.portal"):60106,d=u?Symbol.for("react.fragment"):60107,w=u?Symbol.for("react.strict_mode"):60108,f=u?Symbol.for("react.profiler"):60114,S=u?Symbol.for("react.provider"):60109,c=u?Symbol.for("react.context"):60110,b=u?Symbol.for("react.async_mode"):60111,P=u?Symbol.for("react.concurrent_mode"):60111,l=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113,$=u?Symbol.for("react.suspense_list"):60120,F=u?Symbol.for("react.memo"):60115,z=u?Symbol.for("react.lazy"):60116,M=u?Symbol.for("react.block"):60121,V=u?Symbol.for("react.fundamental"):60117,U=u?Symbol.for("react.responder"):60118,Y=u?Symbol.for("react.scope"):60119;function N(a){return typeof a=="string"||typeof a=="function"||a===d||a===P||a===f||a===w||a===E||a===$||typeof a=="object"&&a!==null&&(a.$$typeof===z||a.$$typeof===F||a.$$typeof===S||a.$$typeof===c||a.$$typeof===l||a.$$typeof===V||a.$$typeof===U||a.$$typeof===Y||a.$$typeof===M)}function q(a){if(typeof a=="object"&&a!==null){var X=a.$$typeof;switch(X){case D:var ce=a.type;switch(ce){case b:case P:case d:case f:case w:case E:return ce;default:var oe=ce&&ce.$$typeof;switch(oe){case c:case l:case z:case F:case S:return oe;default:return X}}case I:return X}}}var o=b,ee=P,ve=c,pe=S,ie=D,ye=l,ue=d,se=z,H=F,G=I,re=f,K=w,Q=E,ae=!1;function fe(a){return ae||(ae=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),t(a)||q(a)===b}function t(a){return q(a)===P}function i(a){return q(a)===c}function m(a){return q(a)===S}function h(a){return typeof a=="object"&&a!==null&&a.$$typeof===D}function v(a){return q(a)===l}function R(a){return q(a)===d}function p(a){return q(a)===z}function y(a){return q(a)===F}function g(a){return q(a)===I}function C(a){return q(a)===f}function T(a){return q(a)===w}function B(a){return q(a)===E}A.AsyncMode=o,A.ConcurrentMode=ee,A.ContextConsumer=ve,A.ContextProvider=pe,A.Element=ie,A.ForwardRef=ye,A.Fragment=ue,A.Lazy=se,A.Memo=H,A.Portal=G,A.Profiler=re,A.StrictMode=K,A.Suspense=Q,A.isAsyncMode=fe,A.isConcurrentMode=t,A.isContextConsumer=i,A.isContextProvider=m,A.isElement=h,A.isForwardRef=v,A.isFragment=R,A.isLazy=p,A.isMemo=y,A.isPortal=g,A.isProfiler=C,A.isStrictMode=T,A.isSuspense=B,A.isValidElementType=N,A.typeOf=q}()),A}var er;function sr(){return er||(er=1,process.env.NODE_ENV==="production"?Te.exports=kr():Te.exports=Dr()),Te.exports}/*
|
|
42
|
-
object-assign
|
|
43
|
-
(c) Sindre Sorhus
|
|
44
|
-
@license MIT
|
|
45
|
-
*/var Ce,rr;function Mr(){if(rr)return Ce;rr=1;var u=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;function d(f){if(f==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}function w(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de",Object.getOwnPropertyNames(f)[0]==="5")return!1;for(var S={},c=0;c<10;c++)S["_"+String.fromCharCode(c)]=c;var b=Object.getOwnPropertyNames(S).map(function(l){return S[l]});if(b.join("")!=="0123456789")return!1;var P={};return"abcdefghijklmnopqrst".split("").forEach(function(l){P[l]=l}),Object.keys(Object.assign({},P)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ce=w()?Object.assign:function(f,S){for(var c,b=d(f),P,l=1;l<arguments.length;l++){c=Object(arguments[l]);for(var E in c)D.call(c,E)&&(b[E]=c[E]);if(u){P=u(c);for(var $=0;$<P.length;$++)I.call(c,P[$])&&(b[P[$]]=c[P[$]])}}return b},Ce}var we,tr;function De(){if(tr)return we;tr=1;var u="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return we=u,we}var xe,nr;function fr(){return nr||(nr=1,xe=Function.call.bind(Object.prototype.hasOwnProperty)),xe}var je,ar;function Fr(){if(ar)return je;ar=1;var u=function(){};if(process.env.NODE_ENV!=="production"){var D=De(),I={},d=fr();u=function(f){var S="Warning: "+f;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}}}function w(f,S,c,b,P){if(process.env.NODE_ENV!=="production"){for(var l in f)if(d(f,l)){var E;try{if(typeof f[l]!="function"){var $=Error((b||"React class")+": "+c+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw $.name="Invariant Violation",$}E=f[l](S,l,b,c,null,D)}catch(z){E=z}if(E&&!(E instanceof Error)&&u((b||"React class")+": type specification of "+c+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof E+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),E instanceof Error&&!(E.message in I)){I[E.message]=!0;var F=P?P():"";u("Failed "+c+" type: "+E.message+(F??""))}}}}return w.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(I={})},je=w,je}var Ae,or;function Yr(){if(or)return Ae;or=1;var u=sr(),D=Mr(),I=De(),d=fr(),w=Fr(),f=function(){};process.env.NODE_ENV!=="production"&&(f=function(c){var b="Warning: "+c;typeof console<"u"&&console.error(b);try{throw new Error(b)}catch{}});function S(){return null}return Ae=function(c,b){var P=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function E(t){var i=t&&(P&&t[P]||t[l]);if(typeof i=="function")return i}var $="<<anonymous>>",F={array:U("array"),bigint:U("bigint"),bool:U("boolean"),func:U("function"),number:U("number"),object:U("object"),string:U("string"),symbol:U("symbol"),any:Y(),arrayOf:N,element:q(),elementType:o(),instanceOf:ee,node:ye(),objectOf:pe,oneOf:ve,oneOfType:ie,shape:se,exact:H};function z(t,i){return t===i?t!==0||1/t===1/i:t!==t&&i!==i}function M(t,i){this.message=t,this.data=i&&typeof i=="object"?i:{},this.stack=""}M.prototype=Error.prototype;function V(t){if(process.env.NODE_ENV!=="production")var i={},m=0;function h(R,p,y,g,C,T,B){if(g=g||$,T=T||y,B!==I){if(b){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var X=g+":"+y;!i[X]&&m<3&&(f("You are manually calling a React.PropTypes validation function for the `"+T+"` prop on `"+g+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),i[X]=!0,m++)}}return p[y]==null?R?p[y]===null?new M("The "+C+" `"+T+"` is marked as required "+("in `"+g+"`, but its value is `null`.")):new M("The "+C+" `"+T+"` is marked as required in "+("`"+g+"`, but its value is `undefined`.")):null:t(p,y,g,C,T)}var v=h.bind(null,!1);return v.isRequired=h.bind(null,!0),v}function U(t){function i(m,h,v,R,p,y){var g=m[h],C=K(g);if(C!==t){var T=Q(g);return new M("Invalid "+R+" `"+p+"` of type "+("`"+T+"` supplied to `"+v+"`, expected ")+("`"+t+"`."),{expectedType:t})}return null}return V(i)}function Y(){return V(S)}function N(t){function i(m,h,v,R,p){if(typeof t!="function")return new M("Property `"+p+"` of component `"+v+"` has invalid PropType notation inside arrayOf.");var y=m[h];if(!Array.isArray(y)){var g=K(y);return new M("Invalid "+R+" `"+p+"` of type "+("`"+g+"` supplied to `"+v+"`, expected an array."))}for(var C=0;C<y.length;C++){var T=t(y,C,v,R,p+"["+C+"]",I);if(T instanceof Error)return T}return null}return V(i)}function q(){function t(i,m,h,v,R){var p=i[m];if(!c(p)){var y=K(p);return new M("Invalid "+v+" `"+R+"` of type "+("`"+y+"` supplied to `"+h+"`, expected a single ReactElement."))}return null}return V(t)}function o(){function t(i,m,h,v,R){var p=i[m];if(!u.isValidElementType(p)){var y=K(p);return new M("Invalid "+v+" `"+R+"` of type "+("`"+y+"` supplied to `"+h+"`, expected a single ReactElement type."))}return null}return V(t)}function ee(t){function i(m,h,v,R,p){if(!(m[h]instanceof t)){var y=t.name||$,g=fe(m[h]);return new M("Invalid "+R+" `"+p+"` of type "+("`"+g+"` supplied to `"+v+"`, expected ")+("instance of `"+y+"`."))}return null}return V(i)}function ve(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&(arguments.length>1?f("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):f("Invalid argument supplied to oneOf, expected an array.")),S;function i(m,h,v,R,p){for(var y=m[h],g=0;g<t.length;g++)if(z(y,t[g]))return null;var C=JSON.stringify(t,function(B,a){var X=Q(a);return X==="symbol"?String(a):a});return new M("Invalid "+R+" `"+p+"` of value `"+String(y)+"` "+("supplied to `"+v+"`, expected one of "+C+"."))}return V(i)}function pe(t){function i(m,h,v,R,p){if(typeof t!="function")return new M("Property `"+p+"` of component `"+v+"` has invalid PropType notation inside objectOf.");var y=m[h],g=K(y);if(g!=="object")return new M("Invalid "+R+" `"+p+"` of type "+("`"+g+"` supplied to `"+v+"`, expected an object."));for(var C in y)if(d(y,C)){var T=t(y,C,v,R,p+"."+C,I);if(T instanceof Error)return T}return null}return V(i)}function ie(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&f("Invalid argument supplied to oneOfType, expected an instance of array."),S;for(var i=0;i<t.length;i++){var m=t[i];if(typeof m!="function")return f("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ae(m)+" at index "+i+"."),S}function h(v,R,p,y,g){for(var C=[],T=0;T<t.length;T++){var B=t[T],a=B(v,R,p,y,g,I);if(a==null)return null;a.data&&d(a.data,"expectedType")&&C.push(a.data.expectedType)}var X=C.length>0?", expected one of type ["+C.join(", ")+"]":"";return new M("Invalid "+y+" `"+g+"` supplied to "+("`"+p+"`"+X+"."))}return V(h)}function ye(){function t(i,m,h,v,R){return G(i[m])?null:new M("Invalid "+v+" `"+R+"` supplied to "+("`"+h+"`, expected a ReactNode."))}return V(t)}function ue(t,i,m,h,v){return new M((t||"React class")+": "+i+" type `"+m+"."+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+v+"`.")}function se(t){function i(m,h,v,R,p){var y=m[h],g=K(y);if(g!=="object")return new M("Invalid "+R+" `"+p+"` of type `"+g+"` "+("supplied to `"+v+"`, expected `object`."));for(var C in t){var T=t[C];if(typeof T!="function")return ue(v,R,p,C,Q(T));var B=T(y,C,v,R,p+"."+C,I);if(B)return B}return null}return V(i)}function H(t){function i(m,h,v,R,p){var y=m[h],g=K(y);if(g!=="object")return new M("Invalid "+R+" `"+p+"` of type `"+g+"` "+("supplied to `"+v+"`, expected `object`."));var C=D({},m[h],t);for(var T in C){var B=t[T];if(d(t,T)&&typeof B!="function")return ue(v,R,p,T,Q(B));if(!B)return new M("Invalid "+R+" `"+p+"` key `"+T+"` supplied to `"+v+"`.\nBad object: "+JSON.stringify(m[h],null," ")+`
|
|
46
|
-
Valid keys: `+JSON.stringify(Object.keys(t),null," "));var a=B(y,T,v,R,p+"."+T,I);if(a)return a}return null}return V(i)}function G(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(G);if(t===null||c(t))return!0;var i=E(t);if(i){var m=i.call(t),h;if(i!==t.entries){for(;!(h=m.next()).done;)if(!G(h.value))return!1}else for(;!(h=m.next()).done;){var v=h.value;if(v&&!G(v[1]))return!1}}else return!1;return!0;default:return!1}}function re(t,i){return t==="symbol"?!0:i?i["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&i instanceof Symbol:!1}function K(t){var i=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":re(i,t)?"symbol":i}function Q(t){if(typeof t>"u"||t===null)return""+t;var i=K(t);if(i==="object"){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return i}function ae(t){var i=Q(t);switch(i){case"array":case"object":return"an "+i;case"boolean":case"date":case"regexp":return"a "+i;default:return i}}function fe(t){return!t.constructor||!t.constructor.name?$:t.constructor.name}return F.checkPropTypes=w,F.resetWarningCache=w.resetWarningCache,F.PropTypes=F,F},Ae}var Ie,ir;function Wr(){if(ir)return Ie;ir=1;var u=De();function D(){}function I(){}return I.resetWarningCache=D,Ie=function(){function d(S,c,b,P,l,E){if(E!==u){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}}d.isRequired=d;function w(){return d}var f={array:d,bigint:d,bool:d,func:d,number:d,object:d,string:d,symbol:d,any:d,arrayOf:w,element:d,elementType:d,instanceOf:w,node:d,objectOf:w,oneOf:w,oneOfType:w,shape:w,exact:w,checkPropTypes:I,resetWarningCache:D};return f.PropTypes=f,f},Ie}if(process.env.NODE_ENV!=="production"){var qr=sr(),Lr=!0;ke.exports=Yr()(qr.isElement,Lr)}else ke.exports=Wr()();var Ur=ke.exports;const ne=jr(Ur),Me=({type:u,variant:D,disabled:I,className:d,handleClick:w,label:f,children:S})=>{const c={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",danger:"bg-red-500 text-white",outline:""};return $r.jsx("button",{disabled:I,type:u,onClick:w,className:`rounded px-6 py-2 text-base font-normal ${c[D]} ${d}`,"aria-label":f,children:S})};Me.propTypes={type:ne.oneOf(["button","submit"]).isRequired,variant:ne.oneOf(["primary","secondary","danger"]).isRequired,disabled:ne.bool,className:ne.string,handleClick:ne.func,autoFocus:ne.bool,loading:ne.bool,label:ne.string.isRequired,children:ne.node.isRequired};Me.defaultProps={type:"button",variant:"primary",disabled:!1,className:""};exports.Button=Me;
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function he(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Qe(r);if(ye[t])return;ye[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+y(e._owner.type)+"."),P(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),P(null)}}function Ee(e,r){{if(typeof e!="object")return;if(q(e))for(var t=0;t<e.length;t++){var n=e[t];K(n)&&he(n,r)}else if(K(e))e._store&&(e._store.validated=!0);else if(e){var i=we(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)K(o.value)&&he(o.value,r)}}}function er(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===g))t=r.propTypes;else return;if(t){var n=y(r);Le(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var i=y(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function rr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){P(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),P(null);break}}e.ref!==null&&(P(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),P(null))}}function me(e,r,t,n,i,u){{var o=Fe(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=Ze(i);d?a+=d:a+=ge();var s;e===null?s="null":q(e)?s="array":e!==void 0&&e.$$typeof===m?(s="<"+(y(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=Xe(e,r,t,i,u);if(l==null)return l;if(o){var p=r.children;if(p!==void 0)if(n)if(q(p)){for(var x=0;x<p.length;x++)Ee(p[x],e);Object.freeze&&Object.freeze(p)}else c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ee(p,e)}return e===E?rr(l):er(l),l}}function tr(e,r,t){return me(e,r,t,!0)}function nr(e,r,t){return me(e,r,t,!1)}var ar=nr,or=tr;I.Fragment=E,I.jsx=ar,I.jsxs=or}()),I}process.env.NODE_ENV==="production"?H.exports=ir():H.exports=ur();var sr=H.exports;const lr=({type:j="button",variant:m="primary",disabled:k=!1,className:E="",handleClick:O,label:C="",children:_})=>{const b={primary:"bg-acuity-blue text-neutrals-white",secondary:"bg-neutrals text-neutrals-white",danger:"bg-acuity-red text-neutrals-white",outline:""};return sr.jsx("button",{disabled:k,type:j,onClick:O,className:`rounded px-6 py-2 text-base font-normal ${b[m]} ${E}`,"aria-label":C,children:_})};exports.Button=lr;
|
|
47
28
|
//# sourceMappingURL=index.cjs.js.map
|