vpt-sebraeds 0.0.76 → 0.0.78
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/LICENSE +20 -20
- package/README.md +225 -225
- package/components/Accordion/Accordion.stories.jsx +143 -143
- package/components/Accordion/README.md +144 -144
- package/components/Accordion/index.jsx +334 -334
- package/components/AccordionAvatar/AccordionAvatar.stories.jsx +27 -27
- package/components/AccordionAvatar/index.jsx +94 -94
- package/components/AdBanner/AdBanner.stories.jsx +62 -62
- package/components/AdBanner/index.jsx +92 -92
- package/components/Avatar/Avatar.stories.jsx +59 -59
- package/components/Avatar/index.jsx +102 -102
- package/components/Banner/Banner.stories.jsx +127 -127
- package/components/Banner/index.jsx +70 -70
- package/components/BottomSheet/BottomSheet.jsx +235 -235
- package/components/BottomSheet/BottomSheet.stories.jsx +541 -541
- package/components/BottomSheet/BottomSheetNomeEmpresa.jsx +110 -110
- package/components/BottomSheet/Components/ActionButtons.jsx +91 -91
- package/components/BottomSheet/Components/ListaDeEstados.jsx +337 -337
- package/components/BottomSheet/index.jsx +1 -1
- package/components/Breadcrumb/Breadcrumb.stories.jsx +62 -62
- package/components/Breadcrumb/index.jsx +88 -88
- package/components/Bullet/Bullet.stories.jsx +55 -55
- package/components/Bullet/index.jsx +224 -224
- package/components/Button/ButtonPrimary.stories.jsx +372 -372
- package/components/Button/index.jsx +528 -528
- package/components/ButtonGroup/ButtonGroup.stories.jsx +431 -383
- package/components/ButtonGroup/index.tsx +516 -439
- package/components/CNAESelectItem/CNAESelectItem.stories.jsx +195 -195
- package/components/CNAESelectItem/index.jsx +259 -259
- package/components/CNAESelectItem/padrao.js +1145 -1145
- package/components/CardNumber/CardNumber.stories.jsx +60 -60
- package/components/CardNumber/index.jsx +136 -136
- package/components/Checkbox/Checkbox.stories.jsx +70 -70
- package/components/Checkbox/index.jsx +125 -125
- package/components/CommitmentCard/CommitmentCard.stories.jsx +282 -282
- package/components/CommitmentCard/index.jsx +227 -227
- package/components/ContentBlock/ContentBlock.stories.tsx +48 -48
- package/components/ContentBlock/ContentBlock.tsx +50 -50
- package/components/ContentCard/ContentCard.stories.jsx +130 -130
- package/components/ContentCard/index.jsx +326 -326
- package/components/ContentRelatedCard/ContentRelatedCard.stories.jsx +79 -79
- package/components/ContentRelatedCard/index.jsx +79 -79
- package/components/ContentSlot/ContentSlot.stories.jsx +276 -276
- package/components/ContentSlot/index.jsx +196 -196
- package/components/CopyButton/CopyButton.stories.jsx +110 -110
- package/components/CopyButton/index.jsx +192 -192
- package/components/Datepicker/Datepicker.stories.jsx +291 -239
- package/components/Datepicker/MonthSelector.jsx +323 -323
- package/components/Datepicker/TimeSelector.jsx +261 -261
- package/components/Datepicker/index.jsx +815 -454
- package/components/DonutChart/DonutChart.stories.jsx +221 -221
- package/components/DonutChart/index.jsx +191 -191
- package/components/Dropdown/Dropdown.stories.jsx +331 -331
- package/components/Dropdown/index.jsx +556 -556
- package/components/DropdownCommitments/index.js +149 -149
- package/components/EmptySlot/EmptySlot.stories.jsx +114 -114
- package/components/EmptySlot/index.jsx +152 -152
- package/components/EventListItem/EventListItem.stories.tsx +179 -179
- package/components/EventListItem/index.tsx +532 -514
- package/components/ExpandableNumberDisplay/ExpandableNumberDisplay.stories.jsx +92 -92
- package/components/ExpandableNumberDisplay/index.tsx +126 -126
- package/components/FilterTag/FilterTag.stories.jsx +54 -54
- package/components/FilterTag/index.jsx +69 -69
- package/components/FilterableMultiSelect/FilterableMultiSelect.stories.jsx +63 -63
- package/components/FilterableMultiSelect/index.jsx +207 -207
- package/components/FilterableUniSelect/FilterableUniSelect.stories.jsx +68 -68
- package/components/FilterableUniSelect/index.jsx +251 -251
- package/components/GeneralInformationCard/GeneralInformationCard.stories.jsx +62 -62
- package/components/GeneralInformationCard/index.tsx +123 -123
- package/components/GettingStarted.jsx +38 -38
- package/components/Header/Header.stories.jsx +1075 -1008
- package/components/Header/HeaderV2.stories.jsx +1200 -1113
- package/components/Header/index.jsx +5 -5
- package/components/Header/v1/components/Context.jsx +32 -32
- package/components/Header/v1/components/Information.jsx +109 -107
- package/components/Header/v1/components/Shortcut.jsx +45 -45
- package/components/Header/v1/components/SwitchAccount.jsx +301 -211
- package/components/Header/v1/components/Variants.jsx +479 -478
- package/components/Header/v1/components/index.jsx +12 -12
- package/components/Header/v1/index.jsx +195 -195
- package/components/Header/v2/README.md +757 -724
- package/components/Header/v2/index.jsx +224 -219
- package/components/Header/v2/parts/BackButton.jsx +36 -36
- package/components/Header/v2/parts/Context.jsx +25 -25
- package/components/Header/v2/parts/Hero.jsx +68 -59
- package/components/Header/v2/parts/Information.jsx +68 -66
- package/components/Header/v2/parts/Shortcut.jsx +39 -39
- package/components/Header/v2/parts/SwitchAccount.jsx +381 -290
- package/components/Header/v2/parts/Variants.jsx +420 -353
- package/components/Header/v2/parts/index.jsx +22 -22
- package/components/Header/v2/styles.js +598 -598
- package/components/Icon/iconEnums.ts +285 -285
- package/components/Icon/index.jsx +38 -38
- package/components/Image/Image.stories.jsx +250 -250
- package/components/Image/index.jsx +175 -175
- package/components/Input/Input.stories.jsx +394 -394
- package/components/Input/InputUnderline.tsx +161 -161
- package/components/Input/index.jsx +305 -305
- package/components/Legend/Legend.stories.jsx +110 -110
- package/components/Legend/index.jsx +87 -87
- package/components/Link/Link.stories.jsx +78 -78
- package/components/Link/index.jsx +66 -66
- package/components/List/List.stories.jsx +57 -57
- package/components/List/index.jsx +64 -64
- package/components/ListItem/ListItem.stories.jsx +179 -179
- package/components/ListItem/index.jsx +532 -532
- package/components/MenuAccordion/MenuAccordion.stories.jsx +27 -27
- package/components/MenuAccordion/index.jsx +98 -98
- package/components/Modal/Modal.stories.jsx +151 -151
- package/components/Modal/index.jsx +249 -249
- package/components/Navbar/Navbar.stories.jsx +244 -244
- package/components/Navbar/index.jsx +130 -130
- package/components/NavigationItem/NavigationItem.stories.tsx +483 -454
- package/components/NavigationItem/index.tsx +792 -524
- package/components/NotificationBanner/NotificationBanner.stories.jsx +57 -57
- package/components/NotificationBanner/index.jsx +154 -154
- package/components/NotificationCard/NotificationCard.stories.jsx +93 -93
- package/components/NotificationCard/index.jsx +338 -338
- package/components/NotificationDialog/NotificationDialog.stories.jsx +205 -205
- package/components/NotificationDialog/README.md +104 -104
- package/components/NotificationDialog/index.jsx +283 -283
- package/components/NumberDisplay/NumberDisplay.stories.jsx +339 -339
- package/components/NumberDisplay/index.jsx +483 -483
- package/components/Pagination/Pagination.stories.jsx +170 -170
- package/components/Pagination/index.jsx +229 -229
- package/components/ProgressBar/ProgressBar.stories.jsx +355 -355
- package/components/ProgressBar/index.jsx +91 -91
- package/components/ProgressChart/ProgressChart.stories.jsx +312 -312
- package/components/ProgressChart/index.jsx +193 -193
- package/components/Quote/Quote.stories.tsx +32 -32
- package/components/Quote/Quote.tsx +60 -60
- package/components/RadioButton/RadioButton.stories.jsx +112 -112
- package/components/RadioButton/index.jsx +114 -114
- package/components/RangeSlider/RangeSlider.stories.jsx +165 -165
- package/components/RangeSlider/index.tsx +255 -255
- package/components/Rating/Rating.stories.jsx +196 -196
- package/components/Rating/index.jsx +187 -187
- package/components/SEIcon/CustomIcon/boletoDasMei.jsx +25 -25
- package/components/SEIcon/CustomIcon/calculadoraPrecoIdeal.jsx +22 -22
- package/components/SEIcon/CustomIcon/calculadoraValuation.jsx +21 -21
- package/components/SEIcon/CustomIcon/capacidadePagamento.jsx +22 -22
- package/components/SEIcon/CustomIcon/capitalGiro.jsx +22 -22
- package/components/SEIcon/CustomIcon/catalogoFornecedores.jsx +22 -22
- package/components/SEIcon/CustomIcon/creditoPermutas.jsx +22 -22
- package/components/SEIcon/CustomIcon/dataValidadeEpi.jsx +25 -25
- package/components/SEIcon/CustomIcon/diagnosticoEstrategico.jsx +22 -22
- package/components/SEIcon/CustomIcon/dominandoRedesSociais.jsx +22 -22
- package/components/SEIcon/CustomIcon/empresaGoogle.jsx +22 -22
- package/components/SEIcon/CustomIcon/fluxoCaixa.jsx +22 -22
- package/components/SEIcon/CustomIcon/fornecedoresTi.jsx +22 -22
- package/components/SEIcon/CustomIcon/geradoresIdeiasIA.jsx +25 -25
- package/components/SEIcon/CustomIcon/gestaoAgendamento.jsx +22 -22
- package/components/SEIcon/CustomIcon/impostoMei.jsx +22 -22
- package/components/SEIcon/CustomIcon/indicadorPorRegiao.jsx +27 -27
- package/components/SEIcon/CustomIcon/indicadoresMercado.jsx +25 -25
- package/components/SEIcon/CustomIcon/listaEpi.jsx +22 -22
- package/components/SEIcon/CustomIcon/lucroPotencial.jsx +24 -24
- package/components/SEIcon/CustomIcon/melhoresRegioesComerciais.jsx +24 -24
- package/components/SEIcon/CustomIcon/ncmComCodigoDeBarras.jsx +25 -25
- package/components/SEIcon/CustomIcon/pesquisaRegistroDeMarca.jsx +23 -23
- package/components/SEIcon/CustomIcon/planoNegocios.jsx +23 -23
- package/components/SEIcon/CustomIcon/postsInteligentes.jsx +24 -24
- package/components/SEIcon/CustomIcon/sebraeConecta.jsx +25 -25
- package/components/SEIcon/CustomIcon/segurancaTrabalho.jsx +25 -25
- package/components/SEIcon/CustomIcon/simuladorEmprestimo.jsx +22 -22
- package/components/SEIcon/SEIcon.stories.jsx +211 -211
- package/components/SEIcon/index.js +114 -114
- package/components/SEText/index.d.ts +74 -74
- package/components/SEText/index.js +171 -171
- package/components/SEText/styles.js +348 -348
- package/components/ScrollBar/ScrollBar.stories.tsx +65 -65
- package/components/ScrollBar/index.tsx +139 -139
- package/components/Search/Search.stories.jsx +161 -161
- package/components/Search/index.jsx +267 -267
- package/components/SegmentedButton/SegmentedButton.stories.jsx +274 -274
- package/components/SegmentedButton/index.jsx +195 -195
- package/components/Select/Select.stories.jsx +415 -415
- package/components/Select/index.jsx +321 -321
- package/components/SelectItem/SelectItem.stories.jsx +609 -609
- package/components/SelectItem/index.jsx +174 -174
- package/components/Shortcut/Shortcut.stories.jsx +202 -202
- package/components/Shortcut/index.jsx +294 -294
- package/components/ShowMore/ShowMore.stories.jsx +70 -70
- package/components/ShowMore/index.jsx +68 -68
- package/components/ShuffleItem/ShuffleItem.stories.jsx +278 -278
- package/components/ShuffleItem/index.jsx +723 -723
- package/components/Slider/Slider.stories.jsx +248 -248
- package/components/Slider/index.jsx +211 -211
- package/components/Tab/Tab.stories.jsx +323 -323
- package/components/Tab/index.jsx +483 -483
- package/components/Table/Table.stories.jsx +253 -253
- package/components/Table/index.jsx +432 -432
- package/components/Tag/Tag.stories.jsx +78 -78
- package/components/Tag/index.d.ts +10 -10
- package/components/Tag/index.jsx +129 -129
- package/components/TaggedInputText/TaggedInputText.stories.jsx +106 -106
- package/components/TaggedInputText/index.jsx +232 -232
- package/components/TaskCard/TaskCard.stories.jsx +468 -468
- package/components/TaskCard/assets/README.md +22 -22
- package/components/TaskCard/assets/example.js +10 -10
- package/components/TaskCard/components/EditIcon.jsx +78 -78
- package/components/TaskCard/components/SuccessContent.jsx +52 -52
- package/components/TaskCard/components/SuccessIcon.jsx +52 -52
- package/components/TaskCard/components/SuccessTitle.jsx +49 -49
- package/components/TaskCard/components/Tag.jsx +80 -80
- package/components/TaskCard/components/TagGroup.jsx +60 -60
- package/components/TaskCard/components/TaskDescription.jsx +51 -51
- package/components/TaskCard/components/index.js +7 -7
- package/components/TaskCard/index.jsx +317 -317
- package/components/Toast/Toast.stories.jsx +316 -316
- package/components/Toast/index.jsx +386 -386
- package/components/Toggle/Toggle.stories.jsx +161 -161
- package/components/Toggle/index.jsx +145 -145
- package/components/Tools/NavigationButton/NavigationButton.stories.jsx +140 -140
- package/components/Tools/NavigationButton/index.jsx +341 -341
- package/components/Tools/SearchResult/SearchResult.stories.jsx +112 -112
- package/components/Tools/SearchResult/index.jsx +106 -106
- package/components/TooltipCard/TooltipCard.stories.jsx +88 -88
- package/components/TooltipCard/index.jsx +355 -355
- package/components/Typography/Typography.stories.jsx +262 -262
- package/components/Typography/index.jsx +137 -137
- package/components/styles/colors.js +204 -204
- package/components/styles/fonts.js +15 -15
- package/components/styles/index,js +7 -7
- package/components/styles/metrics.js +13 -13
- package/components/styles/tokens.ts +222 -222
- package/components/styles.ts +79 -79
- package/components/utils/fontFamily.js +6 -6
- package/dist/components/Accordion/index.js +32 -32
- package/dist/components/AccordionAvatar/index.js +19 -19
- package/dist/components/AdBanner/index.js +12 -12
- package/dist/components/Avatar/index.js +6 -6
- package/dist/components/Banner/index.js +5 -5
- package/dist/components/BottomSheet/BottomSheet.js +31 -31
- package/dist/components/BottomSheet/BottomSheetNomeEmpresa.js +21 -21
- package/dist/components/BottomSheet/Components/ActionButtons.js +13 -13
- package/dist/components/BottomSheet/Components/ListaDeEstados.js +10 -10
- package/dist/components/Breadcrumb/index.js +7 -7
- package/dist/components/Bullet/index.js +14 -14
- package/dist/components/ButtomGroup/index.js +21 -21
- package/dist/components/Button/index.js +15 -15
- package/dist/components/ButtonGroup/index.d.ts +4 -2
- package/dist/components/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/ButtonGroup/index.js +68 -25
- package/dist/components/CNAESelectItem/index.js +54 -54
- package/dist/components/CNAESelectItem/padrao.js +213 -213
- package/dist/components/CardNumber/index.js +16 -16
- package/dist/components/Checkbox/index.js +7 -7
- package/dist/components/CommitmentCard/index.js +30 -30
- package/dist/components/ContentBlock/ContentBlock.js +7 -7
- package/dist/components/ContentCard/index.js +50 -50
- package/dist/components/ContentRelatedCard/index.js +10 -10
- package/dist/components/ContentSlot/index.js +31 -31
- package/dist/components/CopyButton/index.js +5 -5
- package/dist/components/Datepicker/MonthSelector.js +13 -13
- package/dist/components/Datepicker/TimeSelector.js +15 -15
- package/dist/components/Datepicker/index.d.ts.map +1 -1
- package/dist/components/Datepicker/index.js +485 -149
- package/dist/components/DonutChart/index.js +19 -19
- package/dist/components/Dropdown/index.js +66 -66
- package/dist/components/DropdownCommitments/index.js +24 -24
- package/dist/components/EmptySlot/index.js +19 -19
- package/dist/components/EventListItem/index.d.ts.map +1 -1
- package/dist/components/EventListItem/index.js +61 -43
- package/dist/components/ExpandableNumberDisplay/index.js +19 -19
- package/dist/components/FilterTag/index.js +7 -7
- package/dist/components/FilterableMultiSelect/index.js +29 -29
- package/dist/components/FilterableUniSelect/index.js +33 -33
- package/dist/components/GeneralInformationCard/index.js +24 -24
- package/dist/components/GettingStarted.js +8 -8
- package/dist/components/Header/components/Context.d.ts +7 -7
- package/dist/components/Header/components/Context.js +21 -21
- package/dist/components/Header/components/Information.d.ts +6 -6
- package/dist/components/Header/components/Information.js +72 -72
- package/dist/components/Header/components/Shortcut.d.ts +5 -5
- package/dist/components/Header/components/Shortcut.js +25 -25
- package/dist/components/Header/components/SwitchAccount.d.ts +8 -8
- package/dist/components/Header/components/SwitchAccount.js +170 -170
- package/dist/components/Header/components/Variants.d.ts +22 -22
- package/dist/components/Header/components/Variants.js +371 -371
- package/dist/components/Header/components/index.d.ts +33 -33
- package/dist/components/Header/components/index.js +10 -10
- package/dist/components/Header/v1/components/Context.js +2 -2
- package/dist/components/Header/v1/components/Information.d.ts +2 -1
- package/dist/components/Header/v1/components/Information.d.ts.map +1 -1
- package/dist/components/Header/v1/components/Information.js +16 -15
- package/dist/components/Header/v1/components/SwitchAccount.d.ts +2 -1
- package/dist/components/Header/v1/components/SwitchAccount.d.ts.map +1 -1
- package/dist/components/Header/v1/components/SwitchAccount.js +124 -42
- package/dist/components/Header/v1/components/Variants.d.ts.map +1 -1
- package/dist/components/Header/v1/components/Variants.js +84 -84
- package/dist/components/Header/v1/index.js +5 -5
- package/dist/components/Header/v2/index.js +11 -6
- package/dist/components/Header/v2/parts/BackButton.js +2 -2
- package/dist/components/Header/v2/parts/Context.js +2 -2
- package/dist/components/Header/v2/parts/Hero.d.ts +2 -1
- package/dist/components/Header/v2/parts/Hero.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/Hero.js +14 -10
- package/dist/components/Header/v2/parts/Information.d.ts +2 -1
- package/dist/components/Header/v2/parts/Information.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/Information.js +14 -13
- package/dist/components/Header/v2/parts/SwitchAccount.d.ts +2 -1
- package/dist/components/Header/v2/parts/SwitchAccount.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/SwitchAccount.js +147 -66
- package/dist/components/Header/v2/parts/Variants.d.ts +21 -0
- package/dist/components/Header/v2/parts/Variants.d.ts.map +1 -1
- package/dist/components/Header/v2/parts/Variants.js +188 -148
- package/dist/components/Header/v2/parts/index.d.ts +18 -0
- package/dist/components/Image/index.js +22 -22
- package/dist/components/Input/InputUnderline.js +7 -7
- package/dist/components/Input/index.js +14 -14
- package/dist/components/Legend/index.js +8 -8
- package/dist/components/Link/index.js +7 -7
- package/dist/components/List/index.js +7 -7
- package/dist/components/ListItem/index.js +74 -74
- package/dist/components/MenuAccordion/index.js +21 -21
- package/dist/components/Modal/index.js +38 -38
- package/dist/components/Navbar/index.js +9 -9
- package/dist/components/NavigationItem/index.d.ts +73 -10
- package/dist/components/NavigationItem/index.d.ts.map +1 -1
- package/dist/components/NavigationItem/index.js +300 -145
- package/dist/components/NotificationBanner/index.js +8 -8
- package/dist/components/NotificationCard/index.js +41 -41
- package/dist/components/NotificationDialog/index.js +46 -46
- package/dist/components/NumberDisplay/index.js +24 -24
- package/dist/components/Pagination/index.js +23 -23
- package/dist/components/ProgressBar/index.js +14 -14
- package/dist/components/ProgressChart/index.js +29 -29
- package/dist/components/Quote/Quote.js +9 -9
- package/dist/components/RadioButton/index.js +7 -7
- package/dist/components/RangeSlider/index.js +32 -32
- package/dist/components/Rating/index.js +16 -16
- package/dist/components/SEIcon/CustomIcon/boletoDasMei.js +6 -6
- package/dist/components/SEIcon/CustomIcon/calculadoraPrecoIdeal.js +3 -3
- package/dist/components/SEIcon/CustomIcon/calculadoraValuation.js +3 -3
- package/dist/components/SEIcon/CustomIcon/capacidadePagamento.js +3 -3
- package/dist/components/SEIcon/CustomIcon/capitalGiro.js +3 -3
- package/dist/components/SEIcon/CustomIcon/catalogoFornecedores.js +3 -3
- package/dist/components/SEIcon/CustomIcon/creditoPermutas.js +3 -3
- package/dist/components/SEIcon/CustomIcon/dataValidadeEpi.js +6 -6
- package/dist/components/SEIcon/CustomIcon/diagnosticoEstrategico.js +3 -3
- package/dist/components/SEIcon/CustomIcon/dominandoRedesSociais.js +3 -3
- package/dist/components/SEIcon/CustomIcon/empresaGoogle.js +3 -3
- package/dist/components/SEIcon/CustomIcon/fluxoCaixa.js +3 -3
- package/dist/components/SEIcon/CustomIcon/fornecedoresTi.js +3 -3
- package/dist/components/SEIcon/CustomIcon/geradoresIdeiasIA.js +6 -6
- package/dist/components/SEIcon/CustomIcon/gestaoAgendamento.js +3 -3
- package/dist/components/SEIcon/CustomIcon/impostoMei.js +3 -3
- package/dist/components/SEIcon/CustomIcon/indicadorPorRegiao.js +6 -6
- package/dist/components/SEIcon/CustomIcon/indicadoresMercado.js +6 -6
- package/dist/components/SEIcon/CustomIcon/listaEpi.js +3 -3
- package/dist/components/SEIcon/CustomIcon/lucroPotencial.js +6 -6
- package/dist/components/SEIcon/CustomIcon/melhoresRegioesComerciais.js +6 -6
- package/dist/components/SEIcon/CustomIcon/ncmComCodigoDeBarras.js +6 -6
- package/dist/components/SEIcon/CustomIcon/pesquisaRegistroDeMarca.js +3 -3
- package/dist/components/SEIcon/CustomIcon/planoNegocios.js +3 -3
- package/dist/components/SEIcon/CustomIcon/postsInteligentes.js +6 -6
- package/dist/components/SEIcon/CustomIcon/sebraeConecta.js +6 -6
- package/dist/components/SEIcon/CustomIcon/segurancaTrabalho.js +6 -6
- package/dist/components/SEIcon/CustomIcon/simuladorEmprestimo.js +3 -3
- package/dist/components/SEText/index.js +2 -2
- package/dist/components/ScrollBar/index.js +8 -8
- package/dist/components/Search/Search.d.ts +14 -14
- package/dist/components/Search/Search.js +272 -272
- package/dist/components/Search/index.js +17 -17
- package/dist/components/SegmentedButton/index.js +10 -10
- package/dist/components/Select/index.js +16 -16
- package/dist/components/SelectItem/index.js +6 -6
- package/dist/components/Shortcut/index.js +14 -14
- package/dist/components/ShowMore/index.js +7 -7
- package/dist/components/ShuffleItem/index.js +98 -98
- package/dist/components/Slider/index.js +20 -20
- package/dist/components/Tab/index.js +26 -26
- package/dist/components/Table/index.js +35 -35
- package/dist/components/Tag/index.js +5 -5
- package/dist/components/TaggedInputText/index.js +20 -20
- package/dist/components/TaskCard/assets/README.md +22 -22
- package/dist/components/TaskCard/assets/example.js +10 -10
- package/dist/components/TaskCard/components/EditIcon.js +2 -2
- package/dist/components/TaskCard/components/SuccessContent.js +3 -3
- package/dist/components/TaskCard/components/SuccessIcon.js +2 -2
- package/dist/components/TaskCard/components/SuccessTitle.js +2 -2
- package/dist/components/TaskCard/components/Tag.js +4 -4
- package/dist/components/TaskCard/components/TagGroup.js +4 -4
- package/dist/components/TaskCard/components/TaskDescription.js +2 -2
- package/dist/components/TaskCard/index.js +51 -51
- package/dist/components/Toast/index.js +36 -36
- package/dist/components/Toggle/index.js +3 -3
- package/dist/components/Tools/NavigationButton/index.js +53 -53
- package/dist/components/Tools/SearchResult/index.js +19 -19
- package/dist/components/TooltipCard/index.js +46 -46
- package/dist/components/Typography/index.js +2 -2
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -0
- package/package.json +124 -124
- package/src/index.ts +107 -100
|
@@ -1,334 +1,334 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect, useContext, createContext } from 'react';
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform, UIManager } from 'react-native';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import Icon from '../Icon';
|
|
5
|
-
import SEText from '../SEText';
|
|
6
|
-
import colors from '../styles/colors';
|
|
7
|
-
|
|
8
|
-
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
9
|
-
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const AccordionContext = createContext();
|
|
13
|
-
|
|
14
|
-
const useAccordion = () => {
|
|
15
|
-
const context = useContext(AccordionContext);
|
|
16
|
-
if (!context) {
|
|
17
|
-
throw new Error('Accordion compound components must be used within an Accordion');
|
|
18
|
-
}
|
|
19
|
-
return context;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const Accordion = ({
|
|
23
|
-
children,
|
|
24
|
-
initiallyOpen = false,
|
|
25
|
-
onToggle,
|
|
26
|
-
style,
|
|
27
|
-
// Backward compatibility props
|
|
28
|
-
title,
|
|
29
|
-
content,
|
|
30
|
-
contentBackgroundColor,
|
|
31
|
-
...props
|
|
32
|
-
}) => {
|
|
33
|
-
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
34
|
-
const animation = useRef(new Animated.Value(initiallyOpen ? 1 : 0)).current;
|
|
35
|
-
|
|
36
|
-
const toggle = () => {
|
|
37
|
-
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
38
|
-
setIsOpen(!isOpen);
|
|
39
|
-
onToggle && onToggle(!isOpen);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
Animated.timing(animation, {
|
|
44
|
-
toValue: isOpen ? 1 : 0,
|
|
45
|
-
duration: 300,
|
|
46
|
-
useNativeDriver: false,
|
|
47
|
-
}).start();
|
|
48
|
-
}, [isOpen]);
|
|
49
|
-
|
|
50
|
-
const value = { isOpen, toggle, animation };
|
|
51
|
-
|
|
52
|
-
// Backward compatibility render
|
|
53
|
-
if (title || content) {
|
|
54
|
-
return (
|
|
55
|
-
<AccordionContext.Provider value={value}>
|
|
56
|
-
<View style={[styles.container, style]}>
|
|
57
|
-
<AccordionHeader title={title} {...props} />
|
|
58
|
-
<AccordionContent backgroundColor={contentBackgroundColor}>{content}</AccordionContent>
|
|
59
|
-
</View>
|
|
60
|
-
</AccordionContext.Provider>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<AccordionContext.Provider value={value}>
|
|
66
|
-
<View style={[styles.container, style]}>
|
|
67
|
-
{children}
|
|
68
|
-
</View>
|
|
69
|
-
</AccordionContext.Provider>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const AccordionHeader = ({
|
|
74
|
-
children,
|
|
75
|
-
title,
|
|
76
|
-
variant = 'default', // 'default', 'success', 'alert', 'error'
|
|
77
|
-
overline,
|
|
78
|
-
label,
|
|
79
|
-
icon,
|
|
80
|
-
backgroundColor = '#F7F9FF',
|
|
81
|
-
style,
|
|
82
|
-
titleStyle: customTitleStyle,
|
|
83
|
-
...props
|
|
84
|
-
}) => {
|
|
85
|
-
const { isOpen, toggle, animation } = useAccordion();
|
|
86
|
-
|
|
87
|
-
const rotateArrow = animation.interpolate({
|
|
88
|
-
inputRange: [0, 1],
|
|
89
|
-
outputRange: ['0deg', '180deg'],
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const getVariantStyles = () => {
|
|
93
|
-
switch (variant) {
|
|
94
|
-
case 'success':
|
|
95
|
-
return { ...styles.headerSuccess, backgroundColor: backgroundColor || styles.headerSuccess.backgroundColor };
|
|
96
|
-
case 'alert':
|
|
97
|
-
return { ...styles.headerAlert, backgroundColor: backgroundColor || styles.headerAlert.backgroundColor };
|
|
98
|
-
case 'error':
|
|
99
|
-
return { ...styles.headerError, backgroundColor: backgroundColor || styles.headerError.backgroundColor };
|
|
100
|
-
default:
|
|
101
|
-
return { ...styles.headerDefault, backgroundColor: backgroundColor || styles.headerDefault.backgroundColor };
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const getIconColor = () => {
|
|
106
|
-
switch (variant) {
|
|
107
|
-
case 'success':
|
|
108
|
-
return colors.GREEN_DARK; // #037A1C
|
|
109
|
-
case 'alert':
|
|
110
|
-
return "#AB6005"
|
|
111
|
-
case 'error':
|
|
112
|
-
return colors.RED; // #d62828
|
|
113
|
-
default:
|
|
114
|
-
return colors.SE_TEXT_DARK;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const getIconContainerBackgroundColor = () => {
|
|
119
|
-
switch (variant) {
|
|
120
|
-
case 'success':
|
|
121
|
-
return '#C2EFD1';
|
|
122
|
-
case 'alert':
|
|
123
|
-
return '#FEEBC8';
|
|
124
|
-
case 'error':
|
|
125
|
-
return '#FCD5D5';
|
|
126
|
-
default:
|
|
127
|
-
return 'transparent';
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const getTextColor = () => "#485274";
|
|
132
|
-
|
|
133
|
-
const isTransparent = !backgroundColor || backgroundColor === 'transparent' ||
|
|
134
|
-
backgroundColor.toLowerCase() === '#ffffff' || backgroundColor.toLowerCase() === '#fff' ||
|
|
135
|
-
backgroundColor.toLowerCase() === 'white';
|
|
136
|
-
|
|
137
|
-
// Custom Icon Logic
|
|
138
|
-
const renderLeadingIcon = () => {
|
|
139
|
-
if (icon) return <Icon name={icon} size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
140
|
-
|
|
141
|
-
switch (variant) {
|
|
142
|
-
case 'success':
|
|
143
|
-
return <Icon name="check-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
144
|
-
case 'alert':
|
|
145
|
-
return <Icon name="alert-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
146
|
-
case 'error':
|
|
147
|
-
return <Icon name="error-warning-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
148
|
-
default:
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
return (
|
|
154
|
-
<TouchableOpacity
|
|
155
|
-
style={[
|
|
156
|
-
styles.header,
|
|
157
|
-
getVariantStyles(),
|
|
158
|
-
isOpen && styles.headerOpen,
|
|
159
|
-
isTransparent && !isOpen && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
|
|
160
|
-
style
|
|
161
|
-
]}
|
|
162
|
-
onPress={toggle}
|
|
163
|
-
activeOpacity={0.7}
|
|
164
|
-
{...props}
|
|
165
|
-
>
|
|
166
|
-
<View style={styles.headerContent}>
|
|
167
|
-
<View style={[styles.leadingIconContainer, { backgroundColor: getIconContainerBackgroundColor() }]}>
|
|
168
|
-
{renderLeadingIcon()}
|
|
169
|
-
</View>
|
|
170
|
-
|
|
171
|
-
<View style={styles.textContainer}>
|
|
172
|
-
{overline && (
|
|
173
|
-
<SEText style={[styles.overline, { color: getTextColor() }]}>
|
|
174
|
-
{overline}
|
|
175
|
-
</SEText>
|
|
176
|
-
)}
|
|
177
|
-
{label ? (
|
|
178
|
-
<SEText style={[styles.label, { color: getTextColor(), fontSize: 24, lineHeight: 32 }]} type="ns-heading-1">
|
|
179
|
-
{label}
|
|
180
|
-
</SEText>
|
|
181
|
-
) : (
|
|
182
|
-
<SEText style={[styles.title, { color: getTextColor() }, customTitleStyle]} type="ns-heading-5">
|
|
183
|
-
{title || children}
|
|
184
|
-
</SEText>
|
|
185
|
-
)}
|
|
186
|
-
</View>
|
|
187
|
-
</View>
|
|
188
|
-
|
|
189
|
-
<Animated.View style={{ transform: [{ rotate: rotateArrow }] }}>
|
|
190
|
-
<Icon name="arrow-down-s-line" size={24} color="#485274" />
|
|
191
|
-
</Animated.View>
|
|
192
|
-
</TouchableOpacity>
|
|
193
|
-
);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const AccordionContent = ({ children, style, backgroundColor, ...props }) => {
|
|
197
|
-
const { isOpen } = useAccordion();
|
|
198
|
-
|
|
199
|
-
if (!isOpen) return null;
|
|
200
|
-
|
|
201
|
-
const isTransparent = !backgroundColor || backgroundColor === 'transparent' ||
|
|
202
|
-
backgroundColor.toLowerCase() === '#ffffff' || backgroundColor.toLowerCase() === '#fff' ||
|
|
203
|
-
backgroundColor.toLowerCase() === 'white';
|
|
204
|
-
|
|
205
|
-
return (
|
|
206
|
-
<View
|
|
207
|
-
style={[
|
|
208
|
-
styles.content,
|
|
209
|
-
styles.contentOpen,
|
|
210
|
-
backgroundColor && { backgroundColor },
|
|
211
|
-
isTransparent && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
|
|
212
|
-
style
|
|
213
|
-
]}
|
|
214
|
-
{...props}
|
|
215
|
-
>
|
|
216
|
-
{children}
|
|
217
|
-
</View>
|
|
218
|
-
);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const styles = StyleSheet.create({
|
|
222
|
-
container: {
|
|
223
|
-
overflow: 'hidden',
|
|
224
|
-
marginBottom: 8,
|
|
225
|
-
},
|
|
226
|
-
header: {
|
|
227
|
-
flexDirection: 'row',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
justifyContent: 'space-between',
|
|
230
|
-
paddingVertical: 16,
|
|
231
|
-
paddingHorizontal: 16,
|
|
232
|
-
borderRadius: 8,
|
|
233
|
-
backgroundColor: '#F7F9FF', // Default
|
|
234
|
-
},
|
|
235
|
-
headerOpen: {
|
|
236
|
-
borderBottomLeftRadius: 0,
|
|
237
|
-
borderBottomRightRadius: 0,
|
|
238
|
-
},
|
|
239
|
-
headerContent: {
|
|
240
|
-
flexDirection: 'row',
|
|
241
|
-
alignItems: 'center',
|
|
242
|
-
flex: 1,
|
|
243
|
-
},
|
|
244
|
-
leadingIconContainer: {
|
|
245
|
-
padding: 4,
|
|
246
|
-
borderRadius: 20,
|
|
247
|
-
marginRight: 12,
|
|
248
|
-
},
|
|
249
|
-
leadingIcon: {
|
|
250
|
-
// marginRight: 12, // Removed
|
|
251
|
-
},
|
|
252
|
-
textContainer: {
|
|
253
|
-
flex: 1,
|
|
254
|
-
justifyContent: 'center',
|
|
255
|
-
},
|
|
256
|
-
title: {
|
|
257
|
-
fontFamily: 'Nunito Sans',
|
|
258
|
-
},
|
|
259
|
-
overline: {
|
|
260
|
-
fontSize: 12,
|
|
261
|
-
fontFamily: 'Nunito Sans',
|
|
262
|
-
marginBottom: 4,
|
|
263
|
-
textTransform: 'uppercase',
|
|
264
|
-
letterSpacing: 0.5,
|
|
265
|
-
},
|
|
266
|
-
label: {
|
|
267
|
-
fontFamily: 'Nunito Sans',
|
|
268
|
-
},
|
|
269
|
-
content: {
|
|
270
|
-
padding: 16,
|
|
271
|
-
backgroundColor: '#FFFFFF',
|
|
272
|
-
borderBottomLeftRadius: 8,
|
|
273
|
-
borderBottomRightRadius: 8,
|
|
274
|
-
},
|
|
275
|
-
contentOpen: {
|
|
276
|
-
borderTopLeftRadius: 0,
|
|
277
|
-
borderTopRightRadius: 0,
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
// Variants
|
|
281
|
-
// headerDefault: {
|
|
282
|
-
// backgroundColor: 'transparent',
|
|
283
|
-
// borderBottomWidth: 1,
|
|
284
|
-
// borderBottomColor: '#E2E9FC',
|
|
285
|
-
// },
|
|
286
|
-
headerSuccess: {
|
|
287
|
-
backgroundColor: '#F7F9FF',
|
|
288
|
-
height: 40,
|
|
289
|
-
paddingVertical: 0,
|
|
290
|
-
},
|
|
291
|
-
headerAlert: {
|
|
292
|
-
backgroundColor: '#F7F9FF',
|
|
293
|
-
height: 40,
|
|
294
|
-
paddingVertical: 0,
|
|
295
|
-
},
|
|
296
|
-
headerError: {
|
|
297
|
-
backgroundColor: '#F7F9FF',
|
|
298
|
-
height: 40,
|
|
299
|
-
paddingVertical: 0,
|
|
300
|
-
},
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
Accordion.Header = AccordionHeader;
|
|
304
|
-
Accordion.Content = AccordionContent;
|
|
305
|
-
|
|
306
|
-
Accordion.propTypes = {
|
|
307
|
-
children: PropTypes.node,
|
|
308
|
-
initiallyOpen: PropTypes.bool,
|
|
309
|
-
onToggle: PropTypes.func,
|
|
310
|
-
style: PropTypes.object,
|
|
311
|
-
title: PropTypes.string,
|
|
312
|
-
content: PropTypes.node,
|
|
313
|
-
contentBackgroundColor: PropTypes.string,
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
AccordionContent.propTypes = {
|
|
317
|
-
children: PropTypes.node,
|
|
318
|
-
style: PropTypes.object,
|
|
319
|
-
backgroundColor: PropTypes.string,
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
AccordionHeader.propTypes = {
|
|
323
|
-
children: PropTypes.node,
|
|
324
|
-
title: PropTypes.string,
|
|
325
|
-
variant: PropTypes.oneOf(['default', 'success', 'alert', 'error']),
|
|
326
|
-
overline: PropTypes.string,
|
|
327
|
-
label: PropTypes.string,
|
|
328
|
-
icon: PropTypes.string,
|
|
329
|
-
backgroundColor: PropTypes.string,
|
|
330
|
-
style: PropTypes.object,
|
|
331
|
-
titleStyle: PropTypes.object,
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
export default Accordion;
|
|
1
|
+
import React, { useState, useRef, useEffect, useContext, createContext } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform, UIManager } from 'react-native';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import SEText from '../SEText';
|
|
6
|
+
import colors from '../styles/colors';
|
|
7
|
+
|
|
8
|
+
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
9
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const AccordionContext = createContext();
|
|
13
|
+
|
|
14
|
+
const useAccordion = () => {
|
|
15
|
+
const context = useContext(AccordionContext);
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error('Accordion compound components must be used within an Accordion');
|
|
18
|
+
}
|
|
19
|
+
return context;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Accordion = ({
|
|
23
|
+
children,
|
|
24
|
+
initiallyOpen = false,
|
|
25
|
+
onToggle,
|
|
26
|
+
style,
|
|
27
|
+
// Backward compatibility props
|
|
28
|
+
title,
|
|
29
|
+
content,
|
|
30
|
+
contentBackgroundColor,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const [isOpen, setIsOpen] = useState(initiallyOpen);
|
|
34
|
+
const animation = useRef(new Animated.Value(initiallyOpen ? 1 : 0)).current;
|
|
35
|
+
|
|
36
|
+
const toggle = () => {
|
|
37
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
38
|
+
setIsOpen(!isOpen);
|
|
39
|
+
onToggle && onToggle(!isOpen);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
Animated.timing(animation, {
|
|
44
|
+
toValue: isOpen ? 1 : 0,
|
|
45
|
+
duration: 300,
|
|
46
|
+
useNativeDriver: false,
|
|
47
|
+
}).start();
|
|
48
|
+
}, [isOpen]);
|
|
49
|
+
|
|
50
|
+
const value = { isOpen, toggle, animation };
|
|
51
|
+
|
|
52
|
+
// Backward compatibility render
|
|
53
|
+
if (title || content) {
|
|
54
|
+
return (
|
|
55
|
+
<AccordionContext.Provider value={value}>
|
|
56
|
+
<View style={[styles.container, style]}>
|
|
57
|
+
<AccordionHeader title={title} {...props} />
|
|
58
|
+
<AccordionContent backgroundColor={contentBackgroundColor}>{content}</AccordionContent>
|
|
59
|
+
</View>
|
|
60
|
+
</AccordionContext.Provider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<AccordionContext.Provider value={value}>
|
|
66
|
+
<View style={[styles.container, style]}>
|
|
67
|
+
{children}
|
|
68
|
+
</View>
|
|
69
|
+
</AccordionContext.Provider>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const AccordionHeader = ({
|
|
74
|
+
children,
|
|
75
|
+
title,
|
|
76
|
+
variant = 'default', // 'default', 'success', 'alert', 'error'
|
|
77
|
+
overline,
|
|
78
|
+
label,
|
|
79
|
+
icon,
|
|
80
|
+
backgroundColor = '#F7F9FF',
|
|
81
|
+
style,
|
|
82
|
+
titleStyle: customTitleStyle,
|
|
83
|
+
...props
|
|
84
|
+
}) => {
|
|
85
|
+
const { isOpen, toggle, animation } = useAccordion();
|
|
86
|
+
|
|
87
|
+
const rotateArrow = animation.interpolate({
|
|
88
|
+
inputRange: [0, 1],
|
|
89
|
+
outputRange: ['0deg', '180deg'],
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const getVariantStyles = () => {
|
|
93
|
+
switch (variant) {
|
|
94
|
+
case 'success':
|
|
95
|
+
return { ...styles.headerSuccess, backgroundColor: backgroundColor || styles.headerSuccess.backgroundColor };
|
|
96
|
+
case 'alert':
|
|
97
|
+
return { ...styles.headerAlert, backgroundColor: backgroundColor || styles.headerAlert.backgroundColor };
|
|
98
|
+
case 'error':
|
|
99
|
+
return { ...styles.headerError, backgroundColor: backgroundColor || styles.headerError.backgroundColor };
|
|
100
|
+
default:
|
|
101
|
+
return { ...styles.headerDefault, backgroundColor: backgroundColor || styles.headerDefault.backgroundColor };
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const getIconColor = () => {
|
|
106
|
+
switch (variant) {
|
|
107
|
+
case 'success':
|
|
108
|
+
return colors.GREEN_DARK; // #037A1C
|
|
109
|
+
case 'alert':
|
|
110
|
+
return "#AB6005"
|
|
111
|
+
case 'error':
|
|
112
|
+
return colors.RED; // #d62828
|
|
113
|
+
default:
|
|
114
|
+
return colors.SE_TEXT_DARK;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const getIconContainerBackgroundColor = () => {
|
|
119
|
+
switch (variant) {
|
|
120
|
+
case 'success':
|
|
121
|
+
return '#C2EFD1';
|
|
122
|
+
case 'alert':
|
|
123
|
+
return '#FEEBC8';
|
|
124
|
+
case 'error':
|
|
125
|
+
return '#FCD5D5';
|
|
126
|
+
default:
|
|
127
|
+
return 'transparent';
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const getTextColor = () => "#485274";
|
|
132
|
+
|
|
133
|
+
const isTransparent = !backgroundColor || backgroundColor === 'transparent' ||
|
|
134
|
+
backgroundColor.toLowerCase() === '#ffffff' || backgroundColor.toLowerCase() === '#fff' ||
|
|
135
|
+
backgroundColor.toLowerCase() === 'white';
|
|
136
|
+
|
|
137
|
+
// Custom Icon Logic
|
|
138
|
+
const renderLeadingIcon = () => {
|
|
139
|
+
if (icon) return <Icon name={icon} size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
140
|
+
|
|
141
|
+
switch (variant) {
|
|
142
|
+
case 'success':
|
|
143
|
+
return <Icon name="check-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
144
|
+
case 'alert':
|
|
145
|
+
return <Icon name="alert-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
146
|
+
case 'error':
|
|
147
|
+
return <Icon name="error-warning-line" size={20} color={getIconColor()} style={styles.leadingIcon} />;
|
|
148
|
+
default:
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<TouchableOpacity
|
|
155
|
+
style={[
|
|
156
|
+
styles.header,
|
|
157
|
+
getVariantStyles(),
|
|
158
|
+
isOpen && styles.headerOpen,
|
|
159
|
+
isTransparent && !isOpen && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
|
|
160
|
+
style
|
|
161
|
+
]}
|
|
162
|
+
onPress={toggle}
|
|
163
|
+
activeOpacity={0.7}
|
|
164
|
+
{...props}
|
|
165
|
+
>
|
|
166
|
+
<View style={styles.headerContent}>
|
|
167
|
+
<View style={[styles.leadingIconContainer, { backgroundColor: getIconContainerBackgroundColor() }]}>
|
|
168
|
+
{renderLeadingIcon()}
|
|
169
|
+
</View>
|
|
170
|
+
|
|
171
|
+
<View style={styles.textContainer}>
|
|
172
|
+
{overline && (
|
|
173
|
+
<SEText style={[styles.overline, { color: getTextColor() }]}>
|
|
174
|
+
{overline}
|
|
175
|
+
</SEText>
|
|
176
|
+
)}
|
|
177
|
+
{label ? (
|
|
178
|
+
<SEText style={[styles.label, { color: getTextColor(), fontSize: 24, lineHeight: 32 }]} type="ns-heading-1">
|
|
179
|
+
{label}
|
|
180
|
+
</SEText>
|
|
181
|
+
) : (
|
|
182
|
+
<SEText style={[styles.title, { color: getTextColor() }, customTitleStyle]} type="ns-heading-5">
|
|
183
|
+
{title || children}
|
|
184
|
+
</SEText>
|
|
185
|
+
)}
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
|
|
189
|
+
<Animated.View style={{ transform: [{ rotate: rotateArrow }] }}>
|
|
190
|
+
<Icon name="arrow-down-s-line" size={24} color="#485274" />
|
|
191
|
+
</Animated.View>
|
|
192
|
+
</TouchableOpacity>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const AccordionContent = ({ children, style, backgroundColor, ...props }) => {
|
|
197
|
+
const { isOpen } = useAccordion();
|
|
198
|
+
|
|
199
|
+
if (!isOpen) return null;
|
|
200
|
+
|
|
201
|
+
const isTransparent = !backgroundColor || backgroundColor === 'transparent' ||
|
|
202
|
+
backgroundColor.toLowerCase() === '#ffffff' || backgroundColor.toLowerCase() === '#fff' ||
|
|
203
|
+
backgroundColor.toLowerCase() === 'white';
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<View
|
|
207
|
+
style={[
|
|
208
|
+
styles.content,
|
|
209
|
+
styles.contentOpen,
|
|
210
|
+
backgroundColor && { backgroundColor },
|
|
211
|
+
isTransparent && { borderBottomWidth: 1, borderBottomColor: '#E2E9FC', borderBottomLeftRadius: 0, borderBottomRightRadius: 0 },
|
|
212
|
+
style
|
|
213
|
+
]}
|
|
214
|
+
{...props}
|
|
215
|
+
>
|
|
216
|
+
{children}
|
|
217
|
+
</View>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const styles = StyleSheet.create({
|
|
222
|
+
container: {
|
|
223
|
+
overflow: 'hidden',
|
|
224
|
+
marginBottom: 8,
|
|
225
|
+
},
|
|
226
|
+
header: {
|
|
227
|
+
flexDirection: 'row',
|
|
228
|
+
alignItems: 'center',
|
|
229
|
+
justifyContent: 'space-between',
|
|
230
|
+
paddingVertical: 16,
|
|
231
|
+
paddingHorizontal: 16,
|
|
232
|
+
borderRadius: 8,
|
|
233
|
+
backgroundColor: '#F7F9FF', // Default
|
|
234
|
+
},
|
|
235
|
+
headerOpen: {
|
|
236
|
+
borderBottomLeftRadius: 0,
|
|
237
|
+
borderBottomRightRadius: 0,
|
|
238
|
+
},
|
|
239
|
+
headerContent: {
|
|
240
|
+
flexDirection: 'row',
|
|
241
|
+
alignItems: 'center',
|
|
242
|
+
flex: 1,
|
|
243
|
+
},
|
|
244
|
+
leadingIconContainer: {
|
|
245
|
+
padding: 4,
|
|
246
|
+
borderRadius: 20,
|
|
247
|
+
marginRight: 12,
|
|
248
|
+
},
|
|
249
|
+
leadingIcon: {
|
|
250
|
+
// marginRight: 12, // Removed
|
|
251
|
+
},
|
|
252
|
+
textContainer: {
|
|
253
|
+
flex: 1,
|
|
254
|
+
justifyContent: 'center',
|
|
255
|
+
},
|
|
256
|
+
title: {
|
|
257
|
+
fontFamily: 'Nunito Sans',
|
|
258
|
+
},
|
|
259
|
+
overline: {
|
|
260
|
+
fontSize: 12,
|
|
261
|
+
fontFamily: 'Nunito Sans',
|
|
262
|
+
marginBottom: 4,
|
|
263
|
+
textTransform: 'uppercase',
|
|
264
|
+
letterSpacing: 0.5,
|
|
265
|
+
},
|
|
266
|
+
label: {
|
|
267
|
+
fontFamily: 'Nunito Sans',
|
|
268
|
+
},
|
|
269
|
+
content: {
|
|
270
|
+
padding: 16,
|
|
271
|
+
backgroundColor: '#FFFFFF',
|
|
272
|
+
borderBottomLeftRadius: 8,
|
|
273
|
+
borderBottomRightRadius: 8,
|
|
274
|
+
},
|
|
275
|
+
contentOpen: {
|
|
276
|
+
borderTopLeftRadius: 0,
|
|
277
|
+
borderTopRightRadius: 0,
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
// Variants
|
|
281
|
+
// headerDefault: {
|
|
282
|
+
// backgroundColor: 'transparent',
|
|
283
|
+
// borderBottomWidth: 1,
|
|
284
|
+
// borderBottomColor: '#E2E9FC',
|
|
285
|
+
// },
|
|
286
|
+
headerSuccess: {
|
|
287
|
+
backgroundColor: '#F7F9FF',
|
|
288
|
+
height: 40,
|
|
289
|
+
paddingVertical: 0,
|
|
290
|
+
},
|
|
291
|
+
headerAlert: {
|
|
292
|
+
backgroundColor: '#F7F9FF',
|
|
293
|
+
height: 40,
|
|
294
|
+
paddingVertical: 0,
|
|
295
|
+
},
|
|
296
|
+
headerError: {
|
|
297
|
+
backgroundColor: '#F7F9FF',
|
|
298
|
+
height: 40,
|
|
299
|
+
paddingVertical: 0,
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
Accordion.Header = AccordionHeader;
|
|
304
|
+
Accordion.Content = AccordionContent;
|
|
305
|
+
|
|
306
|
+
Accordion.propTypes = {
|
|
307
|
+
children: PropTypes.node,
|
|
308
|
+
initiallyOpen: PropTypes.bool,
|
|
309
|
+
onToggle: PropTypes.func,
|
|
310
|
+
style: PropTypes.object,
|
|
311
|
+
title: PropTypes.string,
|
|
312
|
+
content: PropTypes.node,
|
|
313
|
+
contentBackgroundColor: PropTypes.string,
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
AccordionContent.propTypes = {
|
|
317
|
+
children: PropTypes.node,
|
|
318
|
+
style: PropTypes.object,
|
|
319
|
+
backgroundColor: PropTypes.string,
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
AccordionHeader.propTypes = {
|
|
323
|
+
children: PropTypes.node,
|
|
324
|
+
title: PropTypes.string,
|
|
325
|
+
variant: PropTypes.oneOf(['default', 'success', 'alert', 'error']),
|
|
326
|
+
overline: PropTypes.string,
|
|
327
|
+
label: PropTypes.string,
|
|
328
|
+
icon: PropTypes.string,
|
|
329
|
+
backgroundColor: PropTypes.string,
|
|
330
|
+
style: PropTypes.object,
|
|
331
|
+
titleStyle: PropTypes.object,
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export default Accordion;
|