@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.
Files changed (96) hide show
  1. package/dist/Forms/Dropdown/Dropdown.d.ts +32 -3
  2. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.d.ts +10 -0
  3. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.spec.d.ts +1 -0
  4. package/dist/Forms/FloatingLabelInput/FloatingLabelInput.stories.d.ts +10 -0
  5. package/dist/Forms/FloatingLabelInput/index.d.ts +1 -0
  6. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.d.ts +49 -0
  7. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.d.ts +1 -0
  8. package/dist/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.d.ts +10 -0
  9. package/dist/Forms/FloatingLabelInputCurrency/index.d.ts +1 -0
  10. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.d.ts +18 -0
  11. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.d.ts +1 -0
  12. package/dist/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.d.ts +19 -0
  13. package/dist/Forms/FloatingLabelInputMask/index.d.ts +1 -0
  14. package/dist/Forms/InputMask/InputMask.stories.d.ts +7 -0
  15. package/dist/Forms/InputMask/utils.d.ts +40 -0
  16. package/dist/Forms/RadioButton/RadioButton.d.ts +24 -0
  17. package/dist/Forms/RadioButton/RadioButton.spec.d.ts +1 -0
  18. package/dist/Forms/RadioButton/RadioButton.stories.d.ts +6 -0
  19. package/dist/Forms/RadioButton/index.d.ts +1 -0
  20. package/dist/Forms/ToggleButton/ToggleButton.d.ts +24 -0
  21. package/dist/Forms/ToggleButton/ToggleButton.spec.d.ts +1 -0
  22. package/dist/Forms/ToggleButton/ToggleButton.stories.d.ts +7 -0
  23. package/dist/Forms/ToggleButton/index.d.ts +1 -0
  24. package/dist/Forms/index.d.ts +5 -0
  25. package/dist/Icons/icons-path/AngleDown.d.ts +2 -0
  26. package/dist/Icons/icons-path/Calculator.d.ts +2 -0
  27. package/dist/Icons/icons-path/Camera.d.ts +2 -0
  28. package/dist/Icons/icons-path/Desktop.d.ts +2 -0
  29. package/dist/Icons/icons-path/Lightbulb.d.ts +2 -0
  30. package/dist/Icons/icons-path/Mobile.d.ts +2 -0
  31. package/dist/Icons/icons-path/Nav.d.ts +2 -0
  32. package/dist/Icons/icons-path/Plus.d.ts +2 -0
  33. package/dist/Icons/icons-path/ShoppingCart.d.ts +2 -0
  34. package/dist/Icons/icons-path/index.d.ts +9 -0
  35. package/dist/Indicators/InformationBox/InformationBox.d.ts +25 -0
  36. package/dist/Indicators/InformationBox/InformationBox.spec.d.ts +1 -0
  37. package/dist/Indicators/InformationBox/InformationBoxt.stories.d.ts +4 -0
  38. package/dist/Indicators/InformationBox/index.d.ts +1 -0
  39. package/dist/Indicators/index.d.ts +1 -0
  40. package/dist/admin-components.cjs.development.js +611 -30
  41. package/dist/admin-components.cjs.development.js.map +1 -1
  42. package/dist/admin-components.cjs.production.min.js +1 -1
  43. package/dist/admin-components.cjs.production.min.js.map +1 -1
  44. package/dist/admin-components.esm.js +604 -31
  45. package/dist/admin-components.esm.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/Forms/Dropdown/Dropdown.tsx +50 -15
  48. package/src/Forms/FloatingLabelInput/FloatingLabelInput.spec.tsx +25 -0
  49. package/src/Forms/FloatingLabelInput/FloatingLabelInput.stories.tsx +72 -0
  50. package/src/Forms/FloatingLabelInput/FloatingLabelInput.tsx +80 -0
  51. package/src/Forms/FloatingLabelInput/index.ts +1 -0
  52. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.spec.tsx +15 -0
  53. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.stories.tsx +72 -0
  54. package/src/Forms/FloatingLabelInputCurrency/FloatingLabelInputCurrency.tsx +251 -0
  55. package/src/Forms/FloatingLabelInputCurrency/index.ts +1 -0
  56. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.spec.tsx +65 -0
  57. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.stories.tsx +148 -0
  58. package/src/Forms/FloatingLabelInputMask/FloatingLabelInputMask.tsx +56 -0
  59. package/src/Forms/FloatingLabelInputMask/index.ts +1 -0
  60. package/src/Forms/InputMask/InputMask.spec.tsx +71 -6
  61. package/src/Forms/InputMask/InputMask.stories.tsx +63 -0
  62. package/src/Forms/InputMask/InputMask.tsx +1 -1
  63. package/src/Forms/InputMask/utils.ts +119 -1
  64. package/src/Forms/RadioButton/RadioButton.spec.tsx +26 -0
  65. package/src/Forms/RadioButton/RadioButton.stories.tsx +40 -0
  66. package/src/Forms/RadioButton/RadioButton.tsx +80 -0
  67. package/src/Forms/RadioButton/index.tsx +1 -0
  68. package/src/Forms/ToggleButton/ToggleButton.spec.tsx +28 -0
  69. package/src/Forms/ToggleButton/ToggleButton.stories.tsx +51 -0
  70. package/src/Forms/ToggleButton/ToggleButton.tsx +95 -0
  71. package/src/Forms/ToggleButton/index.tsx +1 -0
  72. package/src/Forms/index.ts +5 -0
  73. package/src/Icons/Icon.stories.tsx +4 -4
  74. package/src/Icons/icons-path/AngleDown.tsx +9 -0
  75. package/src/Icons/icons-path/Bell.tsx +2 -2
  76. package/src/Icons/icons-path/Calculator.tsx +9 -0
  77. package/src/Icons/icons-path/Camera.tsx +9 -0
  78. package/src/Icons/icons-path/Copy.tsx +1 -1
  79. package/src/Icons/icons-path/Desktop.tsx +9 -0
  80. package/src/Icons/icons-path/Image.tsx +1 -1
  81. package/src/Icons/icons-path/Lightbulb.tsx +9 -0
  82. package/src/Icons/icons-path/Mobile.tsx +9 -0
  83. package/src/Icons/icons-path/MoneyBill.tsx +1 -1
  84. package/src/Icons/icons-path/Move.tsx +1 -1
  85. package/src/Icons/icons-path/Nav.tsx +11 -0
  86. package/src/Icons/icons-path/PaperList.tsx +2 -2
  87. package/src/Icons/icons-path/Pix.tsx +1 -2
  88. package/src/Icons/icons-path/Plus.tsx +9 -0
  89. package/src/Icons/icons-path/ShoppingCart.tsx +11 -0
  90. package/src/Icons/icons-path/Sync.tsx +1 -1
  91. package/src/Icons/icons-path/index.ts +18 -0
  92. package/src/Indicators/InformationBox/InformationBox.spec.tsx +27 -0
  93. package/src/Indicators/InformationBox/InformationBox.tsx +86 -0
  94. package/src/Indicators/InformationBox/InformationBoxt.stories.tsx +24 -0
  95. package/src/Indicators/InformationBox/index.tsx +1 -0
  96. 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'
@@ -4,3 +4,4 @@ export * from './Tag'
4
4
  export * from './Toast'
5
5
  export * from './Badge'
6
6
  export * from './Tooltip'
7
+ export * from './InformationBox'