@hardwork-med/hwm-web-ds 0.0.6 → 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/README.md CHANGED
@@ -23,7 +23,7 @@ Crie ou edite o arquivo **`.npmrc`** no seu projeto:
23
23
 
24
24
  ```bash
25
25
  # npm
26
- npm i @hardwork-med/hwm-web-ds @awesome.me/kit-a7702856b7 @fortawesome/fontawesome-svg-core @fortawesome/react-fontawesome framer-motion
26
+ npm i @hardwork-med/hwm-web-ds '@awesome.me/kit-a7702856b7' @fortawesome/fontawesome-svg-core @fortawesome/react-fontawesome framer-motion clsx
27
27
  ```
28
28
 
29
29
  ### 🔑 Usando **YARN** (recomendado: Yarn Berry v2+)
@@ -59,19 +59,13 @@ Se estiver usando o Yarn v1, além do `.yarnrc.yml` acima, crie também o arquiv
59
59
 
60
60
  ```bash
61
61
  # yarn
62
- yarn add @hardwork-med/hwm-web-ds @awesome.me/kit-a7702856b7 @fortawesome/fontawesome-svg-core @fortawesome/react-fontawesome framer-motion
62
+ yarn add @hardwork-med/hwm-web-ds '@awesome.me/kit-a7702856b7' @fortawesome/fontawesome-svg-core @fortawesome/react-fontawesome framer-motion clsx
63
63
  ```
64
64
 
65
65
  ---
66
66
 
67
67
  ## 🚀 Uso
68
68
 
69
- Antes de utilizar qualquer componente da biblioteca, **importe o CSS global da lib no ponto mais alto da sua aplicação** (como `src/index.tsx` ou `src/layout.tsx`):
70
-
71
- ```tsx
72
- import '@hardwork-med/hwm-web-ds/dist/index.css'
73
- ```
74
-
75
69
  Exemplo com o componente `Icon`:
76
70
 
77
71
  ```tsx
@@ -0,0 +1,10 @@
1
+ export type TBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
+ export default function useAppBreakpoint(): {
3
+ xl: boolean;
4
+ lg: boolean;
5
+ md: boolean;
6
+ sm: boolean;
7
+ xs: boolean;
8
+ breakpoint: TBreakpoint;
9
+ size: number;
10
+ };
@@ -0,0 +1 @@
1
+ export default function useOutsideClick(ref: React.RefObject<HTMLElement | null>, callback: (open: boolean) => void, excludeIds?: string[]): void;
package/dist/index.d.ts CHANGED
@@ -54,5 +54,75 @@ interface IconProps extends FontAwesomeIconProps {
54
54
 
55
55
  declare function Icon({ fontSize, duotone, duotoneColor, primaryOpacity, secondaryOpacity, ...props }: IconProps): react_jsx_runtime.JSX.Element;
56
56
 
57
- export { Icon };
58
- export type { IconProps };
57
+ interface QuestaoTagProps {
58
+ /**
59
+ * Ícone do FontAwesome a ser exibido na tag.
60
+ */
61
+ icon: IconDefinition
62
+
63
+ /**
64
+ * Texto a ser exibido ao lado do ícone.
65
+ */
66
+ label?: string
67
+
68
+ /**
69
+ * Status da questão, que pode ser `certo`, `errado` ou `parcial`. Este status é utilizado para determinar as cores do ícone e do texto da tag.
70
+ */
71
+ status?: 'certo' | 'errado' | 'parcial'
72
+ }
73
+
74
+ declare function QuestaoTag({ icon, label, status }: QuestaoTagProps): react_jsx_runtime.JSX.Element;
75
+
76
+ declare function QuestaoLayoutGrid({ children }: {
77
+ children?: React.ReactNode;
78
+ }): react_jsx_runtime.JSX.Element;
79
+
80
+ declare function QuestaoLayoutTags({ children }: {
81
+ children?: React.ReactNode;
82
+ }): react_jsx_runtime.JSX.Element;
83
+
84
+ declare function QuestaoLayoutMainContent({ children }: {
85
+ children?: React.ReactNode;
86
+ }): react_jsx_runtime.JSX.Element;
87
+
88
+ declare function QuestaoLayoutAlternativas({ children }: {
89
+ children?: React.ReactNode;
90
+ }): react_jsx_runtime.JSX.Element;
91
+
92
+ /**
93
+ * Componente Questao
94
+ *
95
+ * Este componente serve como namespace para todos os sub-componentes relacionados a uma questão.
96
+ */
97
+ declare const Questao: {
98
+ Tag: typeof QuestaoTag;
99
+ Layout: {
100
+ Grid: typeof QuestaoLayoutGrid;
101
+ MainContent: typeof QuestaoLayoutMainContent;
102
+ Tags: typeof QuestaoLayoutTags;
103
+ Alternativas: typeof QuestaoLayoutAlternativas;
104
+ };
105
+ };
106
+
107
+ declare function useOutsideClick(ref: React.RefObject<HTMLElement | null>, callback: (open: boolean) => void, excludeIds?: string[]): void;
108
+
109
+ type TBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
110
+ declare function useAppBreakpoint(): {
111
+ xl: boolean;
112
+ lg: boolean;
113
+ md: boolean;
114
+ sm: boolean;
115
+ xs: boolean;
116
+ breakpoint: TBreakpoint;
117
+ size: number;
118
+ };
119
+
120
+ declare function formatPosition(position: string): string;
121
+
122
+ declare function checkEnunciadoUnderline(enunciado: string): {
123
+ enunciado1: string;
124
+ enunciado2: string;
125
+ } | null;
126
+
127
+ export { Icon, Questao, checkEnunciadoUnderline, formatPosition, useAppBreakpoint, useOutsideClick };
128
+ export type { IconProps, TBreakpoint };
package/dist/index.esm.js CHANGED
@@ -1,6 +1,8 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
3
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { useState, useEffect } from 'react';
5
+ import { isBrowser } from 'framer-motion';
4
6
 
5
7
  function styleInject(css, ref) {
6
8
  if ( ref === void 0 ) ref = {};
@@ -29,23 +31,148 @@ function styleInject(css, ref) {
29
31
  }
30
32
  }
31
33
 
32
- var css_248z = "/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--tw-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--tw-default-transition-duration:150ms;--tw-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--tw-default-font-family:var(--tw-font-sans);--tw-default-mono-font-family:var(--tw-font-mono)}}@layer base{*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:var(--tw-default-font-feature-settings,normal);-webkit-tap-highlight-color:transparent;font-family:var(--tw-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-variation-settings:var(--tw-default-font-variation-settings,normal);line-height:1.5;tab-size:4}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:var(--tw-default-mono-font-feature-settings,normal);font-family:var(--tw-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-size:1em;font-variation-settings:var(--tw-default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::file-selector-button,button,input,optgroup,select,textarea{font-feature-settings:inherit;background-color:transparent;border-radius:0;color:inherit;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::placeholder{color:currentcolor;@supports (color:color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}::file-selector-button,button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.tw\\:transition-all{transition-duration:var(--tw-duration,var(--tw-default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--tw-default-transition-timing-function))}}@layer utilities{.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}}[data-theme-area=CM]{--color-theme-area-base:var(--color-area-cm)}[data-theme-area=CG]{--color-theme-area-base:var(--color-area-cg)}[data-theme-area=GO]{--color-theme-area-base:var(--color-area-go)}[data-theme-area=PD]{--color-theme-area-base:var(--color-area-pd)}[data-theme-area=MP]{--color-theme-area-base:var(--color-area-mp)}.default-click-animation{cursor:pointer;transition-duration:var(--tw-duration,var(--tw-default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--tw-default-transition-timing-function));&:hover{@media (hover:hover){--tw-scale-x:98%;--tw-scale-y:98%;--tw-scale-z:98%;scale:var(--tw-scale-x) var(--tw-scale-y)}}&:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@keyframes progressSuccess{0%{width:0}to{width:100%}}@layer base{*{scrollbar-color:auto;scrollbar-width:auto}}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}";
34
+ var css_248z = "/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";--tw-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;--tw-color-green-500:oklch(72.3% 0.219 149.579);--tw-spacing:0.25rem;--tw-text-xs:0.75rem;--tw-text-xs--line-height:1.33333;--tw-text-sm:0.875rem;--tw-text-sm--line-height:1.42857;--tw-text-2xl:1.5rem;--tw-text-2xl--line-height:1.33333;--tw-font-weight-bold:700;--tw-radius-lg:0.5rem;--tw-default-transition-duration:150ms;--tw-default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--tw-default-font-family:var(--tw-font-sans);--tw-default-mono-font-family:var(--tw-font-mono)}}@layer base{*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:var(--tw-default-font-feature-settings,normal);-webkit-tap-highlight-color:transparent;font-family:var(--tw-default-font-family,ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\");font-variation-settings:var(--tw-default-font-variation-settings,normal);line-height:1.5;tab-size:4}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:var(--tw-default-mono-font-feature-settings,normal);font-family:var(--tw-default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace);font-size:1em;font-variation-settings:var(--tw-default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::file-selector-button,button,input,optgroup,select,textarea{font-feature-settings:inherit;background-color:transparent;border-radius:0;color:inherit;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::placeholder{color:currentcolor;@supports (color:color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}::file-selector-button,button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.tw\\:absolute{position:absolute}.tw\\:relative{position:relative}.tw\\:-top-1\\.5{top:calc(var(--tw-spacing)*-1.5)}.tw\\:-right-1\\.5{right:calc(var(--tw-spacing)*-1.5)}.tw\\:flex{display:flex}.tw\\:size-5{height:calc(var(--tw-spacing)*5);width:calc(var(--tw-spacing)*5)}.tw\\:h-7{height:calc(var(--tw-spacing)*7)}.tw\\:min-h-14{min-height:calc(var(--tw-spacing)*14)}.tw\\:w-full{width:100%}.tw\\:items-center{align-items:center}.tw\\:justify-center{justify-content:center}.tw\\:gap-1{gap:calc(var(--tw-spacing)*1)}.tw\\:gap-4{gap:calc(var(--tw-spacing)*4)}.tw\\:rounded-full{border-radius:calc(infinity * 1px)}.tw\\:rounded-lg{border-radius:var(--tw-radius-lg)}.tw\\:border{border-style:var(--tw-border-style);border-width:1px}.tw\\:border-certo{border-color:#26b079}.tw\\:border-errado{border-color:#e14942}.tw\\:bg-cinza-500{background-color:#ccc}.tw\\:bg-cinza-1000{background-color:#303030}.tw\\:bg-cinza-1100{background-color:#1d1d1d}.tw\\:bg-primario-20{background-color:#333}.tw\\:bg-secundario-85{background-color:#d9d9d9}.tw\\:bg-secundario-95{background-color:#f2f2f2}.tw\\:px-2{padding-inline:calc(var(--tw-spacing)*2)}.tw\\:px-4{padding-inline:calc(var(--tw-spacing)*4)}.tw\\:py-3{padding-block:calc(var(--tw-spacing)*3)}.tw\\:text-left{text-align:left}.tw\\:text-2xl{font-size:var(--tw-text-2xl);line-height:var(--tw-leading,var(--tw-text-2xl--line-height))}.tw\\:text-sm{font-size:var(--tw-text-sm);line-height:var(--tw-leading,var(--tw-text-sm--line-height))}.tw\\:text-xs{font-size:var(--tw-text-xs);line-height:var(--tw-leading,var(--tw-text-xs--line-height))}.tw\\:leading-full{--tw-leading:100%;line-height:100%}.tw\\:font-bold{--tw-font-weight:var(--tw-font-weight-bold);font-weight:var(--tw-font-weight-bold)}.tw\\:whitespace-pre-wrap{white-space:pre-wrap}.tw\\:text-certo{color:#26b079}.tw\\:text-cinza-100{color:#fcfcfc}.tw\\:text-cinza-900{color:#656565}.tw\\:text-cinza-1000{color:#303030}.tw\\:text-errado{color:#e14942}.tw\\:text-green-500{color:var(--tw-color-green-500)}.tw\\:text-parcial{color:#e1c942}.tw\\:text-primario-20{color:#333}.tw\\:text-primario-80{color:#ccc}.tw\\:line-through{text-decoration-line:line-through}.tw\\:decoration-2{text-decoration-thickness:2px}.tw\\:opacity-50{opacity:50%}.tw\\:transition-colors{transition-duration:var(--tw-duration,var(--tw-default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--tw-default-transition-timing-function))}}@layer utilities{.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}}[data-theme-area=CM]{--color-theme-area-base:var(--color-area-cm)}[data-theme-area=CG]{--color-theme-area-base:var(--color-area-cg)}[data-theme-area=GO]{--color-theme-area-base:var(--color-area-go)}[data-theme-area=PD]{--color-theme-area-base:var(--color-area-pd)}[data-theme-area=MP]{--color-theme-area-base:var(--color-area-mp)}.default-click-animation{cursor:pointer;transition-duration:var(--tw-duration,var(--tw-default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--tw-default-transition-timing-function));&:hover{@media (hover:hover){--tw-scale-x:98%;--tw-scale-y:98%;--tw-scale-z:98%;scale:var(--tw-scale-x) var(--tw-scale-y)}}&:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@keyframes progressSuccess{0%{width:0}to{width:100%}}@layer base{*{scrollbar-color:auto;scrollbar-width:auto}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-scale-x{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-y{syntax:\"*\";inherits:false;initial-value:1}@property --tw-scale-z{syntax:\"*\";inherits:false;initial-value:1}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}";
33
35
  styleInject(css_248z,{"insertAt":"top"});
34
36
 
35
37
  function Icon({ fontSize = 14, duotone = false, duotoneColor, primaryOpacity = 1, secondaryOpacity = 0.4, ...props }) {
36
- const defaultDuotoneColor = ['#fff', '#fff'];
37
38
  const styles = {
38
39
  ...props.style,
39
- fontSize,
40
40
  ...(duotone && {
41
- ['--fa-primary-color']: !!duotoneColor && !!duotoneColor[0] ? duotoneColor[0] : defaultDuotoneColor[0],
42
- ['--fa-secondary-color']: !!duotoneColor && !!duotoneColor[1] ? duotoneColor[1] : defaultDuotoneColor[1],
41
+ ['--fa-primary-color']: !!duotoneColor ? duotoneColor[0] : undefined,
42
+ ['--fa-secondary-color']: !!duotoneColor && duotoneColor[1] ? duotoneColor[1] : undefined,
43
43
  ['--fa-primary-opacity']: primaryOpacity,
44
44
  ['--fa-secondary-opacity']: secondaryOpacity
45
45
  })
46
46
  };
47
- return (jsx(FontAwesomeIcon, { ...props, style: styles, className: clsx(props.className, 'tw:transition-all') }));
47
+ return (jsx(FontAwesomeIcon, { ...props, fontSize: fontSize, style: styles, className: clsx(props.className, 'tw:transition-colors') }));
48
48
  }
49
49
 
50
- export { Icon };
50
+ function QuestaoTag({ icon, label, status }) {
51
+ return (jsx(Fragment, { children: jsxs("div", { className: clsx('tw:flex tw:items-center tw:gap-1 tw:h-7 tw:px-2'), children: [jsx(Icon, { icon: icon, fontSize: 12, className: clsx(status === 'certo' && 'tw:text-certo', status === 'errado' && 'tw:text-errado', status === 'parcial' && 'tw:text-parcial', !status && 'tw:text-primario-20') }), !!label && (jsx("p", { className: clsx('tw:transition-colors', 'tw:text-xs tw:leading-full', status === 'certo' && 'tw:text-certo', status === 'errado' && 'tw:text-errado', status === 'parcial' && 'tw:text-parcial', !status && 'tw:text-primario-20'), children: label }))] }) }));
52
+ }
53
+
54
+ function useAppBreakpoint() {
55
+ const [size, setSize] = useState(0);
56
+ const [breakpoint, setBreakpoint] = useState('sm');
57
+ const [breakpoints, setBreakpoints] = useState({
58
+ xl: false,
59
+ lg: false,
60
+ md: false,
61
+ sm: false,
62
+ xs: true
63
+ });
64
+ const getBreakpoint = (width) => {
65
+ if (width >= 1280)
66
+ return 'xl';
67
+ if (width >= 1024)
68
+ return 'lg';
69
+ if (width >= 768)
70
+ return 'md';
71
+ if (width >= 640)
72
+ return 'sm';
73
+ return 'xs';
74
+ };
75
+ const updateBreakpoints = (width) => {
76
+ setBreakpoints({
77
+ xl: width >= 1280,
78
+ lg: width >= 1024,
79
+ md: width >= 768,
80
+ sm: width >= 640,
81
+ xs: width > 0
82
+ });
83
+ };
84
+ useEffect(() => {
85
+ if (!isBrowser)
86
+ return;
87
+ const handleResize = () => {
88
+ const width = window.innerWidth;
89
+ setSize(width);
90
+ setBreakpoint(getBreakpoint(width));
91
+ updateBreakpoints(width);
92
+ };
93
+ handleResize();
94
+ window.addEventListener('resize', handleResize);
95
+ return () => window.removeEventListener('resize', handleResize);
96
+ }, []);
97
+ return {
98
+ breakpoint,
99
+ size,
100
+ ...breakpoints
101
+ };
102
+ }
103
+
104
+ function QuestaoLayoutGrid({ children }) {
105
+ const { lg } = useAppBreakpoint();
106
+ return (jsx(Fragment, { children: jsx("div", { className: clsx('flex gap-10 w-full max-w-7xl mx-auto', (lg) ? 'flex-row' : 'flex-col'), children: children }) }));
107
+ }
108
+
109
+ function QuestaoLayoutTags({ children }) {
110
+ return (jsx(Fragment, { children: jsx("div", { className: clsx('flex flex-row gap-4 w-full'), children: children }) }));
111
+ }
112
+
113
+ function QuestaoLayoutMainContent({ children }) {
114
+ return (jsx(Fragment, { children: jsx("div", { className: clsx('flex flex-col w-full'), children: children }) }));
115
+ }
116
+
117
+ function QuestaoLayoutAlternativas({ children }) {
118
+ return (jsx(Fragment, { children: jsx("div", { className: clsx('flex flex-col gap-3 w-full'), children: children }) }));
119
+ }
120
+
121
+ /**
122
+ * Componente Questao
123
+ *
124
+ * Este componente serve como namespace para todos os sub-componentes relacionados a uma questão.
125
+ */
126
+ const Questao = {
127
+ Tag: QuestaoTag,
128
+ Layout: {
129
+ Grid: QuestaoLayoutGrid,
130
+ MainContent: QuestaoLayoutMainContent,
131
+ Tags: QuestaoLayoutTags,
132
+ Alternativas: QuestaoLayoutAlternativas,
133
+ }
134
+ };
135
+
136
+ function useOutsideClick(ref, callback, excludeIds = []) {
137
+ useEffect(() => {
138
+ function handleClickOutside(event) {
139
+ if (!!ref && !!ref.current && !ref.current.contains(event.target)) {
140
+ const target = event.target;
141
+ const isExcluded = excludeIds.some((id) => target.id === id || target.closest(`#${id}`));
142
+ if (!isExcluded)
143
+ callback(false);
144
+ }
145
+ }
146
+ document.addEventListener('mousedown', handleClickOutside);
147
+ return () => {
148
+ document.removeEventListener('mousedown', handleClickOutside);
149
+ };
150
+ }, [ref, callback]);
151
+ }
152
+
153
+ function formatPosition(position) {
154
+ if (/[a-zA-Z]/.test(position)) {
155
+ return position.toUpperCase();
156
+ }
157
+ const numeric = Number(position);
158
+ if (Number.isNaN(numeric) || numeric <= 0) {
159
+ return position;
160
+ }
161
+ const charCode = 64 + numeric;
162
+ if (charCode < 65 || charCode > 90) {
163
+ return position;
164
+ }
165
+ return String.fromCharCode(charCode);
166
+ }
167
+
168
+ function checkEnunciadoUnderline(enunciado) {
169
+ const regex = /_+/;
170
+ const checkEspaco = regex.test(enunciado);
171
+ if (!checkEspaco)
172
+ return null;
173
+ const [enunciado1, enunciado2] = enunciado.split(regex);
174
+ return { enunciado1, enunciado2 };
175
+ }
176
+
177
+ export { Icon, Questao, checkEnunciadoUnderline, formatPosition, useAppBreakpoint, useOutsideClick };
51
178
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/common/Icon/Icon.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import clsx from 'clsx'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport type { IconProps } from './Icon.types'\n\nexport default function Icon({\n fontSize = 14,\n duotone = false,\n duotoneColor,\n primaryOpacity = 1,\n secondaryOpacity = 0.4,\n ...props\n}: IconProps) {\n const defaultDuotoneColor = ['#fff', '#fff']\n\n const styles = {\n ...props.style,\n fontSize,\n ...(duotone && {\n ['--fa-primary-color' as any]: !!duotoneColor && !!duotoneColor[0] ? duotoneColor[0] : defaultDuotoneColor[0],\n ['--fa-secondary-color' as any]: !!duotoneColor && !!duotoneColor[1] ? duotoneColor[1] : defaultDuotoneColor[1],\n ['--fa-primary-opacity' as any]: primaryOpacity,\n ['--fa-secondary-opacity' as any]: secondaryOpacity\n })\n }\n\n return (\n <FontAwesomeIcon\n {...props}\n style={styles}\n className={clsx(props.className, 'tw:transition-all')}\n />\n )\n}\n"],"names":["_jsx"],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE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BAA2B,GAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC;YAC7G,CAAC,sBAA6B,GAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC;YAC/G,CAAC,sBAA6B,GAAG,cAAc;YAC/C,CAAC,wBAA+B,GAAG;SACtC;KACJ;IAED,QACIA,IAAC,eAAe,EAAA,EAAA,GACR,KAAK,EACT,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAA,CACvD;AAEV;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/components/common/Icon/Icon.tsx","../src/modules/questao/components/common/Tag/Tag.tsx","../src/hooks/useAppBreakpoint/index.ts","../src/modules/questao/components/layout/Grid/index.tsx","../src/modules/questao/components/layout/Tags/index.tsx","../src/modules/questao/components/layout/MainContent/index.tsx","../src/modules/questao/components/layout/Alternativas/index.tsx","../src/modules/questao/index.ts","../src/hooks/useOutsideClick/index.ts","../src/utils/formatPosition/index.ts","../src/utils/checkEnunciadoUnderline/index.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import clsx from 'clsx'\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\nimport type { IconProps } from './Icon.types'\n\nexport default function Icon({\n fontSize = 14,\n duotone = false,\n duotoneColor,\n primaryOpacity = 1,\n secondaryOpacity = 0.4,\n ...props\n}: IconProps) {\n\n const styles = {\n ...props.style,\n ...(duotone && {\n ['--fa-primary-color' as any]: !!duotoneColor ? duotoneColor[0] : undefined,\n ['--fa-secondary-color' as any]: !!duotoneColor && duotoneColor[1] ? duotoneColor[1] : undefined,\n ['--fa-primary-opacity' as any]: primaryOpacity,\n ['--fa-secondary-opacity' as any]: secondaryOpacity\n })\n }\n\n return (\n <FontAwesomeIcon\n {...props}\n fontSize={fontSize}\n style={styles}\n className={clsx(\n props.className,\n 'tw:transition-colors'\n )}\n />\n )\n}\n","import clsx from 'clsx'\nimport Icon from '@/components/common/Icon'\nimport type { QuestaoTagProps } from './Tag.types'\n\nexport default function QuestaoTag({ icon, label, status }: QuestaoTagProps) {\n\n return(\n\n <>\n <div className={clsx('tw:flex tw:items-center tw:gap-1 tw:h-7 tw:px-2')}>\n <Icon\n icon={icon}\n fontSize={12}\n className={clsx(\n status === 'certo' && 'tw:text-certo',\n status === 'errado' && 'tw:text-errado',\n status === 'parcial' && 'tw:text-parcial',\n !status && 'tw:text-primario-20'\n )}\n />\n\n {!!label && (\n <p\n className={clsx(\n 'tw:transition-colors',\n 'tw:text-xs tw:leading-full',\n status === 'certo' && 'tw:text-certo',\n status === 'errado' && 'tw:text-errado',\n status === 'parcial' && 'tw:text-parcial',\n !status && 'tw:text-primario-20'\n )}\n >\n {label}\n </p>\n )}\n </div>\n </>\n\n )\n\n}\n","import { useEffect, useState } from 'react'\nimport { isBrowser } from 'framer-motion'\n\nexport type TBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\nexport default function useAppBreakpoint() {\n const [size, setSize] = useState(0)\n const [breakpoint, setBreakpoint] = useState<TBreakpoint>('sm')\n const [breakpoints, setBreakpoints] = useState({\n xl: false,\n lg: false,\n md: false,\n sm: false,\n xs: true\n })\n\n const getBreakpoint = (width: number): TBreakpoint => {\n if (width >= 1280) return 'xl'\n if (width >= 1024) return 'lg'\n if (width >= 768) return 'md'\n if (width >= 640) return 'sm'\n return 'xs'\n }\n\n const updateBreakpoints = (width: number) => {\n setBreakpoints({\n xl: width >= 1280,\n lg: width >= 1024,\n md: width >= 768,\n sm: width >= 640,\n xs: width > 0\n })\n }\n\n useEffect(() => {\n if (!isBrowser) return\n\n const handleResize = () => {\n const width = window.innerWidth\n\n setSize(width)\n setBreakpoint(getBreakpoint(width))\n updateBreakpoints(width)\n }\n\n handleResize()\n\n window.addEventListener('resize', handleResize)\n\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n\n return {\n breakpoint,\n size,\n ...breakpoints\n }\n}\n","import clsx from 'clsx'\nimport useAppBreakpoint from '@/hooks/useAppBreakpoint'\n\nexport default function QuestaoLayoutGrid({ children }: { children?: React.ReactNode }) {\n\n const { lg } = useAppBreakpoint()\n\n return(\n\n <>\n <div\n className={clsx(\n 'flex gap-10 w-full max-w-7xl mx-auto',\n (lg) ? 'flex-row' : 'flex-col'\n )}\n >\n {children}\n </div>\n </>\n\n )\n\n}\n","import clsx from 'clsx'\n\nexport default function QuestaoLayoutTags({ children }: { children?: React.ReactNode }) {\n\n return(\n\n <>\n <div className={clsx('flex flex-row gap-4 w-full')}>\n {children}\n </div>\n </>\n\n )\n\n}\n","import clsx from 'clsx'\n\nexport default function QuestaoLayoutMainContent({ children }: { children?: React.ReactNode }) {\n\n return(\n\n <>\n <div className={clsx('flex flex-col w-full')}>\n {children}\n </div>\n </>\n\n )\n\n}\n","import clsx from 'clsx'\n\nexport default function QuestaoLayoutAlternativas({ children }: { children?: React.ReactNode }) {\n\n return(\n\n <>\n <div className={clsx('flex flex-col gap-3 w-full')}>\n {children}\n </div>\n </>\n\n )\n\n}\n","import QuestaoTag from './components/common/Tag'\nimport QuestaoLayoutGrid from './components/layout/Grid'\nimport QuestaoLayoutTags from './components/layout/Tags'\nimport QuestaoLayoutMainContent from './components/layout/MainContent'\nimport QuestaoLayoutAlternativas from './components/layout/Alternativas'\n\n/**\n * Componente Questao\n * \n * Este componente serve como namespace para todos os sub-componentes relacionados a uma questão.\n */\nconst Questao = {\n Tag: QuestaoTag,\n Layout: {\n Grid: QuestaoLayoutGrid,\n MainContent: QuestaoLayoutMainContent,\n Tags: QuestaoLayoutTags,\n Alternativas: QuestaoLayoutAlternativas,\n }\n}\n\nexport default Questao","import { useEffect } from 'react'\n\nexport default function useOutsideClick(\n ref: React.RefObject<HTMLElement | null>,\n callback: (open: boolean) => void,\n excludeIds: string[] = []\n) {\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (!!ref && !!ref.current && !ref.current.contains(event.target as Node)) {\n const target = event.target as HTMLElement\n const isExcluded = excludeIds.some(\n (id) => target.id === id || target.closest(`#${id}`)\n )\n\n if (!isExcluded) callback(false)\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [ref, callback])\n}\n","export default function formatPosition(position: string) {\n\tif(/[a-zA-Z]/.test(position)) {\n\t\treturn position.toUpperCase()\n\t}\n\n\tconst numeric = Number(position)\n\tif (Number.isNaN(numeric) || numeric <= 0) {\n\t\treturn position\n\t}\n\n\tconst charCode = 64 + numeric\n\tif (charCode < 65 || charCode > 90) {\n\t\treturn position\n\t}\n\n\treturn String.fromCharCode(charCode)\n}","export default function checkEnunciadoUnderline(enunciado: string){\n const regex = /_+/\n const checkEspaco = regex.test(enunciado)\n\n if(!checkEspaco) return null\n\n const [enunciado1, enunciado2] = enunciado.split(regex)\n\n return { enunciado1, enunciado2 }\n}"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,E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,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC;IAChC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE;AAC1C,QAAA,OAAO,QAAQ;IAChB;AAEA,IAAA,MAAM,QAAQ,GAAG,EAAE,GAAG,OAAO;IAC7B,IAAI,QAAQ,GAAG,EAAE,IAAI,QAAQ,GAAG,EAAE,EAAE;AACnC,QAAA,OAAO,QAAQ;IAChB;AAEA,IAAA,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;AACrC;;AChBc,SAAU,uBAAuB,CAAC,SAAiB,EAAA;IAC7D,MAAM,KAAK,GAAG,IAAI;IAClB,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;AAEzC,IAAA,IAAG,CAAC,WAAW;AAAE,QAAA,OAAO,IAAI;AAE5B,IAAA,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;AAEvD,IAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE;AACrC;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ export type TProva = 'REVALIDA' | 'R1'
@@ -0,0 +1,2 @@
1
+ import type { QuestaoAlternativaProps } from './Alternativa.types';
2
+ export default function QuestaoAlternativa({ position, text, selected, correct, answered, showAnswer, cancelled, percentage, onClick }: QuestaoAlternativaProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export interface QuestaoAlternativaProps {
2
+ position?: string
3
+ text: string
4
+ selected: boolean
5
+ correct: boolean
6
+ answered: boolean
7
+ showAnswer?: boolean
8
+ cancelled?: boolean
9
+ percentage?: string | number
10
+ onClick: React.MouseEventHandler<HTMLButtonElement>
11
+ }
@@ -0,0 +1,2 @@
1
+ import type { QuestaoTagProps } from './Tag.types';
2
+ export default function QuestaoTag({ icon, label, status }: QuestaoTagProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { IconDefinition } from "@fortawesome/fontawesome-svg-core"
2
+
3
+ export interface QuestaoTagProps {
4
+ /**
5
+ * Ícone do FontAwesome a ser exibido na tag.
6
+ */
7
+ icon: IconDefinition
8
+
9
+ /**
10
+ * Texto a ser exibido ao lado do ícone.
11
+ */
12
+ label?: string
13
+
14
+ /**
15
+ * Status da questão, que pode ser `certo`, `errado` ou `parcial`. Este status é utilizado para determinar as cores do ícone e do texto da tag.
16
+ */
17
+ status?: 'certo' | 'errado' | 'parcial'
18
+ }
@@ -0,0 +1 @@
1
+ export { default } from './Tag';
@@ -0,0 +1,3 @@
1
+ export default function QuestaoLayoutAlternativas({ children }: {
2
+ children?: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function QuestaoLayoutGrid({ children }: {
2
+ children?: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function QuestaoLayoutMainContent({ children }: {
2
+ children?: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function QuestaoLayoutTags({ children }: {
2
+ children?: React.ReactNode;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import QuestaoTag from './components/common/Tag';
2
+ import QuestaoLayoutGrid from './components/layout/Grid';
3
+ import QuestaoLayoutTags from './components/layout/Tags';
4
+ import QuestaoLayoutMainContent from './components/layout/MainContent';
5
+ import QuestaoLayoutAlternativas from './components/layout/Alternativas';
6
+ /**
7
+ * Componente Questao
8
+ *
9
+ * Este componente serve como namespace para todos os sub-componentes relacionados a uma questão.
10
+ */
11
+ declare const Questao: {
12
+ Tag: typeof QuestaoTag;
13
+ Layout: {
14
+ Grid: typeof QuestaoLayoutGrid;
15
+ MainContent: typeof QuestaoLayoutMainContent;
16
+ Tags: typeof QuestaoLayoutTags;
17
+ Alternativas: typeof QuestaoLayoutAlternativas;
18
+ };
19
+ };
20
+ export default Questao;
@@ -0,0 +1,27 @@
1
+ import type { TProva } from '@/interfaces/TProva';
2
+ interface WebDsState {
3
+ themeProva: TProva | null;
4
+ setThemeProva: (value: TProva | null) => void;
5
+ darkMode: boolean;
6
+ setDarkMode: (value: boolean) => void;
7
+ toggleDarkMode: () => void;
8
+ questionDarkMode: boolean;
9
+ setQuestionDarkMode: (value: boolean) => void;
10
+ toggleQuestionDarkMode: () => void;
11
+ questionRowGridView: boolean;
12
+ toggleQuestionRowGridView: () => void;
13
+ }
14
+ declare const useWebDsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WebDsState>, "setState" | "persist"> & {
15
+ setState(partial: WebDsState | Partial<WebDsState> | ((state: WebDsState) => WebDsState | Partial<WebDsState>), replace?: false | undefined): unknown;
16
+ setState(state: WebDsState | ((state: WebDsState) => WebDsState), replace: true): unknown;
17
+ persist: {
18
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WebDsState, WebDsState, unknown>>) => void;
19
+ clearStorage: () => void;
20
+ rehydrate: () => Promise<void> | void;
21
+ hasHydrated: () => boolean;
22
+ onHydrate: (fn: (state: WebDsState) => void) => () => void;
23
+ onFinishHydration: (fn: (state: WebDsState) => void) => () => void;
24
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<WebDsState, WebDsState, unknown>>;
25
+ };
26
+ }>;
27
+ export default useWebDsStore;
@@ -0,0 +1,4 @@
1
+ export default function checkEnunciadoUnderline(enunciado: string): {
2
+ enunciado1: string;
3
+ enunciado2: string;
4
+ } | null;
@@ -0,0 +1 @@
1
+ export default function formatPosition(position: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardwork-med/hwm-web-ds",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "Design System do Hardwork Medicina, para aplicações Web",
5
5
  "homepage": "https://github.com/HardworkMedicina/hwm-web-ds#readme",
6
6
  "bugs": {
@@ -45,7 +45,8 @@
45
45
  "clsx": ">=2",
46
46
  "framer-motion": ">=12",
47
47
  "react": ">=18",
48
- "react-dom": ">=18"
48
+ "react-dom": ">=18",
49
+ "zustand": ">=5"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@babel/core": "^7.23.0",
@@ -53,7 +54,6 @@
53
54
  "@babel/preset-react": "^7.22.0",
54
55
  "@babel/preset-typescript": "^7.23.0",
55
56
  "@chromatic-com/storybook": "^1.0.0",
56
- "chromatic": "^15.2.0",
57
57
  "@commitlint/cli": "^20.4.3",
58
58
  "@commitlint/config-conventional": "^20.4.3",
59
59
  "@rollup/plugin-commonjs": "^25.0.0",
@@ -75,6 +75,7 @@
75
75
  "@types/react-dom": "^18.2.0",
76
76
  "autoprefixer": "^10.4.0",
77
77
  "babel-jest": "^29.7.0",
78
+ "chromatic": "^15.2.0",
78
79
  "husky": "^9.1.7",
79
80
  "identity-obj-proxy": "^3.0.0",
80
81
  "jest": "^29.7.0",