@loja-integrada/admin-components 0.16.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Forms/Dropdown/Dropdown.d.ts +32 -3
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.d.ts +10 -0
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.spec.d.ts +1 -0
- package/dist/Forms/FloatingLabelInput/FloatingLabelInput.stories.d.ts +10 -0
- package/dist/Forms/FloatingLabelInput/index.d.ts +1 -0
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.d.ts +49 -0
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.d.ts +1 -0
- package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.d.ts +10 -0
- package/dist/Forms/FloatingLabelInputCurrency/index.d.ts +1 -0
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.d.ts +18 -0
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.d.ts +1 -0
- package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.d.ts +19 -0
- package/dist/Forms/FloatingLabelInputMask/index.d.ts +1 -0
- package/dist/Forms/InputMask/InputMask.stories.d.ts +7 -0
- package/dist/Forms/InputMask/utils.d.ts +40 -0
- package/dist/Forms/RadioButton/RadioButton.d.ts +24 -0
- package/dist/Forms/RadioButton/RadioButton.spec.d.ts +1 -0
- package/dist/Forms/RadioButton/RadioButton.stories.d.ts +6 -0
- package/dist/Forms/RadioButton/index.d.ts +1 -0
- package/dist/Forms/ToggleButton/ToggleButton.d.ts +24 -0
- package/dist/Forms/ToggleButton/ToggleButton.spec.d.ts +1 -0
- package/dist/Forms/ToggleButton/ToggleButton.stories.d.ts +7 -0
- package/dist/Forms/ToggleButton/index.d.ts +1 -0
- package/dist/Forms/index.d.ts +5 -0
- package/dist/Icons/icons-path/AngleDown.d.ts +2 -0
- package/dist/Icons/icons-path/Calculator.d.ts +2 -0
- package/dist/Icons/icons-path/Camera.d.ts +2 -0
- package/dist/Icons/icons-path/Desktop.d.ts +2 -0
- package/dist/Icons/icons-path/Lightbulb.d.ts +2 -0
- package/dist/Icons/icons-path/Mobile.d.ts +2 -0
- package/dist/Icons/icons-path/Nav.d.ts +2 -0
- package/dist/Icons/icons-path/Plus.d.ts +2 -0
- package/dist/Icons/icons-path/ShoppingCart.d.ts +2 -0
- package/dist/Icons/icons-path/index.d.ts +9 -0
- package/dist/Indicators/InformationBox/InformationBox.d.ts +25 -0
- package/dist/Indicators/InformationBox/InformationBox.spec.d.ts +1 -0
- package/dist/Indicators/InformationBox/InformationBoxt.stories.d.ts +4 -0
- package/dist/Indicators/InformationBox/index.d.ts +1 -0
- package/dist/Indicators/index.d.ts +1 -0
- package/dist/admin-components.cjs.development.js +611 -30
- package/dist/admin-components.cjs.development.js.map +1 -1
- package/dist/admin-components.cjs.production.min.js +1 -1
- package/dist/admin-components.cjs.production.min.js.map +1 -1
- package/dist/admin-components.esm.js +604 -31
- package/dist/admin-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Forms/Dropdown/Dropdown.tsx +50 -15
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.spec.tsx +25 -0
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.stories.tsx +72 -0
- package/src/Forms/FloatingLabelInput/FloatingLabelInput.tsx +80 -0
- package/src/Forms/FloatingLabelInput/index.ts +1 -0
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.tsx +15 -0
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.tsx +72 -0
- package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.tsx +251 -0
- package/src/Forms/FloatingLabelInputCurrency/index.ts +1 -0
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.tsx +65 -0
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.tsx +148 -0
- package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.tsx +56 -0
- package/src/Forms/FloatingLabelInputMask/index.ts +1 -0
- package/src/Forms/InputMask/InputMask.spec.tsx +71 -6
- package/src/Forms/InputMask/InputMask.stories.tsx +63 -0
- package/src/Forms/InputMask/InputMask.tsx +1 -1
- package/src/Forms/InputMask/utils.ts +119 -1
- package/src/Forms/RadioButton/RadioButton.spec.tsx +26 -0
- package/src/Forms/RadioButton/RadioButton.stories.tsx +40 -0
- package/src/Forms/RadioButton/RadioButton.tsx +80 -0
- package/src/Forms/RadioButton/index.tsx +1 -0
- package/src/Forms/ToggleButton/ToggleButton.spec.tsx +28 -0
- package/src/Forms/ToggleButton/ToggleButton.stories.tsx +51 -0
- package/src/Forms/ToggleButton/ToggleButton.tsx +95 -0
- package/src/Forms/ToggleButton/index.tsx +1 -0
- package/src/Forms/index.ts +5 -0
- package/src/Icons/Icon.stories.tsx +4 -4
- package/src/Icons/icons-path/AngleDown.tsx +9 -0
- package/src/Icons/icons-path/Bell.tsx +2 -2
- package/src/Icons/icons-path/Calculator.tsx +9 -0
- package/src/Icons/icons-path/Camera.tsx +9 -0
- package/src/Icons/icons-path/Copy.tsx +1 -1
- package/src/Icons/icons-path/Desktop.tsx +9 -0
- package/src/Icons/icons-path/Image.tsx +1 -1
- package/src/Icons/icons-path/Lightbulb.tsx +9 -0
- package/src/Icons/icons-path/Mobile.tsx +9 -0
- package/src/Icons/icons-path/MoneyBill.tsx +1 -1
- package/src/Icons/icons-path/Move.tsx +1 -1
- package/src/Icons/icons-path/Nav.tsx +11 -0
- package/src/Icons/icons-path/PaperList.tsx +2 -2
- package/src/Icons/icons-path/Pix.tsx +1 -2
- package/src/Icons/icons-path/Plus.tsx +9 -0
- package/src/Icons/icons-path/ShoppingCart.tsx +11 -0
- package/src/Icons/icons-path/Sync.tsx +1 -1
- package/src/Icons/icons-path/index.ts +18 -0
- package/src/Indicators/InformationBox/InformationBox.spec.tsx +27 -0
- package/src/Indicators/InformationBox/InformationBox.tsx +86 -0
- package/src/Indicators/InformationBox/InformationBoxt.stories.tsx +24 -0
- package/src/Indicators/InformationBox/index.tsx +1 -0
- package/src/Indicators/index.ts +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Icon, IconProps } from '../../Icons'
|
|
3
|
+
|
|
4
|
+
type InformationBoxTypesOptions = 'tip' | 'warning' | 'danger'
|
|
5
|
+
|
|
6
|
+
const InformationBoxTypes: Record<
|
|
7
|
+
InformationBoxTypesOptions,
|
|
8
|
+
{
|
|
9
|
+
title: string
|
|
10
|
+
class: string
|
|
11
|
+
icon: IconProps['icon']
|
|
12
|
+
iconClass: string
|
|
13
|
+
}
|
|
14
|
+
> = {
|
|
15
|
+
tip: {
|
|
16
|
+
title: 'Dica!',
|
|
17
|
+
class: 'bg-success-light border-success',
|
|
18
|
+
icon: 'lightbulb',
|
|
19
|
+
iconClass: 'text-success',
|
|
20
|
+
},
|
|
21
|
+
warning: {
|
|
22
|
+
title: 'Atenção!',
|
|
23
|
+
class: 'bg-warning-light border-warning',
|
|
24
|
+
icon: 'exclamationTriangle',
|
|
25
|
+
iconClass: 'text-warning',
|
|
26
|
+
},
|
|
27
|
+
danger: {
|
|
28
|
+
title: 'Cuidado!',
|
|
29
|
+
class: 'bg-danger-light border-danger',
|
|
30
|
+
icon: 'ban',
|
|
31
|
+
iconClass: 'text-danger',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const InformationBoxComponent = ({
|
|
36
|
+
type = 'tip',
|
|
37
|
+
subtitle,
|
|
38
|
+
}: InformationBoxProps) => {
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
className={`InformationBox pl-4 pr-6 pt-5 pb-6 rounded w-full relative flex items-start mb-3 ${InformationBoxTypes[type].class}`}
|
|
42
|
+
>
|
|
43
|
+
<div
|
|
44
|
+
className={`w-10 h-10 flex justify-center items-center flex-shrink-0 rounded-full mr-3 bg-base-1`}
|
|
45
|
+
>
|
|
46
|
+
<Icon
|
|
47
|
+
icon={InformationBoxTypes[type].icon}
|
|
48
|
+
className={`InformationBox-icon ${InformationBoxTypes[type].iconClass}`}
|
|
49
|
+
size={4}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div className="flex-grow flex flex-col sm:flex-row items-start justify-between min-w-0">
|
|
54
|
+
<div className="flex flex-col justify-center min-w-0 break-words tracking-4 leading-6 text-on-base">
|
|
55
|
+
<span
|
|
56
|
+
className={`InformationBox-title text-f5 font-bold ${InformationBoxTypes[type].iconClass}`}
|
|
57
|
+
>
|
|
58
|
+
{InformationBoxTypes[type].title}
|
|
59
|
+
</span>
|
|
60
|
+
{subtitle && (
|
|
61
|
+
<span className="InformationBox-subtitle text-f6 font-regular mt-1">
|
|
62
|
+
{subtitle}
|
|
63
|
+
</span>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const InformationBox = React.memo(InformationBoxComponent)
|
|
72
|
+
|
|
73
|
+
export interface InformationBoxProps {
|
|
74
|
+
/** InformationBox color
|
|
75
|
+
* @default info
|
|
76
|
+
* */
|
|
77
|
+
type?: keyof typeof InformationBoxTypes
|
|
78
|
+
/**
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
title?: string | React.ReactNode
|
|
82
|
+
/**
|
|
83
|
+
* InformationBox text below title
|
|
84
|
+
*/
|
|
85
|
+
subtitle?: string | React.ReactNode
|
|
86
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Story, Meta } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import { InformationBox, InformationBoxProps } from './InformationBox'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Indicators/InformationBox',
|
|
8
|
+
component: InformationBox,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'padded',
|
|
11
|
+
design: {
|
|
12
|
+
type: 'figma',
|
|
13
|
+
url: 'https://www.figma.com/file/Z2WDD4SH8zwaJC2K5wbtMO/Sistema-Integrado?node-id=2406%3A20851',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
title: 'Dica!',
|
|
18
|
+
subtitle: 'Como criar um cadastro de produto incrível? No mundo virtual, o consumidor não pode pegar, sentir ou experimentar o produto. Por isso, a imagem que você utiliza faz toda a diferença na hora da venda.',
|
|
19
|
+
},
|
|
20
|
+
} as Meta
|
|
21
|
+
|
|
22
|
+
const Template: Story<InformationBoxProps> = args => <div className="max-w-4xl mx-auto"><InformationBox {...args} /></div>
|
|
23
|
+
|
|
24
|
+
export const Default = Template.bind({})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InformationBox'
|
package/src/Indicators/index.ts
CHANGED