blockforce-design-system 2.0.3 → 2.0.4
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/MIGRATION.md +23 -19
- package/lib/ai/components.json +106 -1
- package/lib/ai/tokens.md +1 -1
- package/lib/commonjs/components/data-display/calendar/calendar.styles.js +14 -13
- package/lib/commonjs/components/data-display/calendar/calendar.styles.js.map +1 -1
- package/lib/commonjs/components/data-display/matrix/matrix.styles.js +22 -21
- package/lib/commonjs/components/data-display/matrix/matrix.styles.js.map +1 -1
- package/lib/commonjs/components/data-display/side-panel/side-panel.styles.js +11 -10
- package/lib/commonjs/components/data-display/side-panel/side-panel.styles.js.map +1 -1
- package/lib/commonjs/components/forms/autocomplete/autocomplete.styles.js +8 -21
- package/lib/commonjs/components/forms/autocomplete/autocomplete.styles.js.map +1 -1
- package/lib/commonjs/components/layout/drawer/drawer.styles.js +7 -5
- package/lib/commonjs/components/layout/drawer/drawer.styles.js.map +1 -1
- package/lib/commonjs/components/layout/modal/modal.styles.js +7 -18
- package/lib/commonjs/components/layout/modal/modal.styles.js.map +1 -1
- package/lib/commonjs/components/layout/popover/popover.styles.js +3 -2
- package/lib/commonjs/components/layout/popover/popover.styles.js.map +1 -1
- package/lib/commonjs/components/layout/slider/slider.styles.js +5 -26
- package/lib/commonjs/components/layout/slider/slider.styles.js.map +1 -1
- package/lib/commonjs/components/layout/table/table.comp.js +1 -1
- package/lib/commonjs/components/layout/table/table.comp.js.map +1 -1
- package/lib/commonjs/components/layout/table/table.styles.js +18 -17
- package/lib/commonjs/components/layout/table/table.styles.js.map +1 -1
- package/lib/commonjs/components/layout/table-head/table-head.comp.js +1 -1
- package/lib/commonjs/components/layout/table-head/table-head.comp.js.map +1 -1
- package/lib/commonjs/components/layout/table-head/table-head.styles.js +1 -1
- package/lib/commonjs/components/layout/table-head/table-head.styles.js.map +1 -1
- package/lib/commonjs/components/layout/table-row/table-row.comp.js +1 -1
- package/lib/commonjs/components/layout/table-row/table-row.comp.js.map +1 -1
- package/lib/commonjs/components/navigation/navigation-card/navigation-card.comp.js +2 -0
- package/lib/commonjs/components/navigation/navigation-card/navigation-card.comp.js.map +1 -0
- package/lib/commonjs/components/navigation/navigation-card/navigation-card.styles.js +47 -0
- package/lib/commonjs/components/navigation/navigation-card/navigation-card.styles.js.map +1 -0
- package/lib/commonjs/components/navigation/navigation-card/navigation-cards.comp.js +2 -0
- package/lib/commonjs/components/navigation/navigation-card/navigation-cards.comp.js.map +1 -0
- package/lib/commonjs/components/navigation/navigation-sections/navigation-sections.comp.js +2 -0
- package/lib/commonjs/components/navigation/navigation-sections/navigation-sections.comp.js.map +1 -0
- package/lib/commonjs/components/navigation/navigation-sections/navigation-sections.styles.js +91 -0
- package/lib/commonjs/components/navigation/navigation-sections/navigation-sections.styles.js.map +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/theme/scrollbar.js +39 -0
- package/lib/commonjs/theme/scrollbar.js.map +1 -0
- package/lib/index.d.ts +112 -1
- package/lib/module/components/data-display/calendar/calendar.styles.js +17 -16
- package/lib/module/components/data-display/calendar/calendar.styles.js.map +1 -1
- package/lib/module/components/data-display/matrix/matrix.styles.js +20 -19
- package/lib/module/components/data-display/matrix/matrix.styles.js.map +1 -1
- package/lib/module/components/data-display/side-panel/side-panel.styles.js +10 -9
- package/lib/module/components/data-display/side-panel/side-panel.styles.js.map +1 -1
- package/lib/module/components/forms/autocomplete/autocomplete.styles.js +8 -21
- package/lib/module/components/forms/autocomplete/autocomplete.styles.js.map +1 -1
- package/lib/module/components/layout/drawer/drawer.styles.js +7 -5
- package/lib/module/components/layout/drawer/drawer.styles.js.map +1 -1
- package/lib/module/components/layout/modal/modal.styles.js +7 -18
- package/lib/module/components/layout/modal/modal.styles.js.map +1 -1
- package/lib/module/components/layout/popover/popover.styles.js +2 -1
- package/lib/module/components/layout/popover/popover.styles.js.map +1 -1
- package/lib/module/components/layout/slider/slider.styles.js +5 -26
- package/lib/module/components/layout/slider/slider.styles.js.map +1 -1
- package/lib/module/components/layout/table/table.comp.js +1 -1
- package/lib/module/components/layout/table/table.comp.js.map +1 -1
- package/lib/module/components/layout/table/table.styles.js +9 -8
- package/lib/module/components/layout/table/table.styles.js.map +1 -1
- package/lib/module/components/layout/table-head/table-head.comp.js +1 -1
- package/lib/module/components/layout/table-head/table-head.comp.js.map +1 -1
- package/lib/module/components/layout/table-head/table-head.styles.js +1 -1
- package/lib/module/components/layout/table-head/table-head.styles.js.map +1 -1
- package/lib/module/components/layout/table-row/table-row.comp.js +1 -1
- package/lib/module/components/layout/table-row/table-row.comp.js.map +1 -1
- package/lib/module/components/navigation/navigation-card/navigation-card.comp.js +2 -0
- package/lib/module/components/navigation/navigation-card/navigation-card.comp.js.map +1 -0
- package/lib/module/components/navigation/navigation-card/navigation-card.styles.js +47 -0
- package/lib/module/components/navigation/navigation-card/navigation-card.styles.js.map +1 -0
- package/lib/module/components/navigation/navigation-card/navigation-cards.comp.js +2 -0
- package/lib/module/components/navigation/navigation-card/navigation-cards.comp.js.map +1 -0
- package/lib/module/components/navigation/navigation-sections/navigation-sections.comp.js +2 -0
- package/lib/module/components/navigation/navigation-sections/navigation-sections.comp.js.map +1 -0
- package/lib/module/components/navigation/navigation-sections/navigation-sections.styles.js +91 -0
- package/lib/module/components/navigation/navigation-sections/navigation-sections.styles.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/theme/scrollbar.js +39 -0
- package/lib/module/theme/scrollbar.js.map +1 -0
- package/llms-full.txt +87 -2
- package/llms.txt +15 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-panel.styles.js","sources":["../../../../../src/components/data-display/side-panel/side-panel.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nexport const Panel = styled.aside<{ $width: string }>`\n display: flex;\n flex-direction: column;\n width: ${({ $width }) => $width};\n min-width: 0;\n min-height: 0;\n max-height: 100%;\n border: 1px solid ${({ theme }) => theme.colors.grey_5};\n border-radius: ${({ theme }) => theme.radius.xl};\n background: ${({ theme }) => theme.colors.white};\n box-shadow: ${({ theme }) => theme.box_shadow.card};\n font-family: ${({ theme }) => theme.typography.fontFamily};\n overflow: hidden;\n`\n\nexport const Header = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.sm};\n padding: ${({ theme }) => theme.spacing.md};\n padding-bottom: ${({ theme }) => theme.spacing.sm};\n`\n\nexport const TitleRow = styled.div`\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: ${({ theme }) => theme.spacing.sm};\n`\n\nexport const Title = styled.h3`\n margin: 0;\n font-size: ${({ theme }) => theme.typography.textSize.bodySm};\n font-weight: ${({ theme }) => theme.typography.fontWeight.semibold};\n color: ${({ theme }) => theme.colors.grey_1};\n`\n\nexport const Description = styled.p`\n margin: 2px 0 0;\n font-size: ${({ theme }) => theme.typography.textSize.caption};\n color: ${({ theme }) => theme.colors.grey_2};\n`\n\nexport const List = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.sm};\n min-height: 0;\n overflow-y: auto;\n padding: ${({ theme }) => theme.spacing.sm} ${({ theme })
|
|
1
|
+
{"version":3,"file":"side-panel.styles.js","sources":["../../../../../src/components/data-display/side-panel/side-panel.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nimport { thinScrollbar } from '../../../theme'\n\nexport const Panel = styled.aside<{ $width: string }>`\n display: flex;\n flex-direction: column;\n width: ${({ $width }) => $width};\n min-width: 0;\n min-height: 0;\n max-height: 100%;\n border: 1px solid ${({ theme }) => theme.colors.grey_5};\n border-radius: ${({ theme }) => theme.radius.xl};\n background: ${({ theme }) => theme.colors.white};\n box-shadow: ${({ theme }) => theme.box_shadow.card};\n font-family: ${({ theme }) => theme.typography.fontFamily};\n overflow: hidden;\n`\n\nexport const Header = styled.div`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.sm};\n padding: ${({ theme }) => theme.spacing.md};\n padding-bottom: ${({ theme }) => theme.spacing.sm};\n`\n\nexport const TitleRow = styled.div`\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: ${({ theme }) => theme.spacing.sm};\n`\n\nexport const Title = styled.h3`\n margin: 0;\n font-size: ${({ theme }) => theme.typography.textSize.bodySm};\n font-weight: ${({ theme }) => theme.typography.fontWeight.semibold};\n color: ${({ theme }) => theme.colors.grey_1};\n`\n\nexport const Description = styled.p`\n margin: 2px 0 0;\n font-size: ${({ theme }) => theme.typography.textSize.caption};\n color: ${({ theme }) => theme.colors.grey_2};\n`\n\nexport const List = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: ${({ theme }) => theme.spacing.sm};\n min-height: 0;\n overflow-y: auto;\n ${thinScrollbar}\n padding: ${({ theme }) => theme.spacing.sm} ${({ theme }) =>\n theme.spacing.md};\n`\n\nexport const Footer = styled.div`\n padding: ${({ theme }) => theme.spacing.sm} ${({ theme }) => theme.spacing.md};\n border-top: 1px solid ${({ theme }) => theme.colors.grey_5};\n`\n\nexport const CollapsedStrip = styled.button`\n display: flex;\n flex: none;\n align-items: flex-start;\n justify-content: center;\n width: 40px;\n min-height: 120px;\n padding: ${({ theme }) => theme.spacing.sm};\n border: none;\n border-radius: ${({ theme }) => theme.radius.md};\n background: ${({ theme }) => theme.colors.grey_6};\n cursor: pointer;\n\n &:hover {\n background: ${({ theme }) => theme.colors.grey_5};\n }\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.border.focus};\n outline-offset: 2px;\n }\n`\n\nexport const Item = styled.button<{ $selected: boolean }>`\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 100%;\n padding: ${({ theme }) => theme.spacing.sm}\n ${({ theme }) => theme.spacing[1.5]};\n border: 1px solid ${({ theme }) => theme.colors.grey_4};\n border-radius: ${({ theme }) => theme.radius.md};\n background: ${({ theme }) => theme.colors.white};\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background-color ${({ theme }) => theme.motion.duration.fast} ease;\n\n &:hover:not(:disabled) {\n background: ${({ theme }) => theme.colors.grey_6};\n }\n\n ${({ $selected, theme }) =>\n $selected &&\n css`\n border-color: transparent;\n background:\n linear-gradient(${theme.colors.white}, ${theme.colors.white})\n padding-box,\n ${theme.colors.brand.gradient} border-box;\n\n &:hover:not(:disabled) {\n background:\n linear-gradient(${theme.colors.grey_6}, ${theme.colors.grey_6})\n padding-box,\n ${theme.colors.brand.gradient} border-box;\n }\n `}\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.border.focus};\n outline-offset: 2px;\n }\n`\n"],"names":["Panel","styled","aside","$width","theme","colors","grey_5","radius","xl","white","box_shadow","card","typography","fontFamily","Header","div","spacing","sm","md","TitleRow","Title","h3","textSize","bodySm","fontWeight","semibold","grey_1","Description","p","caption","grey_2","List","thinScrollbar","Footer","CollapsedStrip","button","grey_6","border","focus","Item","grey_4","motion","duration","fast","$selected","css","brand","gradient"],"mappings":"yFAIaA,MAAAA,EAAQC,EAAMA,OAACC,KAAyB;;;WAG1C,EAAGC,YAAaA;;;;sBAIL,EAAGC,WAAYA,EAAMC,OAAOC;mBAC/B,EAAGF,WAAYA,EAAMG,OAAOC;gBAC/B,EAAGJ,WAAYA,EAAMC,OAAOI;gBAC5B,EAAGL,WAAYA,EAAMM,WAAWC;iBAC/B,EAAGP,WAAYA,EAAMQ,WAAWC;;EAIpCC,EAASb,EAAMA,OAACc,GAAG;;;SAGvB,EAAGX,WAAYA,EAAMY,QAAQC;aACzB,EAAGb,WAAYA,EAAMY,QAAQE;oBACtB,EAAGd,WAAYA,EAAMY,QAAQC;EAGpCE,EAAWlB,EAAMA,OAACc,GAAG;;;;SAIzB,EAAGX,WAAYA,EAAMY,QAAQC;EAGzBG,EAAQnB,EAAMA,OAACoB,EAAE;;eAEf,EAAGjB,WAAYA,EAAMQ,WAAWU,SAASC;iBACvC,EAAGnB,WAAYA,EAAMQ,WAAWY,WAAWC;WACjD,EAAGrB,WAAYA,EAAMC,OAAOqB;EAG1BC,EAAc1B,EAAMA,OAAC2B,CAAC;;eAEpB,EAAGxB,WAAYA,EAAMQ,WAAWU,SAASO;WAC7C,EAAGzB,WAAYA,EAAMC,OAAOyB;EAG1BC,EAAO9B,EAAMA,OAACc,GAAG;;;;SAIrB,EAAGX,WAAYA,EAAMY,QAAQC;;;IAGlCe;aACS,EAAG5B,WAAYA,EAAMY,QAAQC,MAAM,EAAGb,WAC/CA,EAAMY,QAAQE;EAGLe,EAAShC,EAAMA,OAACc,GAAG;aACnB,EAAGX,WAAYA,EAAMY,QAAQC,MAAM,EAAGb,WAAYA,EAAMY,QAAQE;0BACnD,EAAGd,WAAYA,EAAMC,OAAOC;EAGzC4B,EAAiBjC,EAAMA,OAACkC,MAAM;;;;;;;aAO9B,EAAG/B,WAAYA,EAAMY,QAAQC;;mBAEvB,EAAGb,WAAYA,EAAMG,OAAOW;gBAC/B,EAAGd,WAAYA,EAAMC,OAAO+B;;;;kBAI1B,EAAGhC,WAAYA,EAAMC,OAAOC;;;;yBAIrB,EAAGF,WAAYA,EAAMC,OAAOgC,OAAOC;;;EAK/CC,EAAOtC,EAAMA,OAACkC,MAA8B;;;;;aAK5C,EAAG/B,WAAYA,EAAMY,QAAQC;MACpC,EAAGb,WAAYA,EAAMY,QAAQ;sBACb,EAAGZ,WAAYA,EAAMC,OAAOmC;mBAC/B,EAAGpC,WAAYA,EAAMG,OAAOW;gBAC/B,EAAGd,WAAYA,EAAMC,OAAOI;;;;iCAIX,EAAGL,WAAYA,EAAMqC,OAAOC,SAASC;;;kBAGpD,EAAGvC,WAAYA,EAAMC,OAAO+B;;;IAG1C,EAAGQ,YAAWxC,WACdwC,GACAC,EAAAA,GAAG;;;0BAGmBzC,EAAMC,OAAOI,UAAUL,EAAMC,OAAOI;;UAEpDL,EAAMC,OAAOyC,MAAMC;;;;4BAID3C,EAAMC,OAAO+B,WAAWhC,EAAMC,OAAO+B;;YAErDhC,EAAMC,OAAOyC,MAAMC;;;;;;;;;;yBAUN,EAAG3C,WAAYA,EAAMC,OAAOgC,OAAOC;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),o=require("../form.styles.js"),r=require("../../layout/box/box.comp.js"),t=require("../../../theme/theme.util.js"),i=require("../../typography/text/text.comp.js");const
|
|
1
|
+
"use strict";var e=require("styled-components"),o=require("../form.styles.js"),r=require("../../layout/box/box.comp.js"),t=require("../../../theme/theme.util.js"),i=require("../../../theme/scrollbar.js"),d=require("../../typography/text/text.comp.js");const s=e.styled(r.Box).withConfig({shouldForwardProp:e=>!["focused"].includes(e)})`
|
|
2
2
|
min-height: 44px;
|
|
3
3
|
width: 100%;
|
|
4
4
|
border-radius: ${({theme:e})=>e.border_radius.input};
|
|
@@ -27,25 +27,12 @@
|
|
|
27
27
|
&:focus {
|
|
28
28
|
outline: none;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,n=e.styled(r.Box)`
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
max-height: 300px;
|
|
33
33
|
overflow-y: auto;
|
|
34
34
|
background-color: ${({theme:e})=>t.getThemeColor("white",e)};
|
|
35
|
-
|
|
36
|
-
&::-webkit-scrollbar {
|
|
37
|
-
width: 10px;
|
|
38
|
-
}
|
|
39
|
-
&::-webkit-scrollbar-track {
|
|
40
|
-
background: ${e=>t.getThemeColor("white",e.theme)};
|
|
41
|
-
}
|
|
42
|
-
&::-webkit-scrollbar-thumb {
|
|
43
|
-
border-radius: 8px;
|
|
44
|
-
background: ${e=>t.getThemeColor("grey_5",e.theme)};
|
|
45
|
-
}
|
|
46
|
-
&::-webkit-scrollbar-thumb:hover {
|
|
47
|
-
background: ${e=>t.getThemeColor("grey_4",e.theme)};
|
|
48
|
-
}
|
|
35
|
+
${i.thinScrollbar}
|
|
49
36
|
|
|
50
37
|
div {
|
|
51
38
|
border-bottom: 1px solid ${({theme:e})=>t.getThemeColor("grey_5",e)};
|
|
@@ -64,12 +51,12 @@
|
|
|
64
51
|
&:hover {
|
|
65
52
|
background-color: ${({selected:e,disabled:o,theme:r})=>e||o?void 0:t.getThemeColor("grey_5",r)};
|
|
66
53
|
}
|
|
67
|
-
`,
|
|
54
|
+
`,h=e.styled(r.Box)`
|
|
68
55
|
display: flex;
|
|
69
56
|
gap: ${({theme:e})=>e.spacing[1]};
|
|
70
57
|
max-width: 50%;
|
|
71
58
|
flex-wrap: wrap;
|
|
72
|
-
`,
|
|
59
|
+
`,p=e.styled(r.Box)`
|
|
73
60
|
background-color: ${({theme:e})=>t.getThemeColor("grey_5",e)};
|
|
74
61
|
border: 1px solid ${({theme:e})=>t.getThemeColor("grey_4",e)};
|
|
75
62
|
padding: 2px 4px;
|
|
@@ -78,14 +65,14 @@
|
|
|
78
65
|
align-items: center;
|
|
79
66
|
gap: ${({theme:e})=>e.spacing[1]};
|
|
80
67
|
max-width: 100%;
|
|
81
|
-
`,
|
|
68
|
+
`,m=e.styled(r.Box)`
|
|
82
69
|
overflow: hidden;
|
|
83
|
-
`,
|
|
70
|
+
`,g=e.styled(d.Text)`
|
|
84
71
|
width: 100%;
|
|
85
72
|
p {
|
|
86
73
|
text-overflow: ellipsis;
|
|
87
74
|
white-space: nowrap;
|
|
88
75
|
overflow: hidden;
|
|
89
76
|
}
|
|
90
|
-
`;exports.InputContainer=
|
|
77
|
+
`;exports.InputContainer=s,exports.Option=a,exports.OptionsContainer=n,exports.StyledInput=l,exports.Tag=p,exports.TagContainer=h,exports.TagText=g,exports.TagTextContainer=m;
|
|
91
78
|
//# sourceMappingURL=autocomplete.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.styles.js","sources":["../../../../../src/components/forms/autocomplete/autocomplete.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor } from '../../../theme'\nimport { IconsName } from '../../icons'\nimport { Box } from '../../layout'\nimport { Text } from '../../typography'\nimport { fieldBorder, fieldShadow } from '../form.styles'\nimport { InputState } from '../form.types'\n\nexport const InputContainer = styled(Box).withConfig({\n shouldForwardProp: (prop) => !['focused'].includes(prop),\n})<{\n focused?: boolean\n disabled?: boolean\n state?: InputState\n $borderColor?: string\n}>`\n min-height: 44px;\n width: 100%;\n border-radius: ${({ theme }) => theme.border_radius.input};\n padding: ${({ theme }) => `${theme.spacing['1']} ${theme.spacing['2']}`};\n border: 1px solid ${({ theme }) => getThemeColor('grey_4', theme)};\n box-shadow: ${({ theme, state, focused, $borderColor }) =>\n fieldShadow(theme, state, !!focused, $borderColor)};\n transition:\n box-shadow 250ms ease-out,\n border-color 200ms ease;\n width: 100%;\n align-items: center;\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n outline: none;\n\n ${({ disabled, theme }) =>\n disabled && `background-color: ${getThemeColor('grey_5', theme)};`}\n\n ${fieldBorder}\n`\nexport const StyledInput = styled.input.withConfig({\n shouldForwardProp: (prop) => ![''].includes(prop),\n})<{ icon?: IconsName }>`\n min-height: 100%;\n width: 100%;\n border: none;\n background: none;\n color: ${({ theme }) => getThemeColor('grey_1', theme)};\n font-size: ${({ theme }) => theme.typography.body_size.normal};\n\n &:focus {\n outline: none;\n }\n`\n\nexport const OptionsContainer = styled(Box)`\n flex-direction: column;\n max-height: 300px;\n overflow-y: auto;\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n
|
|
1
|
+
{"version":3,"file":"autocomplete.styles.js","sources":["../../../../../src/components/forms/autocomplete/autocomplete.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor, thinScrollbar } from '../../../theme'\nimport { IconsName } from '../../icons'\nimport { Box } from '../../layout'\nimport { Text } from '../../typography'\nimport { fieldBorder, fieldShadow } from '../form.styles'\nimport { InputState } from '../form.types'\n\nexport const InputContainer = styled(Box).withConfig({\n shouldForwardProp: (prop) => !['focused'].includes(prop),\n})<{\n focused?: boolean\n disabled?: boolean\n state?: InputState\n $borderColor?: string\n}>`\n min-height: 44px;\n width: 100%;\n border-radius: ${({ theme }) => theme.border_radius.input};\n padding: ${({ theme }) => `${theme.spacing['1']} ${theme.spacing['2']}`};\n border: 1px solid ${({ theme }) => getThemeColor('grey_4', theme)};\n box-shadow: ${({ theme, state, focused, $borderColor }) =>\n fieldShadow(theme, state, !!focused, $borderColor)};\n transition:\n box-shadow 250ms ease-out,\n border-color 200ms ease;\n width: 100%;\n align-items: center;\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n outline: none;\n\n ${({ disabled, theme }) =>\n disabled && `background-color: ${getThemeColor('grey_5', theme)};`}\n\n ${fieldBorder}\n`\nexport const StyledInput = styled.input.withConfig({\n shouldForwardProp: (prop) => ![''].includes(prop),\n})<{ icon?: IconsName }>`\n min-height: 100%;\n width: 100%;\n border: none;\n background: none;\n color: ${({ theme }) => getThemeColor('grey_1', theme)};\n font-size: ${({ theme }) => theme.typography.body_size.normal};\n\n &:focus {\n outline: none;\n }\n`\n\nexport const OptionsContainer = styled(Box)`\n flex-direction: column;\n max-height: 300px;\n overflow-y: auto;\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n ${thinScrollbar}\n\n div {\n border-bottom: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n }\n\n div:last-child {\n border-bottom: none;\n }\n`\n\nexport const Option = styled(Box)<{ selected: boolean; disabled?: boolean }>`\n width: 100%;\n padding: ${({ theme }) => `${theme.spacing['1']} ${theme.spacing['2']}`};\n background-color: ${({ selected, theme }) =>\n selected ? getThemeColor('secondary', theme) : 'transparent'};\n border-bottom: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n cursor: ${({ disabled }) => (disabled ? 'initial' : 'pointer')};\n\n &:hover {\n background-color: ${({ selected, disabled, theme }) =>\n selected || disabled ? undefined : getThemeColor('grey_5', theme)};\n }\n`\n\nexport const TagContainer = styled(Box)`\n display: flex;\n gap: ${({ theme }) => theme.spacing['1']};\n max-width: 50%;\n flex-wrap: wrap;\n`\n\nexport const Tag = styled(Box)`\n background-color: ${({ theme }) => getThemeColor('grey_5', theme)};\n border: 1px solid ${({ theme }) => getThemeColor('grey_4', theme)};\n padding: 2px 4px;\n border-radius: ${({ theme }) => theme.border_radius.input};\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.spacing['1']};\n max-width: 100%;\n`\n\nexport const TagTextContainer = styled(Box)`\n overflow: hidden;\n`\n\nexport const TagText = styled(Text)`\n width: 100%;\n p {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n`\n"],"names":["InputContainer","styled","Box","withConfig","shouldForwardProp","prop","includes","theme","border_radius","input","spacing","getThemeColor","state","focused","$borderColor","fieldShadow","disabled","fieldBorder","StyledInput","typography","body_size","normal","OptionsContainer","thinScrollbar","Option","selected","undefined","TagContainer","Tag","TagTextContainer","TagText","Text"],"mappings":"4PASO,MAAMA,EAAiBC,EAAMA,OAACC,OAAKC,WAAW,CACnDC,kBAAoBC,IAAU,CAAC,WAAWC,SAASD,IAMnD;;;mBAGiB,EAAGE,WAAYA,EAAMC,cAAcC;aACzC,EAAGF,WAAY,GAAGA,EAAMG,QAAQ,MAAQH,EAAMG,QAAQ;sBAC7C,EAAGH,WAAYI,EAAaA,cAAC,SAAUJ;gBAC7C,EAAGA,QAAOK,QAAOC,UAASC,kBACtCC,EAAAA,YAAYR,EAAOK,IAASC,EAASC;;;;;;sBAMnB,EAAGP,WAAYI,EAAaA,cAAC,QAASJ;;;IAGxD,EAAGS,WAAUT,WACbS,wBAAiCL,EAAAA,cAAc,SAAUJ;;IAEzDU;EAESC,EAAcjB,EAAAA,OAAOQ,MAAMN,WAAW,CACjDC,kBAAoBC,IAAU,CAAC,IAAIC,SAASD,IACtB;;;;;WAKb,EAAGE,WAAYI,EAAaA,cAAC,SAAUJ;eACnC,EAAGA,WAAYA,EAAMY,WAAWC,UAAUC;;;;;EAO5CC,EAAmBrB,EAAAA,OAAOC,EAAAA,IAAI;;;;sBAIrB,EAAGK,WAAYI,EAAaA,cAAC,QAASJ;IACxDgB;;;+BAG2B,EAAGhB,WAAYI,EAAaA,cAAC,SAAUJ;;;;;;EAQzDiB,EAASvB,EAAAA,OAAOC,EAAAA,IAA+C;;aAE/D,EAAGK,WAAY,GAAGA,EAAMG,QAAQ,MAAQH,EAAMG,QAAQ;sBAC7C,EAAGe,WAAUlB,WAC/BkB,EAAWd,EAAaA,cAAC,YAAaJ,GAAS;6BACtB,EAAGA,WAAYI,EAAaA,cAAC,SAAUJ;YACxD,EAAGS,cAAgBA,EAAW,UAAY;;;wBAG9B,EAAGS,WAAUT,WAAUT,WACzCkB,GAAYT,OAAWU,EAAYf,EAAAA,cAAc,SAAUJ;;EAIpDoB,EAAe1B,EAAAA,OAAOC,EAAAA,IAAI;;SAE9B,EAAGK,WAAYA,EAAMG,QAAQ;;;EAKzBkB,EAAM3B,EAAAA,OAAOC,EAAAA,IAAI;sBACR,EAAGK,WAAYI,EAAaA,cAAC,SAAUJ;sBACvC,EAAGA,WAAYI,EAAaA,cAAC,SAAUJ;;mBAE1C,EAAGA,WAAYA,EAAMC,cAAcC;;;SAG7C,EAAGF,WAAYA,EAAMG,QAAQ;;EAIzBmB,EAAmB5B,EAAAA,OAAOC,EAAAA,IAAI;;EAI9B4B,EAAU7B,EAAAA,OAAO8B,EAAAA,KAAK;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var r=require("styled-components"),e=require("../box/box.comp.js");const
|
|
1
|
+
"use strict";var r=require("styled-components"),e=require("../box/box.comp.js"),t=require("../../../theme/scrollbar.js");const o=r.styled(e.Box)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
transition:
|
|
12
12
|
opacity 0.3s ease,
|
|
13
13
|
visibility 0.3s ease;
|
|
14
|
-
`,
|
|
14
|
+
`,s=r.styled(e.Box).attrs((({$transform:r})=>({style:{transform:r}})))`
|
|
15
15
|
position: absolute;
|
|
16
16
|
background-color: transparent;
|
|
17
17
|
transition: transform 0.3s ease;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
border-radius: 1rem 1rem 0 0;
|
|
53
53
|
box-shadow: ${s.shadow.lg};
|
|
54
54
|
`}}}
|
|
55
|
-
`,
|
|
55
|
+
`,a=r.styled(e.Box)`
|
|
56
56
|
position: sticky;
|
|
57
57
|
top: 0;
|
|
58
58
|
flex-shrink: 0;
|
|
@@ -77,17 +77,19 @@
|
|
|
77
77
|
width: 100%;
|
|
78
78
|
border-radius: 1rem 1rem 0 0;
|
|
79
79
|
`}}};
|
|
80
|
-
`,
|
|
80
|
+
`,i=r.styled(e.Box)`
|
|
81
81
|
width: 100%;
|
|
82
82
|
height: 100%;
|
|
83
83
|
flex: 1;
|
|
84
84
|
overflow: auto;
|
|
85
|
+
${t.thinScrollbar}
|
|
85
86
|
flex-direction: column;
|
|
86
87
|
background-color: ${({theme:r})=>r.colors.white};
|
|
87
88
|
& > div {
|
|
88
89
|
overflow: auto;
|
|
90
|
+
${t.thinScrollbar}
|
|
89
91
|
display: flex;
|
|
90
92
|
flex-direction: column;
|
|
91
93
|
}
|
|
92
|
-
`,
|
|
94
|
+
`,n=r.styled(e.Box).attrs((({$dragging:r})=>({style:{cursor:r?"grabbing":"grab",transition:r?"none":"transform 0.2s ease"}})))``;exports.DragArea=n,exports.DrawerButton=a,exports.DrawerChildren=i,exports.DrawerContainer=s,exports.Overlay=o;
|
|
93
95
|
//# sourceMappingURL=drawer.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.styles.js","sources":["../../../../../src/components/layout/drawer/drawer.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nimport { Box } from '../box'\n\nexport const Overlay = styled(Box)<{\n open: boolean\n}>`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: transparent;\n z-index: ${({ theme }) => theme.zIndex?.drawer ?? 1100};\n opacity: ${({ open }) => (open ? 1 : 0)};\n visibility: ${({ open }) => (open ? 'visible' : 'hidden')};\n transition:\n opacity 0.3s ease,\n visibility 0.3s ease;\n`\n\nexport const DrawerContainer = styled(Box).attrs<{ $transform?: string }>(\n ({ $transform }) => ({ style: { transform: $transform } }),\n)<{\n open: boolean\n $anchor?: 'left' | 'right' | 'top' | 'bottom'\n height?: string | number\n}>`\n position: absolute;\n background-color: transparent;\n transition: transform 0.3s ease;\n cursor: pointer;\n max-width: 100%;\n box-sizing: border-box;\n\n ${({ open, $anchor, height, theme }) => {\n switch ($anchor) {\n case 'left':\n return css`\n top: 0;\n left: 0;\n height: 100%;\n width: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateX(0)' : 'translateX(-100%)'};\n border-radius: 0 1rem 1rem 0;\n box-shadow: ${theme.shadow.lg};\n `\n case 'right':\n return css`\n top: 0;\n right: 0;\n height: 100%;\n width: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateX(0)' : 'translateX(100%)'};\n border-radius: 1rem 0 0 1rem;\n box-shadow: ${theme.shadow.lg};\n `\n case 'top':\n return css`\n top: 0;\n left: 0;\n right: 0;\n height: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateY(0)' : 'translateY(-100%)'};\n border-radius: 0 0 1rem 1rem;\n box-shadow: ${theme.shadow.lg};\n `\n case 'bottom':\n default:\n return css`\n bottom: 0;\n left: 0;\n right: 0;\n height: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateY(0)' : 'translateY(100%)'};\n border-radius: 1rem 1rem 0 0;\n box-shadow: ${theme.shadow.lg};\n `\n }\n }}\n`\n\nexport const DrawerButton = styled(Box)<{\n $anchor?: 'left' | 'right' | 'top' | 'bottom'\n}>`\n position: sticky;\n top: 0;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n padding: 0.25rem;\n background-color: ${({ theme }) => theme.colors.grey_5};\n min-height: 1.5rem;\n\n ${({ $anchor }) => {\n switch ($anchor) {\n case 'left':\n return css`\n border-radius: 0 1rem 1rem 0;\n height: 100%;\n width: 2rem;\n `\n case 'right':\n return css`\n border-radius: 1rem 0 0 1rem;\n height: 100%;\n width: 2rem;\n `\n case 'top':\n return css`\n width: 100%;\n border-radius: 0 0 1rem 1rem;\n `\n case 'bottom':\n default:\n return css`\n width: 100%;\n border-radius: 1rem 1rem 0 0;\n `\n }\n }};\n`\n\nexport const DrawerChildren = styled(Box)`\n width: 100%;\n height: 100%;\n flex: 1;\n overflow: auto;\n flex-direction: column;\n background-color: ${({ theme }) => theme.colors.white};\n & > div {\n overflow: auto;\n display: flex;\n flex-direction: column;\n }\n`\n\nexport const DragArea = styled(Box).attrs<{ $dragging: boolean }>(\n ({ $dragging }) => ({\n style: {\n cursor: $dragging ? 'grabbing' : 'grab',\n transition: $dragging ? 'none' : 'transform 0.2s ease',\n },\n }),\n)``\n"],"names":["Overlay","styled","Box","theme","zIndex","drawer","open","DrawerContainer","attrs","$transform","style","transform","$anchor","height","css","shadow","lg","DrawerButton","colors","grey_5","DrawerChildren","white","DragArea","$dragging","cursor","transition"],"mappings":"
|
|
1
|
+
{"version":3,"file":"drawer.styles.js","sources":["../../../../../src/components/layout/drawer/drawer.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nimport { thinScrollbar } from '../../../theme'\nimport { Box } from '../box'\n\nexport const Overlay = styled(Box)<{\n open: boolean\n}>`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: transparent;\n z-index: ${({ theme }) => theme.zIndex?.drawer ?? 1100};\n opacity: ${({ open }) => (open ? 1 : 0)};\n visibility: ${({ open }) => (open ? 'visible' : 'hidden')};\n transition:\n opacity 0.3s ease,\n visibility 0.3s ease;\n`\n\nexport const DrawerContainer = styled(Box).attrs<{ $transform?: string }>(\n ({ $transform }) => ({ style: { transform: $transform } }),\n)<{\n open: boolean\n $anchor?: 'left' | 'right' | 'top' | 'bottom'\n height?: string | number\n}>`\n position: absolute;\n background-color: transparent;\n transition: transform 0.3s ease;\n cursor: pointer;\n max-width: 100%;\n box-sizing: border-box;\n\n ${({ open, $anchor, height, theme }) => {\n switch ($anchor) {\n case 'left':\n return css`\n top: 0;\n left: 0;\n height: 100%;\n width: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateX(0)' : 'translateX(-100%)'};\n border-radius: 0 1rem 1rem 0;\n box-shadow: ${theme.shadow.lg};\n `\n case 'right':\n return css`\n top: 0;\n right: 0;\n height: 100%;\n width: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateX(0)' : 'translateX(100%)'};\n border-radius: 1rem 0 0 1rem;\n box-shadow: ${theme.shadow.lg};\n `\n case 'top':\n return css`\n top: 0;\n left: 0;\n right: 0;\n height: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateY(0)' : 'translateY(-100%)'};\n border-radius: 0 0 1rem 1rem;\n box-shadow: ${theme.shadow.lg};\n `\n case 'bottom':\n default:\n return css`\n bottom: 0;\n left: 0;\n right: 0;\n height: ${typeof height === 'number' ? `${height}px` : height};\n transform: ${open ? 'translateY(0)' : 'translateY(100%)'};\n border-radius: 1rem 1rem 0 0;\n box-shadow: ${theme.shadow.lg};\n `\n }\n }}\n`\n\nexport const DrawerButton = styled(Box)<{\n $anchor?: 'left' | 'right' | 'top' | 'bottom'\n}>`\n position: sticky;\n top: 0;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n padding: 0.25rem;\n background-color: ${({ theme }) => theme.colors.grey_5};\n min-height: 1.5rem;\n\n ${({ $anchor }) => {\n switch ($anchor) {\n case 'left':\n return css`\n border-radius: 0 1rem 1rem 0;\n height: 100%;\n width: 2rem;\n `\n case 'right':\n return css`\n border-radius: 1rem 0 0 1rem;\n height: 100%;\n width: 2rem;\n `\n case 'top':\n return css`\n width: 100%;\n border-radius: 0 0 1rem 1rem;\n `\n case 'bottom':\n default:\n return css`\n width: 100%;\n border-radius: 1rem 1rem 0 0;\n `\n }\n }};\n`\n\nexport const DrawerChildren = styled(Box)`\n width: 100%;\n height: 100%;\n flex: 1;\n overflow: auto;\n ${thinScrollbar}\n flex-direction: column;\n background-color: ${({ theme }) => theme.colors.white};\n & > div {\n overflow: auto;\n ${thinScrollbar}\n display: flex;\n flex-direction: column;\n }\n`\n\nexport const DragArea = styled(Box).attrs<{ $dragging: boolean }>(\n ({ $dragging }) => ({\n style: {\n cursor: $dragging ? 'grabbing' : 'grab',\n transition: $dragging ? 'none' : 'transform 0.2s ease',\n },\n }),\n)``\n"],"names":["Overlay","styled","Box","theme","zIndex","drawer","open","DrawerContainer","attrs","$transform","style","transform","$anchor","height","css","shadow","lg","DrawerButton","colors","grey_5","DrawerChildren","thinScrollbar","white","DragArea","$dragging","cursor","transition"],"mappings":"+HAKaA,EAAUC,EAAAA,OAAOC,EAAAA,IAE5B;;;;;;;aAOW,EAAGC,WAAYA,EAAMC,QAAQC,QAAU;aACvC,EAAGC,UAAYA,EAAO,EAAI;gBACvB,EAAGA,UAAYA,EAAO,UAAY;;;;EAMrCC,EAAkBN,EAAMA,OAACC,OAAKM,OACzC,EAAGC,iBAAkB,CAAEC,MAAO,CAAEC,UAAWF,MAK3C;;;;;;;;IAQE,EAAGH,OAAMM,UAASC,SAAQV,YAC1B,OAAQS,GACN,IAAK,OACH,OAAOE,KAAG;;;;mBAImB,iBAAXD,EAAyB,GAAAA,MAAaA;uBACzCP,EAAO,gBAAkB;;wBAExBH,EAAMY,OAAOC;UAE/B,IAAK,QACH,OAAOF,KAAG;;;;mBAImB,iBAAXD,EAAyB,GAAAA,MAAaA;uBACzCP,EAAO,gBAAkB;;wBAExBH,EAAMY,OAAOC;UAE/B,IAAK,MACH,OAAOF,KAAG;;;;oBAIoB,iBAAXD,EAAyB,GAAAA,MAAaA;uBAC1CP,EAAO,gBAAkB;;wBAExBH,EAAMY,OAAOC;UAG/B,QACE,OAAOF,KAAG;;;;oBAIoB,iBAAXD,EAAyB,GAAAA,MAAaA;uBAC1CP,EAAO,gBAAkB;;wBAExBH,EAAMY,OAAOC;UAEjC;EAISC,EAAehB,EAAAA,OAAOC,EAAAA,IAEjC;;;;;;;sBAOoB,EAAGC,WAAYA,EAAMe,OAAOC;;;IAG9C,EAAGP,cACH,OAAQA,GACN,IAAK,OACH,OAAOE,KAAG;;;;UAKZ,IAAK,QACH,OAAOA,KAAG;;;;UAKZ,IAAK,MACH,OAAOA,KAAG;;;UAKZ,QACE,OAAOA,KAAG;;;UAId;EAISM,EAAiBnB,EAAAA,OAAOC,EAAAA,IAAI;;;;;IAKrCmB;;sBAEkB,EAAGlB,WAAYA,EAAMe,OAAOI;;;MAG5CD;;;;EAMOE,EAAWtB,EAAMA,OAACC,OAAKM,OAClC,EAAGgB,gBAAiB,CAClBd,MAAO,CACLe,OAAQD,EAAY,WAAa,OACjCE,WAAYF,EAAY,OAAS,0BAGtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../../../theme/theme.util.js");const o=e.styled.div`
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../../theme/scrollbar.js"),i=require("../../../theme/theme.util.js");const o=e.styled.div`
|
|
2
2
|
display: ${e=>e.open?"flex":"none"};
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 0;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
opacity: 1;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,a=e.styled.div`
|
|
24
24
|
position: fixed;
|
|
25
25
|
width: 100%;
|
|
26
26
|
height: 100%;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
display: flex;
|
|
35
35
|
flex-direction: column;
|
|
36
36
|
gap: 1rem;
|
|
37
|
-
background-color: ${e=>
|
|
37
|
+
background-color: ${e=>i.getThemeColor(e.theme.colors.custom.white,e.theme)};
|
|
38
38
|
border-radius: 1rem;
|
|
39
39
|
box-shadow: ${({theme:e})=>e.shadow.lg};
|
|
40
40
|
position: fixed;
|
|
@@ -61,24 +61,13 @@
|
|
|
61
61
|
transform: translate(-50%, -50%) scale(1);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,n=e.styled.div`
|
|
65
65
|
display: flex;
|
|
66
66
|
justify-content: space-between;
|
|
67
|
-
`,
|
|
68
|
-
&::-webkit-scrollbar {
|
|
69
|
-
width: 10px;
|
|
70
|
-
}
|
|
71
|
-
&::-webkit-scrollbar-track {
|
|
72
|
-
background: ${e=>t.getThemeColor(e.theme.colors.grey_5,e.theme)};
|
|
73
|
-
}
|
|
74
|
-
&::-webkit-scrollbar-thumb {
|
|
75
|
-
background: ${e=>t.getThemeColor(e.theme.colors.grey_4,e.theme)};
|
|
76
|
-
}
|
|
77
|
-
&::-webkit-scrollbar-thumb:hover {
|
|
78
|
-
background: ${e=>t.getThemeColor(e.theme.colors.grey_3,e.theme)};
|
|
79
|
-
}
|
|
67
|
+
`,d=e.styled.div`
|
|
80
68
|
display: flex;
|
|
81
69
|
height: 100%;
|
|
82
70
|
overflow: auto;
|
|
83
|
-
|
|
71
|
+
${t.thinScrollbar}
|
|
72
|
+
`;exports.Background=a,exports.ModalCard=r,exports.ModalComp=o,exports.ModalContent=d,exports.ModalHeader=n;
|
|
84
73
|
//# sourceMappingURL=modal.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.styles.js","sources":["../../../../../src/components/layout/modal/modal.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor } from '../../../theme'\n\nexport const ModalComp = styled.div<{\n open: boolean\n}>`\n display: ${(props) => (props.open ? 'flex' : 'none')};\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n z-index: ${({ theme }) => theme.zIndex?.modal ?? 1200};\n flex-direction: column;\n\n animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);\n\n @keyframes overlayShow {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n`\n\nexport const Background = styled.div`\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.534);\n z-index: -1;\n`\n\nexport const ModalCard = styled.div.withConfig({\n shouldForwardProp: (prop) =>\n !['minWidth', 'minHeight', 'maxWidth', 'maxHeight'].includes(prop),\n})<{\n width?: string\n minWidth?: string\n height?: string\n minHeight?: string\n maxWidth?: string\n maxHeight?: string\n}>`\n &:focus {\n outline: none;\n }\n\n display: flex;\n flex-direction: column;\n gap: 1rem;\n background-color: ${(props) =>\n getThemeColor(props.theme.colors.custom.white, props.theme)};\n border-radius: 1rem;\n box-shadow: ${({ theme }) => theme.shadow.lg};\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${(props) => props.width};\n min-width: ${(props) => props.minWidth ?? '300px'};\n max-width: ${(props) => props.maxWidth ?? '90vw'};\n height: ${(props) => props.height};\n min-height: ${(props) => props.minHeight};\n max-height: ${(props) => props.maxHeight ?? '90vh'};\n padding: ${(props) => props.theme.spacing['3']};\n animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);\n\n @keyframes contentShow {\n from {\n opacity: 0;\n transform: translate(-50%, -48%) scale(0.96);\n }\n\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n }\n`\nexport const ModalHeader = styled.div`\n display: flex;\n justify-content: space-between;\n`\nexport const ModalContent = styled.div`\n
|
|
1
|
+
{"version":3,"file":"modal.styles.js","sources":["../../../../../src/components/layout/modal/modal.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor, thinScrollbar } from '../../../theme'\n\nexport const ModalComp = styled.div<{\n open: boolean\n}>`\n display: ${(props) => (props.open ? 'flex' : 'none')};\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n z-index: ${({ theme }) => theme.zIndex?.modal ?? 1200};\n flex-direction: column;\n\n animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);\n\n @keyframes overlayShow {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n`\n\nexport const Background = styled.div`\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.534);\n z-index: -1;\n`\n\nexport const ModalCard = styled.div.withConfig({\n shouldForwardProp: (prop) =>\n !['minWidth', 'minHeight', 'maxWidth', 'maxHeight'].includes(prop),\n})<{\n width?: string\n minWidth?: string\n height?: string\n minHeight?: string\n maxWidth?: string\n maxHeight?: string\n}>`\n &:focus {\n outline: none;\n }\n\n display: flex;\n flex-direction: column;\n gap: 1rem;\n background-color: ${(props) =>\n getThemeColor(props.theme.colors.custom.white, props.theme)};\n border-radius: 1rem;\n box-shadow: ${({ theme }) => theme.shadow.lg};\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: ${(props) => props.width};\n min-width: ${(props) => props.minWidth ?? '300px'};\n max-width: ${(props) => props.maxWidth ?? '90vw'};\n height: ${(props) => props.height};\n min-height: ${(props) => props.minHeight};\n max-height: ${(props) => props.maxHeight ?? '90vh'};\n padding: ${(props) => props.theme.spacing['3']};\n animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);\n\n @keyframes contentShow {\n from {\n opacity: 0;\n transform: translate(-50%, -48%) scale(0.96);\n }\n\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n }\n`\nexport const ModalHeader = styled.div`\n display: flex;\n justify-content: space-between;\n`\nexport const ModalContent = styled.div`\n display: flex;\n height: 100%;\n overflow: auto;\n ${thinScrollbar}\n`\n"],"names":["ModalComp","styled","div","props","open","theme","zIndex","modal","Background","ModalCard","withConfig","shouldForwardProp","prop","includes","getThemeColor","colors","custom","white","shadow","lg","width","minWidth","maxWidth","height","minHeight","maxHeight","spacing","ModalHeader","ModalContent","thinScrollbar"],"mappings":"mIAIaA,MAAAA,EAAYC,EAAMA,OAACC,GAE9B;aACYC,GAAWA,EAAMC,KAAO,OAAS;;;;;;;aAOlC,EAAGC,WAAYA,EAAMC,QAAQC,OAAS;;;;;;;;;;;;;;EAgBtCC,EAAaP,EAAMA,OAACC,GAAG;;;;;;EAQvBO,EAAYR,EAAAA,OAAOC,IAAIQ,WAAW,CAC7CC,kBAAoBC,IACjB,CAAC,WAAY,YAAa,WAAY,aAAaC,SAASD,IAQ/D;;;;;;;;sBAQqBT,GACnBW,gBAAcX,EAAME,MAAMU,OAAOC,OAAOC,MAAOd,EAAME;;gBAEzC,EAAGA,WAAYA,EAAMa,OAAOC;;;;;WAKhChB,GAAUA,EAAMiB;eACZjB,GAAUA,EAAMkB,UAAY;eAC5BlB,GAAUA,EAAMmB,UAAY;YAC/BnB,GAAUA,EAAMoB;gBACZpB,GAAUA,EAAMqB;gBAChBrB,GAAUA,EAAMsB,WAAa;aAChCtB,GAAUA,EAAME,MAAMqB,QAAQ;;;;;;;;;;;;;;EAe/BC,EAAc1B,EAAMA,OAACC,GAAG;;;EAIxB0B,EAAe3B,EAAMA,OAACC,GAAG;;;;IAIlC2B;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),o=require("../../../theme/theme.util.js");const
|
|
1
|
+
"use strict";var e=require("styled-components"),o=require("../../../theme/theme.util.js"),r=require("../../../theme/scrollbar.js");const t=e.styled.div.withConfig({shouldForwardProp:e=>!["visible","boxShadow","borderRadius","maxHeight"].includes(e)}).attrs((({$popperStyle:e})=>({style:e})))`
|
|
2
2
|
background-color: ${({theme:e})=>o.getThemeColor("white",e)};
|
|
3
3
|
border-radius: ${({borderRadius:e,theme:o})=>e??o.border_radius.card};
|
|
4
4
|
box-shadow: ${({boxShadow:e,theme:o})=>e??o.box_shadow.box};
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
border: 1px solid ${({theme:e})=>o.getThemeColor("grey_4",e)};
|
|
8
8
|
overflow-x: hidden;
|
|
9
9
|
overflow-y: auto;
|
|
10
|
+
${r.thinScrollbar}
|
|
10
11
|
max-height: ${({maxHeight:e})=>e??void 0};
|
|
11
12
|
z-index: ${({theme:e})=>e.zIndex?.dropdown??1300};
|
|
12
|
-
`;exports.PopoverContent=
|
|
13
|
+
`;exports.PopoverContent=t;
|
|
13
14
|
//# sourceMappingURL=popover.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.styles.js","sources":["../../../../../src/components/layout/popover/popover.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor } from '../../../theme'\n\nexport const PopoverContent = styled.div\n .withConfig({\n shouldForwardProp: (prop) =>\n !['visible', 'boxShadow', 'borderRadius', 'maxHeight'].includes(prop),\n })\n .attrs<{ $popperStyle?: React.CSSProperties }>(({ $popperStyle }) => ({\n style: $popperStyle,\n }))<{\n width: string\n visible?: boolean\n boxShadow?: string\n borderRadius?: string\n maxHeight?: string\n}>`\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n border-radius: ${({ borderRadius, theme }) =>\n borderRadius ?? theme.border_radius.card};\n box-shadow: ${({ boxShadow, theme }) => boxShadow ?? theme.box_shadow.box};\n width: ${({ width }) => width};\n display: ${({ visible }) => (visible ? 'block' : 'none')};\n border: 1px solid ${({ theme }) => getThemeColor('grey_4', theme)};\n overflow-x: hidden;\n overflow-y: auto;\n max-height: ${({ maxHeight }) => maxHeight ?? undefined};\n z-index: ${({ theme }) => theme.zIndex?.dropdown ?? 1300};\n`\n"],"names":["PopoverContent","styled","div","withConfig","shouldForwardProp","prop","includes","attrs","$popperStyle","style","theme","getThemeColor","borderRadius","border_radius","card","boxShadow","box_shadow","box","width","visible","maxHeight","undefined","zIndex","dropdown"],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover.styles.js","sources":["../../../../../src/components/layout/popover/popover.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor, thinScrollbar } from '../../../theme'\n\nexport const PopoverContent = styled.div\n .withConfig({\n shouldForwardProp: (prop) =>\n !['visible', 'boxShadow', 'borderRadius', 'maxHeight'].includes(prop),\n })\n .attrs<{ $popperStyle?: React.CSSProperties }>(({ $popperStyle }) => ({\n style: $popperStyle,\n }))<{\n width: string\n visible?: boolean\n boxShadow?: string\n borderRadius?: string\n maxHeight?: string\n}>`\n background-color: ${({ theme }) => getThemeColor('white', theme)};\n border-radius: ${({ borderRadius, theme }) =>\n borderRadius ?? theme.border_radius.card};\n box-shadow: ${({ boxShadow, theme }) => boxShadow ?? theme.box_shadow.box};\n width: ${({ width }) => width};\n display: ${({ visible }) => (visible ? 'block' : 'none')};\n border: 1px solid ${({ theme }) => getThemeColor('grey_4', theme)};\n overflow-x: hidden;\n overflow-y: auto;\n ${thinScrollbar}\n max-height: ${({ maxHeight }) => maxHeight ?? undefined};\n z-index: ${({ theme }) => theme.zIndex?.dropdown ?? 1300};\n`\n"],"names":["PopoverContent","styled","div","withConfig","shouldForwardProp","prop","includes","attrs","$popperStyle","style","theme","getThemeColor","borderRadius","border_radius","card","boxShadow","box_shadow","box","width","visible","thinScrollbar","maxHeight","undefined","zIndex","dropdown"],"mappings":"mIAIO,MAAMA,EAAiBC,EAAAA,OAAOC,IAClCC,WAAW,CACVC,kBAAoBC,IACjB,CAAC,UAAW,YAAa,eAAgB,aAAaC,SAASD,KAEnEE,OAA8C,EAAGC,mBAAoB,CACpEC,MAAOD,KAOT;sBACoB,EAAGE,WAAYC,EAAaA,cAAC,QAASD;mBACzC,EAAGE,eAAcF,WAChCE,GAAgBF,EAAMG,cAAcC;gBACxB,EAAGC,YAAWL,WAAYK,GAAaL,EAAMM,WAAWC;WAC7D,EAAGC,WAAYA;aACb,EAAGC,aAAeA,EAAU,QAAU;sBAC7B,EAAGT,WAAYC,EAAaA,cAAC,SAAUD;;;IAGzDU;gBACY,EAAGC,eAAgBA,QAAaC;aACnC,EAAGZ,WAAYA,EAAMa,QAAQC,UAAY;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../../../theme/scrollbar.js"),n=require("../box/box.comp.js");e.styled(n.Box)`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 1rem;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
align-items: center;
|
|
7
|
-
`;const
|
|
7
|
+
`;const i=e.styled.div`
|
|
8
8
|
display: flex;
|
|
9
9
|
width: 100%;
|
|
10
10
|
justify-content: flex-start;
|
|
@@ -15,37 +15,16 @@
|
|
|
15
15
|
flex-shrink: 0;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
height: 8px;
|
|
20
|
-
}
|
|
21
|
-
&::-webkit-scrollbar-track {
|
|
22
|
-
background: 'tranparent';
|
|
23
|
-
}
|
|
24
|
-
&::-webkit-scrollbar-thumb {
|
|
25
|
-
background: 'tranparent';
|
|
26
|
-
}
|
|
27
|
-
&::-webkit-scrollbar-thumb:hover {
|
|
28
|
-
background: 'tranparent';
|
|
29
|
-
}
|
|
30
|
-
transition: all 0.3s ease;
|
|
31
|
-
|
|
32
|
-
&:hover {
|
|
33
|
-
&::-webkit-scrollbar-track {
|
|
34
|
-
background: ${e=>r.getThemeColor(e.theme.colors.grey_5,e.theme)};
|
|
35
|
-
}
|
|
36
|
-
&::-webkit-scrollbar-thumb {
|
|
37
|
-
background: ${e=>r.getThemeColor(e.theme.colors.grey_4,e.theme)};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
18
|
+
${t.thinScrollbarOnHover}
|
|
40
19
|
|
|
41
20
|
@media (max-width: ${425}px) {
|
|
42
21
|
overflow: auto;
|
|
43
22
|
}
|
|
44
|
-
`,
|
|
23
|
+
`,o=e.styled.div`
|
|
45
24
|
display: flex;
|
|
46
25
|
gap: ${({theme:e})=>e.spacing[2]};
|
|
47
26
|
justify-content: center;
|
|
48
27
|
|
|
49
28
|
${({$hideOnMobile:e})=>e&&"\n @media (max-width: 425px) {\n display: none;\n }\n "}
|
|
50
|
-
`;exports.MOBILE_MAX_WIDTH=425,exports.NavButtons=
|
|
29
|
+
`;exports.MOBILE_MAX_WIDTH=425,exports.NavButtons=o,exports.ScrollableArea=i;
|
|
51
30
|
//# sourceMappingURL=slider.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.styles.js","sources":["../../../../../src/components/layout/slider/slider.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport {
|
|
1
|
+
{"version":3,"file":"slider.styles.js","sources":["../../../../../src/components/layout/slider/slider.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { thinScrollbarOnHover } from '../../../theme'\nimport { Box } from '../box'\n\n/** Até esta largura a área rola com o dedo/trackpad (e os botões podem ser escondidos). */\nexport const MOBILE_MAX_WIDTH = 425\n\nexport const SliderContainer = styled(Box)`\n display: flex;\n flex-direction: column;\n gap: 1rem;\n justify-content: center;\n align-items: center;\n`\n\nexport const ScrollableArea = styled.div<{ $hasbuttons: boolean }>`\n display: flex;\n width: 100%;\n justify-content: flex-start;\n align-items: center;\n overflow: ${({ $hasbuttons }) => ($hasbuttons ? 'hidden' : 'auto')};\n\n & > * {\n flex-shrink: 0;\n }\n\n ${thinScrollbarOnHover}\n\n @media (max-width: ${MOBILE_MAX_WIDTH}px) {\n overflow: auto;\n }\n`\n\nexport const NavButtons = styled.div<{ $hideOnMobile?: boolean }>`\n display: flex;\n gap: ${({ theme }) => theme.spacing[2]};\n justify-content: center;\n\n ${({ $hideOnMobile }) =>\n $hideOnMobile &&\n `\n @media (max-width: ${MOBILE_MAX_WIDTH}px) {\n display: none;\n }\n `}\n`\n"],"names":["styled","Box","ScrollableArea","div","$hasbuttons","thinScrollbarOnHover","NavButtons","theme","spacing","$hideOnMobile"],"mappings":"yHAQ+BA,EAAMA,OAACC,EAAGA,IAAC;;;;;;EAQ7BC,MAAAA,EAAiBF,EAAMA,OAACG,GAA6B;;;;;cAKpD,EAAGC,iBAAmBA,EAAc,SAAW;;;;;;IAMzDC;;uBArB4B;;;EA4BnBC,EAAaN,EAAMA,OAACG,GAAgC;;SAExD,EAAGI,WAAYA,EAAMC,QAAQ;;;IAGlC,EAAGC,mBACHA,GACA;2BAnC4B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),l=require("./table.styles.js"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),l=require("./table.styles.js"),r=require("../table-head/table-head.comp.js"),a=require("../table-row/table-row.comp.js"),s=require("../box/box.comp.js");exports.Table=({data:o,headers:c,onSelectionChange:d,selectable:i,selected:n,header:b,footer:h,borderRadius:u,spacing:x,boxShadow:j,mobileLayout:m="scroll",onRowClick:w,hoverable:p,...g})=>{const[R,T]=t.useState(n||[]);t.useEffect((()=>{n&&T(n)}),[n,R]);const q=e=>{let t=R;t=R.includes(e)?R.filter((t=>t!==e)):[...R,e],T(t),d?.(t)},C=(t,l)=>e.jsx(a.TableRow,{data:t,headers:c,selectable:i,selected:R.includes(t),onSelect:q,index:l,spacing:x,hoverable:p??Boolean(w),onClick:w},`row-${l}`);return e.jsxs(l.TableWrapper,{"data-testid":"table",direction:"column",borderRadius:u,boxShadow:j,...g,children:[b&&e.jsx(s.Box,{width:"100%",children:b}),e.jsxs(l.Table,{$mobileCards:"cards"===m,children:[e.jsx(r.TableHead,{headers:c,selectable:i,selected:R.length===o.length,onSelect:()=>{let e=[];R.length!==o.length&&(e=[...o]),T(e),d?.(e)},spacing:x}),e.jsx("tbody",{children:o.map(((t,r)=>t.customRender?e.jsx(l.CustomTableRow,{"data-testid":"custom-row",children:e.jsx(l.TableColumn,{$align:"center",width:"100%",children:t.customRender(t,r,C)})},`custom-row-${r}`):C(t,r)))})]}),h&&e.jsx(s.Box,{width:"100%",children:h})]})};
|
|
2
2
|
//# sourceMappingURL=table.comp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.comp.js","sources":["../../../../../src/components/layout/table/table.comp.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport { Box } from '../box'\nimport { TableHead } from '../table-head'\nimport { TableRow } from '../table-row'\n\nimport { TableData, TableProps } from './table.types'\n\nimport * as Styles from './table.styles'\n\n/**\n * Tabela de dados com colunas configuráveis (`headers`), seleção de linhas (`selectable`) e conteúdo próprio por coluna (`customRender`).\n * No celular, `mobileLayout=\"cards\"` mostra cada linha como um card.\n * `onRowClick` deixa a linha clicável (com destaque no hover e teclado); `hoverable` só destaca.\n * Para listas grandes, coloque `<Pagination totalItems={...} />` abaixo.\n * @example <Table headers={[{ key: 'nome', label: 'Nome' }]} data={fornecedores} />\n */\nexport const Table = ({\n data,\n headers,\n onSelectionChange,\n selectable,\n selected,\n header,\n footer,\n borderRadius,\n spacing,\n boxShadow,\n mobileLayout = 'scroll',\n onRowClick,\n hoverable,\n ...rest\n}: TableProps) => {\n const [selectedRows, setSelectedRows] = useState<TableData[]>(selected || [])\n\n useEffect(() => {\n if (selected) {\n setSelectedRows(selected)\n }\n }, [selected, selectedRows])\n\n const handleToggleSelectAll = () => {\n let newSelectedRows: TableData[] = []\n if (selectedRows.length !== data.length) {\n newSelectedRows = [...data]\n }\n\n setSelectedRows(newSelectedRows)\n onSelectionChange?.(newSelectedRows)\n }\n\n const handleToggleSelect = (row: TableData) => {\n let newSelectedRows: TableData[] = selectedRows\n if (selectedRows.includes(row)) {\n newSelectedRows = selectedRows.filter(\n (selectedRow) => selectedRow !== row,\n )\n } else {\n newSelectedRows = [...selectedRows, row]\n }\n\n setSelectedRows(newSelectedRows)\n onSelectionChange?.(newSelectedRows)\n }\n\n const renderDefaultRow = (row: TableData, index: number) => (\n <TableRow\n data={row}\n headers={headers}\n selectable={selectable}\n selected={selectedRows.includes(row)}\n onSelect={handleToggleSelect}\n index={index}\n spacing={spacing}\n hoverable={hoverable ?? Boolean(onRowClick)}\n onClick={onRowClick}\n />\n )\n\n return (\n <Styles.TableWrapper\n data-testid=\"table\"\n direction=\"column\"\n borderRadius={borderRadius}\n boxShadow={boxShadow}\n {...rest}\n >\n {header && <Box width=\"100%\">{header}</Box>}\n <Styles.Table $mobileCards={mobileLayout === 'cards'}>\n <TableHead\n headers={headers}\n selectable={selectable}\n selected={selectedRows.length === data.length}\n onSelect={handleToggleSelectAll}\n spacing={spacing}\n />\n <tbody>\n {data.map((row, index) => {\n if (row.customRender) {\n return (\n <Styles.CustomTableRow\n key={`custom-row-${index}`}\n data-testid=\"custom-row\"\n >\n <Styles.TableColumn $align=\"center\" width=\"100%\">\n {row.customRender(row, index, renderDefaultRow)}\n </Styles.TableColumn>\n </Styles.CustomTableRow>\n )\n }\n return renderDefaultRow(row, index)\n })}\n </tbody>\n </Styles.Table>\n {footer && <Box width=\"100%\">{footer}</Box>}\n </Styles.TableWrapper>\n )\n}\n"],"names":["Table","data","headers","onSelectionChange","selectable","selected","header","footer","borderRadius","spacing","boxShadow","mobileLayout","onRowClick","hoverable","rest","selectedRows","setSelectedRows","useState","useEffect","handleToggleSelect","row","newSelectedRows","includes","filter","selectedRow","renderDefaultRow","index","_jsx","TableRow","onSelect","Boolean","onClick","_jsxs","Styles","direction","Box","width","children","jsxs","TableHead","length","handleToggleSelectAll","jsx","map","customRender","$align"],"mappings":"0OAiBqBA,EACnBC,OACAC,UACAC,oBACAC,aACAC,WACAC,SACAC,SACAC,eACAC,UACAC,YACAC,eAAe,SACfC,aACAC,eACGC,MAEH,MAAOC,EAAcC,GAAmBC,EAAAA,SAAsBZ,GAAY,IAE1Ea,EAAAA,WAAU,KACJb,GACFW,EAAgBX,EAClB,GACC,CAACA,EAAUU,IAEd,MAUMI,EAAsBC,IAC1B,IAAIC,EAA+BN,EAEjCM,EADEN,EAAaO,SAASF,GACNL,EAAaQ,QAC5BC,GAAgBA,IAAgBJ,IAGjB,IAAIL,EAAcK,GAGtCJ,EAAgBK,GAChBlB,IAAoBkB,EAAgB,EAGhCI,EAAmBA,CAACL,EAAgBM,IACxCC,EAAAA,IAACC,EAAAA,
|
|
1
|
+
{"version":3,"file":"table.comp.js","sources":["../../../../../src/components/layout/table/table.comp.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nimport { Box } from '../box'\nimport { TableHead } from '../table-head'\nimport { TableRow } from '../table-row'\n\nimport { TableData, TableProps } from './table.types'\n\nimport * as Styles from './table.styles'\n\n/**\n * Tabela de dados com colunas configuráveis (`headers`), seleção de linhas (`selectable`) e conteúdo próprio por coluna (`customRender`).\n * No celular, `mobileLayout=\"cards\"` mostra cada linha como um card.\n * `onRowClick` deixa a linha clicável (com destaque no hover e teclado); `hoverable` só destaca.\n * Para listas grandes, coloque `<Pagination totalItems={...} />` abaixo.\n * @example <Table headers={[{ key: 'nome', label: 'Nome' }]} data={fornecedores} />\n */\nexport const Table = ({\n data,\n headers,\n onSelectionChange,\n selectable,\n selected,\n header,\n footer,\n borderRadius,\n spacing,\n boxShadow,\n mobileLayout = 'scroll',\n onRowClick,\n hoverable,\n ...rest\n}: TableProps) => {\n const [selectedRows, setSelectedRows] = useState<TableData[]>(selected || [])\n\n useEffect(() => {\n if (selected) {\n setSelectedRows(selected)\n }\n }, [selected, selectedRows])\n\n const handleToggleSelectAll = () => {\n let newSelectedRows: TableData[] = []\n if (selectedRows.length !== data.length) {\n newSelectedRows = [...data]\n }\n\n setSelectedRows(newSelectedRows)\n onSelectionChange?.(newSelectedRows)\n }\n\n const handleToggleSelect = (row: TableData) => {\n let newSelectedRows: TableData[] = selectedRows\n if (selectedRows.includes(row)) {\n newSelectedRows = selectedRows.filter(\n (selectedRow) => selectedRow !== row,\n )\n } else {\n newSelectedRows = [...selectedRows, row]\n }\n\n setSelectedRows(newSelectedRows)\n onSelectionChange?.(newSelectedRows)\n }\n\n const renderDefaultRow = (row: TableData, index: number) => (\n <TableRow\n key={`row-${index}`}\n data={row}\n headers={headers}\n selectable={selectable}\n selected={selectedRows.includes(row)}\n onSelect={handleToggleSelect}\n index={index}\n spacing={spacing}\n hoverable={hoverable ?? Boolean(onRowClick)}\n onClick={onRowClick}\n />\n )\n\n return (\n <Styles.TableWrapper\n data-testid=\"table\"\n direction=\"column\"\n borderRadius={borderRadius}\n boxShadow={boxShadow}\n {...rest}\n >\n {header && <Box width=\"100%\">{header}</Box>}\n <Styles.Table $mobileCards={mobileLayout === 'cards'}>\n <TableHead\n headers={headers}\n selectable={selectable}\n selected={selectedRows.length === data.length}\n onSelect={handleToggleSelectAll}\n spacing={spacing}\n />\n <tbody>\n {data.map((row, index) => {\n if (row.customRender) {\n return (\n <Styles.CustomTableRow\n key={`custom-row-${index}`}\n data-testid=\"custom-row\"\n >\n <Styles.TableColumn $align=\"center\" width=\"100%\">\n {row.customRender(row, index, renderDefaultRow)}\n </Styles.TableColumn>\n </Styles.CustomTableRow>\n )\n }\n return renderDefaultRow(row, index)\n })}\n </tbody>\n </Styles.Table>\n {footer && <Box width=\"100%\">{footer}</Box>}\n </Styles.TableWrapper>\n )\n}\n"],"names":["Table","data","headers","onSelectionChange","selectable","selected","header","footer","borderRadius","spacing","boxShadow","mobileLayout","onRowClick","hoverable","rest","selectedRows","setSelectedRows","useState","useEffect","handleToggleSelect","row","newSelectedRows","includes","filter","selectedRow","renderDefaultRow","index","_jsx","TableRow","onSelect","Boolean","onClick","_jsxs","Styles","direction","Box","width","children","jsxs","TableHead","length","handleToggleSelectAll","jsx","map","customRender","$align"],"mappings":"0OAiBqBA,EACnBC,OACAC,UACAC,oBACAC,aACAC,WACAC,SACAC,SACAC,eACAC,UACAC,YACAC,eAAe,SACfC,aACAC,eACGC,MAEH,MAAOC,EAAcC,GAAmBC,EAAAA,SAAsBZ,GAAY,IAE1Ea,EAAAA,WAAU,KACJb,GACFW,EAAgBX,EAClB,GACC,CAACA,EAAUU,IAEd,MAUMI,EAAsBC,IAC1B,IAAIC,EAA+BN,EAEjCM,EADEN,EAAaO,SAASF,GACNL,EAAaQ,QAC5BC,GAAgBA,IAAgBJ,IAGjB,IAAIL,EAAcK,GAGtCJ,EAAgBK,GAChBlB,IAAoBkB,EAAgB,EAGhCI,EAAmBA,CAACL,EAAgBM,IACxCC,EAAAA,IAACC,EAAAA,UAEC3B,KAAMmB,EACNlB,QAASA,EACTE,WAAYA,EACZC,SAAUU,EAAaO,SAASF,GAChCS,SAAUV,EACVO,MAAOA,EACPjB,QAASA,EACTI,UAAWA,GAAaiB,QAAQlB,GAChCmB,QAASnB,GATG,OAAAc,KAahB,OACEM,EAAAA,KAACC,EAAAA,4BACa,QACZC,UAAU,SACV1B,aAAcA,EACdE,UAAWA,KACPI,YAEHR,GAAUqB,MAACQ,MAAG,CAACC,MAAM,OAAQC,SAAA/B,IAC9B0B,EAAAM,KAACL,sBAA4C,UAAjBtB,EAAwB0B,SAAA,CAClDV,MAACY,YAAS,CACRrC,QAASA,EACTE,WAAYA,EACZC,SAAUU,EAAayB,SAAWvC,EAAKuC,OACvCX,SArDsBY,KAC5B,IAAIpB,EAA+B,GAC/BN,EAAayB,SAAWvC,EAAKuC,SAC/BnB,EAAkB,IAAIpB,IAGxBe,EAAgBK,GAChBlB,IAAoBkB,EAAgB,EA+C9BZ,QAASA,IAEXkB,EAAAe,IAAA,QAAA,CAAAL,SACGpC,EAAK0C,KAAI,CAACvB,EAAKM,IACVN,EAAIwB,aAEJjB,EAAAA,IAACM,EAAAA,8BAEa,aAAYI,SAExBV,EAACe,IAAAT,cAAkB,CAAAY,OAAQ,SAAST,MAAM,OACvCC,SAAAjB,EAAIwB,aAAaxB,EAAKM,EAAOD,MAJb,cAAAC,KASlBD,EAAiBL,EAAKM,UAIlCnB,GAAUoB,EAACe,IAAAP,MAAI,CAAAC,MAAM,OAAMC,SAAE9B,MACV"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
"use strict";var e=require("styled-components"),t=require("../box/box.comp.js"),d=require("../../../theme/theme.util.js"),i=require("../../../theme/media.js");const
|
|
1
|
+
"use strict";var e=require("styled-components"),t=require("../box/box.comp.js"),d=require("../../../theme/theme.util.js"),i=require("../../../theme/scrollbar.js"),o=require("../../../theme/media.js");const a=e.styled(t.Box).withConfig({shouldForwardProp:e=>!["borderRadius","boxShadow"].includes(e)})`
|
|
2
2
|
width: 100%;
|
|
3
3
|
border-radius: ${e=>e.borderRadius??e.theme.border_radius.table};
|
|
4
4
|
border: 1px solid ${({theme:e})=>d.getThemeColor("grey_5",e)};
|
|
5
5
|
overflow-y: hidden;
|
|
6
6
|
overflow-x: auto;
|
|
7
|
+
${i.thinScrollbar}
|
|
7
8
|
box-shadow: ${e=>e.boxShadow??void 0};
|
|
8
|
-
`,
|
|
9
|
+
`,r=e.styled.table`
|
|
9
10
|
width: 100%;
|
|
10
11
|
min-width: fit-content;
|
|
11
12
|
border-collapse: collapse;
|
|
12
13
|
display: flex;
|
|
13
14
|
flex-direction: column;
|
|
14
15
|
|
|
15
|
-
${({$mobileCards:t,theme:
|
|
16
|
-
${
|
|
16
|
+
${({$mobileCards:t,theme:i})=>t&&e.css`
|
|
17
|
+
${o.media.down("md")} {
|
|
17
18
|
min-width: 0;
|
|
18
19
|
|
|
19
20
|
thead {
|
|
@@ -23,18 +24,18 @@
|
|
|
23
24
|
tbody {
|
|
24
25
|
display: flex;
|
|
25
26
|
flex-direction: column;
|
|
26
|
-
gap: ${
|
|
27
|
-
padding: ${
|
|
27
|
+
gap: ${i.spacing[1]};
|
|
28
|
+
padding: ${i.spacing[1]};
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
tr[data-testid='table-row'] {
|
|
31
32
|
flex-direction: column;
|
|
32
33
|
align-items: stretch;
|
|
33
|
-
gap: ${
|
|
34
|
+
gap: ${i.spacing[1]};
|
|
34
35
|
min-height: 0;
|
|
35
|
-
padding: ${
|
|
36
|
-
border: 1px solid ${d.getThemeColor("grey_5",
|
|
37
|
-
border-radius: ${
|
|
36
|
+
padding: ${i.spacing[2]};
|
|
37
|
+
border: 1px solid ${d.getThemeColor("grey_5",i)};
|
|
38
|
+
border-radius: ${i.radius.lg};
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
tr[data-testid='table-row'] > td {
|
|
@@ -42,15 +43,15 @@
|
|
|
42
43
|
min-width: 0;
|
|
43
44
|
justify-content: space-between;
|
|
44
45
|
align-items: center;
|
|
45
|
-
gap: ${
|
|
46
|
+
gap: ${i.spacing[2]};
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
tr[data-testid='table-row'] > td[data-label]::before {
|
|
49
50
|
content: attr(data-label);
|
|
50
51
|
flex: none;
|
|
51
52
|
max-width: 45%;
|
|
52
|
-
font-size: ${
|
|
53
|
-
color: ${d.getThemeColor("grey_3",
|
|
53
|
+
font-size: ${i.typography.textSize.caption};
|
|
54
|
+
color: ${d.getThemeColor("grey_3",i)};
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
tr[data-testid='table-row'] > td[data-label] > * {
|
|
@@ -59,13 +60,13 @@
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
`}
|
|
62
|
-
`,
|
|
63
|
+
`,l=e.styled.td`
|
|
63
64
|
${({$align:e})=>`justify-content: ${e};`}
|
|
64
65
|
padding: 0;
|
|
65
66
|
display: flex;
|
|
66
67
|
${({width:e})=>e?`\n width: ${e};\n `:"\n flex: 1;\n "}
|
|
67
|
-
min-width: ${({minWidth:e})=>e??void 0};
|
|
68
|
-
`,
|
|
68
|
+
min-width: ${({$minWidth:e})=>e??void 0};
|
|
69
|
+
`,s=e.styled.tr`
|
|
69
70
|
display: flex;
|
|
70
71
|
border-bottom: 1px solid ${({theme:e})=>d.getThemeColor("grey_5",e)};
|
|
71
72
|
`,n=e.styled.td`
|
|
@@ -78,5 +79,5 @@
|
|
|
78
79
|
padding-right: 0;
|
|
79
80
|
padding: 0;
|
|
80
81
|
}
|
|
81
|
-
`;exports.CustomTableRow=
|
|
82
|
+
`;exports.CustomTableRow=s,exports.SelectableColumn=n,exports.Table=r,exports.TableColumn=l,exports.TableWrapper=a;
|
|
82
83
|
//# sourceMappingURL=table.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.styles.js","sources":["../../../../../src/components/layout/table/table.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nimport { getThemeColor, media } from '../../../theme'\nimport { Box } from '../box'\n\nimport { CellAlign } from './table.types'\n\nexport const TableWrapper = styled(Box).withConfig({\n shouldForwardProp: (prop) => !['borderRadius', 'boxShadow'].includes(prop),\n})`\n width: 100%;\n border-radius: ${(props) =>\n props.borderRadius ?? props.theme.border_radius.table};\n border: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n overflow-y: hidden;\n overflow-x: auto;\n box-shadow: ${(props) => props.boxShadow ?? undefined};\n`\n\nexport const Table = styled.table<{ $mobileCards?: boolean }>`\n width: 100%;\n min-width: fit-content;\n border-collapse: collapse;\n display: flex;\n flex-direction: column;\n\n ${({ $mobileCards, theme }) =>\n $mobileCards &&\n css`\n ${media.down('md')} {\n min-width: 0;\n\n thead {\n display: none;\n }\n\n tbody {\n display: flex;\n flex-direction: column;\n gap: ${theme.spacing[1]};\n padding: ${theme.spacing[1]};\n }\n\n tr[data-testid='table-row'] {\n flex-direction: column;\n align-items: stretch;\n gap: ${theme.spacing[1]};\n min-height: 0;\n padding: ${theme.spacing[2]};\n border: 1px solid ${getThemeColor('grey_5', theme)};\n border-radius: ${theme.radius.lg};\n }\n\n tr[data-testid='table-row'] > td {\n width: 100%;\n min-width: 0;\n justify-content: space-between;\n align-items: center;\n gap: ${theme.spacing[2]};\n }\n\n tr[data-testid='table-row'] > td[data-label]::before {\n content: attr(data-label);\n flex: none;\n max-width: 45%;\n font-size: ${theme.typography.textSize.caption};\n color: ${getThemeColor('grey_3', theme)};\n }\n\n tr[data-testid='table-row'] > td[data-label] > * {\n width: auto;\n text-align: right;\n }\n }\n `}\n`\n\nexport const TableColumn = styled.td<{\n $align: CellAlign\n width?: string\n minWidth?: string\n}>`\n ${({ $align }) => `justify-content: ${$align};`}\n padding: 0;\n display: flex;\n ${({ width }) => {\n if (width) {\n return `\n width: ${width};\n `\n }\n return `\n flex: 1;\n `\n }}\n min-width: ${({ minWidth }) => minWidth ?? undefined};\n`\n\nexport const CustomTableRow = styled.tr`\n display: flex;\n border-bottom: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n`\n\nexport const SelectableColumn = styled.td`\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n\n &:last-child {\n padding-right: 0;\n padding: 0;\n }\n`\n"],"names":["TableWrapper","styled","Box","withConfig","shouldForwardProp","prop","includes","props","borderRadius","theme","border_radius","table","getThemeColor","boxShadow","undefined","Table","$mobileCards","css","media","down","spacing","radius","lg","typography","textSize","caption","TableColumn","td","$align","width","minWidth","CustomTableRow","tr","SelectableColumn"],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.styles.js","sources":["../../../../../src/components/layout/table/table.styles.tsx"],"sourcesContent":["import { css, styled } from 'styled-components'\n\nimport { getThemeColor, media, thinScrollbar } from '../../../theme'\nimport { Box } from '../box'\n\nimport { CellAlign } from './table.types'\n\nexport const TableWrapper = styled(Box).withConfig({\n shouldForwardProp: (prop) => !['borderRadius', 'boxShadow'].includes(prop),\n})`\n width: 100%;\n border-radius: ${(props) =>\n props.borderRadius ?? props.theme.border_radius.table};\n border: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n overflow-y: hidden;\n overflow-x: auto;\n ${thinScrollbar}\n box-shadow: ${(props) => props.boxShadow ?? undefined};\n`\n\nexport const Table = styled.table<{ $mobileCards?: boolean }>`\n width: 100%;\n min-width: fit-content;\n border-collapse: collapse;\n display: flex;\n flex-direction: column;\n\n ${({ $mobileCards, theme }) =>\n $mobileCards &&\n css`\n ${media.down('md')} {\n min-width: 0;\n\n thead {\n display: none;\n }\n\n tbody {\n display: flex;\n flex-direction: column;\n gap: ${theme.spacing[1]};\n padding: ${theme.spacing[1]};\n }\n\n tr[data-testid='table-row'] {\n flex-direction: column;\n align-items: stretch;\n gap: ${theme.spacing[1]};\n min-height: 0;\n padding: ${theme.spacing[2]};\n border: 1px solid ${getThemeColor('grey_5', theme)};\n border-radius: ${theme.radius.lg};\n }\n\n tr[data-testid='table-row'] > td {\n width: 100%;\n min-width: 0;\n justify-content: space-between;\n align-items: center;\n gap: ${theme.spacing[2]};\n }\n\n tr[data-testid='table-row'] > td[data-label]::before {\n content: attr(data-label);\n flex: none;\n max-width: 45%;\n font-size: ${theme.typography.textSize.caption};\n color: ${getThemeColor('grey_3', theme)};\n }\n\n tr[data-testid='table-row'] > td[data-label] > * {\n width: auto;\n text-align: right;\n }\n }\n `}\n`\n\nexport const TableColumn = styled.td<{\n $align: CellAlign\n width?: string\n $minWidth?: string\n}>`\n ${({ $align }) => `justify-content: ${$align};`}\n padding: 0;\n display: flex;\n ${({ width }) => {\n if (width) {\n return `\n width: ${width};\n `\n }\n return `\n flex: 1;\n `\n }}\n min-width: ${({ $minWidth }) => $minWidth ?? undefined};\n`\n\nexport const CustomTableRow = styled.tr`\n display: flex;\n border-bottom: 1px solid ${({ theme }) => getThemeColor('grey_5', theme)};\n`\n\nexport const SelectableColumn = styled.td`\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n\n &:last-child {\n padding-right: 0;\n padding: 0;\n }\n`\n"],"names":["TableWrapper","styled","Box","withConfig","shouldForwardProp","prop","includes","props","borderRadius","theme","border_radius","table","getThemeColor","thinScrollbar","boxShadow","undefined","Table","$mobileCards","css","media","down","spacing","radius","lg","typography","textSize","caption","TableColumn","td","$align","width","$minWidth","CustomTableRow","tr","SelectableColumn"],"mappings":"wMAOO,MAAMA,EAAeC,EAAMA,OAACC,OAAKC,WAAW,CACjDC,kBAAoBC,IAAU,CAAC,eAAgB,aAAaC,SAASD,IACrE;;mBAEkBE,GAChBA,EAAMC,cAAgBD,EAAME,MAAMC,cAAcC;sBAC9B,EAAGF,WAAYG,EAAaA,cAAC,SAAUH;;;IAGzDI;gBACaN,GAAUA,EAAMO,gBAAaC;EAGjCC,EAAQf,EAAMA,OAACU,KAAiC;;;;;;;IAOzD,EAAGM,eAAcR,WACjBQ,GACAC,EAAAA,GAAG;QACCC,EAAKA,MAACC,KAAK;;;;;;;;;;iBAUFX,EAAMY,QAAQ;qBACVZ,EAAMY,QAAQ;;;;;;iBAMlBZ,EAAMY,QAAQ;;qBAEVZ,EAAMY,QAAQ;8BACLT,EAAaA,cAAC,SAAUH;2BAC3BA,EAAMa,OAAOC;;;;;;;;iBAQvBd,EAAMY,QAAQ;;;;;;;uBAORZ,EAAMe,WAAWC,SAASC;mBAC9Bd,EAAaA,cAAC,SAAUH;;;;;;;;;EAW9BkB,EAAc1B,EAAMA,OAAC2B,EAIhC;IACE,EAAGC,YAAa,oBAAoBA;;;IAGpC,EAAGC,WACCA,EACK,oBACIA,aAGN;eAII,EAAGC,eAAgBA,QAAahB;EAGlCiB,EAAiB/B,EAAMA,OAACgC,EAAE;;6BAEV,EAAGxB,WAAYG,EAAaA,cAAC,SAAUH;EAGvDyB,EAAmBjC,EAAMA,OAAC2B,EAAE;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),a=require("../table/table.styles.js"),t=require("./table-head.styles.js"),l=require("../../forms/checkbox/checkbox.comp.js"),s=require("../../typography/text/text.comp.js");exports.TableHead=({selectable:r,selected:c,headers:d,onSelect:i,spacing:h})=>e.jsx("thead",{children:e.jsxs(t.TableHeaderRow,{"data-testid":"table-head",spacing:h,children:[r&&e.jsx(a.SelectableColumn,{"data-testid":"selectable-column-header",children:e.jsx(l.Checkbox,{checked:c,onChange:()=>i?.(),"aria-label":"Selecionar todas as linhas","data-testid":"checkbox"})}),d.map(((a,l)=>e.jsx(t.TableHeaderColumn,{align:a.align||"left",width:a.width
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),a=require("../table/table.styles.js"),t=require("./table-head.styles.js"),l=require("../../forms/checkbox/checkbox.comp.js"),s=require("../../typography/text/text.comp.js");exports.TableHead=({selectable:r,selected:c,headers:d,onSelect:i,spacing:h})=>e.jsx("thead",{children:e.jsxs(t.TableHeaderRow,{"data-testid":"table-head",spacing:h,children:[r&&e.jsx(a.SelectableColumn,{"data-testid":"selectable-column-header",children:e.jsx(l.Checkbox,{checked:c,onChange:()=>i?.(),"aria-label":"Selecionar todas as linhas","data-testid":"checkbox"})}),d.map(((a,l)=>e.jsx(t.TableHeaderColumn,{align:a.align||"left",width:a.width,$minWidth:a.minWidth,"data-testid":`header-column-${l}`,children:e.jsx(s.Text,{size:"small",color:"grey_3",children:a.label})},`header-column-${l}`)))]})});
|
|
2
2
|
//# sourceMappingURL=table-head.comp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-head.comp.js","sources":["../../../../../src/components/layout/table-head/table-head.comp.tsx"],"sourcesContent":["import { Checkbox } from '../../forms/checkbox'\nimport { Text } from '../../typography'\nimport * as TableStyles from '../table/table.styles'\n\nimport { TableHeadProps } from './table-head.types'\n\nimport * as Styles from './table-head.styles'\nexport const TableHead = ({\n selectable,\n selected,\n headers,\n onSelect,\n spacing,\n}: TableHeadProps) => {\n return (\n <thead>\n <Styles.TableHeaderRow data-testid=\"table-head\" spacing={spacing}>\n {selectable && (\n <TableStyles.SelectableColumn data-testid=\"selectable-column-header\">\n <Checkbox\n checked={selected}\n onChange={() => onSelect?.()}\n aria-label=\"Selecionar todas as linhas\"\n data-testid=\"checkbox\"\n />\n </TableStyles.SelectableColumn>\n )}\n {headers.map((header, index) => (\n <Styles.TableHeaderColumn\n align={header.align || 'left'}\n width={header.width}\n minWidth={header.minWidth}\n key={`header-column-${index}`}\n data-testid={`header-column-${index}`}\n >\n <Text size=\"small\" color=\"grey_3\">\n {header.label}\n </Text>\n </Styles.TableHeaderColumn>\n ))}\n </Styles.TableHeaderRow>\n </thead>\n )\n}\n"],"names":["TableHead","selectable","selected","headers","onSelect","spacing","_jsx","children","_jsxs","jsxs","Styles","jsx","TableStyles","Checkbox","checked","onChange","map","header","index","align","width","minWidth","Text","size","color","label"],"mappings":"+OAOyBA,EACvBC,aACAC,WACAC,UACAC,WACAC,aAGEC,EAAAA,IACE,QAAA,CAAAC,SAAAC,EAAAC,KAACC,iBAAkC,CAAA,cAAA,aAAaL,QAASA,YACtDJ,GACCK,EAAAK,IAACC,
|
|
1
|
+
{"version":3,"file":"table-head.comp.js","sources":["../../../../../src/components/layout/table-head/table-head.comp.tsx"],"sourcesContent":["import { Checkbox } from '../../forms/checkbox'\nimport { Text } from '../../typography'\nimport * as TableStyles from '../table/table.styles'\n\nimport { TableHeadProps } from './table-head.types'\n\nimport * as Styles from './table-head.styles'\nexport const TableHead = ({\n selectable,\n selected,\n headers,\n onSelect,\n spacing,\n}: TableHeadProps) => {\n return (\n <thead>\n <Styles.TableHeaderRow data-testid=\"table-head\" spacing={spacing}>\n {selectable && (\n <TableStyles.SelectableColumn data-testid=\"selectable-column-header\">\n <Checkbox\n checked={selected}\n onChange={() => onSelect?.()}\n aria-label=\"Selecionar todas as linhas\"\n data-testid=\"checkbox\"\n />\n </TableStyles.SelectableColumn>\n )}\n {headers.map((header, index) => (\n <Styles.TableHeaderColumn\n align={header.align || 'left'}\n width={header.width}\n $minWidth={header.minWidth}\n key={`header-column-${index}`}\n data-testid={`header-column-${index}`}\n >\n <Text size=\"small\" color=\"grey_3\">\n {header.label}\n </Text>\n </Styles.TableHeaderColumn>\n ))}\n </Styles.TableHeaderRow>\n </thead>\n )\n}\n"],"names":["TableHead","selectable","selected","headers","onSelect","spacing","_jsx","children","_jsxs","jsxs","Styles","jsx","TableStyles","Checkbox","checked","onChange","map","header","index","align","width","minWidth","Text","size","color","label"],"mappings":"+OAOyBA,EACvBC,aACAC,WACAC,UACAC,WACAC,aAGEC,EAAAA,IACE,QAAA,CAAAC,SAAAC,EAAAC,KAACC,iBAAkC,CAAA,cAAA,aAAaL,QAASA,YACtDJ,GACCK,EAAAK,IAACC,mBAAyC,CAAA,cAAA,2BACxCL,SAAAD,EAAAK,IAACE,WAAQ,CACPC,QAASZ,EACTa,SAAUA,IAAMX,MACL,aAAA,2CACC,eAIjBD,EAAQa,KAAI,CAACC,EAAQC,IACpBZ,EAACK,IAAAD,qBACCS,MAAOF,EAAOE,OAAS,OACvBC,MAAOH,EAAOG,gBACHH,EAAOI,SAAQ,cAEI,iBAAAH,IAE9BX,SAAAD,EAAAK,IAACW,OAAI,CAACC,KAAK,QAAQC,MAAM,SACtBjB,SAAAU,EAAOQ,SAJL,iBAAiBP"}
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
${({align:e})=>`justify-content: ${e};`}
|
|
14
14
|
display: flex;
|
|
15
15
|
${({width:e})=>e?`\n width: ${e};\n `:"\n flex: 1;\n "}
|
|
16
|
-
min-width: ${({minWidth:e})=>e??void 0};
|
|
16
|
+
min-width: ${({$minWidth:e})=>e??void 0};
|
|
17
17
|
`;exports.TableHeaderColumn=i,exports.TableHeaderRow=n;
|
|
18
18
|
//# sourceMappingURL=table-head.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-head.styles.js","sources":["../../../../../src/components/layout/table-head/table-head.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor, getThemeSpacing } from '../../../theme'\nimport { CellAlign } from '../table/table.types'\nimport { TableRowSpacing } from '../table-row'\n\nexport const TableHeaderRow = styled.tr<{ spacing?: TableRowSpacing }>`\n background-color: ${({ theme }) => getThemeColor('grey_5', theme)};\n color: ${({ theme }) => getThemeColor('grey_3', theme)};\n width: 100%;\n min-height: 52px;\n\n ${({ spacing, theme }) => {\n if (spacing === 'small') {\n return `\n padding: ${getThemeSpacing(1, theme)} ${getThemeSpacing(2, theme)};\n min-height: 36px;\n `\n }\n\n return `\n padding: ${getThemeSpacing(2, theme)} ${getThemeSpacing(3, theme)};\n `\n }}\n\n display: flex;\n gap: ${({ theme }) => getThemeSpacing(3, theme)};\n`\n\nexport const TableHeaderColumn = styled.th<{\n align: CellAlign\n width?: string\n minWidth?: string\n}>`\n text-transform: none;\n ${({ align }) => `justify-content: ${align};`}\n display: flex;\n ${({ width }) => {\n if (width) {\n return `\n width: ${width};\n `\n }\n return `\n flex: 1;\n `\n }}\n min-width: ${({ minWidth }) => minWidth ?? undefined};\n`\n"],"names":["TableHeaderRow","styled","tr","theme","getThemeColor","spacing","getThemeSpacing","TableHeaderColumn","th","align","width","minWidth","undefined"],"mappings":"0FAMaA,MAAAA,EAAiBC,EAAMA,OAACC,EAAiC;sBAChD,EAAGC,WAAYC,EAAaA,cAAC,SAAUD;WAClD,EAAGA,WAAYC,EAAaA,cAAC,SAAUD;;;;IAI9C,EAAGE,UAASF,WACI,UAAZE,EACK,sBACMC,EAAeA,gBAAC,EAAGH,MAAUG,kBAAgB,EAAGH,yCAKxD,oBACMG,EAAeA,gBAAC,EAAGH,MAAUG,kBAAgB,EAAGH;;;SAKxD,EAAGA,WAAYG,EAAeA,gBAAC,EAAGH;EAG9BI,EAAoBN,EAAMA,OAACO,EAItC;;IAEE,EAAGC,WAAY,oBAAoBA;;IAEnC,EAAGC,WACCA,EACK,oBACIA,aAGN;eAII,EAAGC,
|
|
1
|
+
{"version":3,"file":"table-head.styles.js","sources":["../../../../../src/components/layout/table-head/table-head.styles.tsx"],"sourcesContent":["import { styled } from 'styled-components'\n\nimport { getThemeColor, getThemeSpacing } from '../../../theme'\nimport { CellAlign } from '../table/table.types'\nimport { TableRowSpacing } from '../table-row'\n\nexport const TableHeaderRow = styled.tr<{ spacing?: TableRowSpacing }>`\n background-color: ${({ theme }) => getThemeColor('grey_5', theme)};\n color: ${({ theme }) => getThemeColor('grey_3', theme)};\n width: 100%;\n min-height: 52px;\n\n ${({ spacing, theme }) => {\n if (spacing === 'small') {\n return `\n padding: ${getThemeSpacing(1, theme)} ${getThemeSpacing(2, theme)};\n min-height: 36px;\n `\n }\n\n return `\n padding: ${getThemeSpacing(2, theme)} ${getThemeSpacing(3, theme)};\n `\n }}\n\n display: flex;\n gap: ${({ theme }) => getThemeSpacing(3, theme)};\n`\n\nexport const TableHeaderColumn = styled.th<{\n align: CellAlign\n width?: string\n $minWidth?: string\n}>`\n text-transform: none;\n ${({ align }) => `justify-content: ${align};`}\n display: flex;\n ${({ width }) => {\n if (width) {\n return `\n width: ${width};\n `\n }\n return `\n flex: 1;\n `\n }}\n min-width: ${({ $minWidth }) => $minWidth ?? undefined};\n`\n"],"names":["TableHeaderRow","styled","tr","theme","getThemeColor","spacing","getThemeSpacing","TableHeaderColumn","th","align","width","$minWidth","undefined"],"mappings":"0FAMaA,MAAAA,EAAiBC,EAAMA,OAACC,EAAiC;sBAChD,EAAGC,WAAYC,EAAaA,cAAC,SAAUD;WAClD,EAAGA,WAAYC,EAAaA,cAAC,SAAUD;;;;IAI9C,EAAGE,UAASF,WACI,UAAZE,EACK,sBACMC,EAAeA,gBAAC,EAAGH,MAAUG,kBAAgB,EAAGH,yCAKxD,oBACMG,EAAeA,gBAAC,EAAGH,MAAUG,kBAAgB,EAAGH;;;SAKxD,EAAGA,WAAYG,EAAeA,gBAAC,EAAGH;EAG9BI,EAAoBN,EAAMA,OAACO,EAItC;;IAEE,EAAGC,WAAY,oBAAoBA;;IAEnC,EAAGC,WACCA,EACK,oBACIA,aAGN;eAII,EAAGC,eAAgBA,QAAaC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("../table/table.styles.js"),l=require("./table-row.styles.js"),a=require("../../forms/checkbox/checkbox.comp.js"),o=require("../box/box.comp.js");exports.TableRow=({data:r,headers:n,onSelect:c,selected:i,selectable:s,index:d,spacing:u,hoverable:b,onClick:h})=>{const x=e=>{if(e.includes(".")){const t=e.split(".");let l=r;for(const e of t)if(l=l[e],void 0===l)return l;return l}return r[e]};return e.jsxs(l.TableRow,{backgroundColor:r.backgroundColor,"data-testid":"table-row",spacing:u,$hoverable:Boolean(b||h),$clickable:Boolean(h),tabIndex:h?0:void 0,onClick:e=>{h&&!(e=>{const t=e.target.closest('button, a, input, select, textarea, label, [role="button"]');return Boolean(t&&e.currentTarget.contains(t))})(e)&&h(r,d)},onKeyDown:e=>{h&&e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h(r,d)))},children:[s&&e.jsx(t.SelectableColumn,{"data-testid":"selectable-column",children:e.jsx(a.Checkbox,{checked:i,onChange:()=>c?.(r),"aria-label":"Selecionar linha","data-testid":"checkbox"})}),n.map(((a,n)=>e.jsx(t.TableColumn,{$align:a.align||"left",width:a.width
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("../table/table.styles.js"),l=require("./table-row.styles.js"),a=require("../../forms/checkbox/checkbox.comp.js"),o=require("../box/box.comp.js");exports.TableRow=({data:r,headers:n,onSelect:c,selected:i,selectable:s,index:d,spacing:u,hoverable:b,onClick:h})=>{const x=e=>{if(e.includes(".")){const t=e.split(".");let l=r;for(const e of t)if(l=l[e],void 0===l)return l;return l}return r[e]};return e.jsxs(l.TableRow,{backgroundColor:r.backgroundColor,"data-testid":"table-row",spacing:u,$hoverable:Boolean(b||h),$clickable:Boolean(h),tabIndex:h?0:void 0,onClick:e=>{h&&!(e=>{const t=e.target.closest('button, a, input, select, textarea, label, [role="button"]');return Boolean(t&&e.currentTarget.contains(t))})(e)&&h(r,d)},onKeyDown:e=>{h&&e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h(r,d)))},children:[s&&e.jsx(t.SelectableColumn,{"data-testid":"selectable-column",children:e.jsx(a.Checkbox,{checked:i,onChange:()=>c?.(r),"aria-label":"Selecionar linha","data-testid":"checkbox"})}),n.map(((a,n)=>e.jsx(t.TableColumn,{$align:a.align||"left",width:a.width,$minWidth:a.minWidth,"data-label":a.label,children:a.customRender?e.jsx(o.Box,{width:"100%",height:"100%","data-testid":"custom-column",children:a.customRender(r,d)}):e.jsx(l.CellText,{size:"small",color:"grey_1",align:a.align,children:x(a.key)})},`column-${n}`)))]})};
|
|
2
2
|
//# sourceMappingURL=table-row.comp.js.map
|