@robuust-digital/vue-components 1.2.4 → 1.2.5

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.
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Toast component
3
+ *
4
+ * @param {Object} theme - The global theme object
5
+ */
6
+ export default (theme) => ({
7
+ ':root': {
8
+ // Custom properties
9
+ '--rvc-toast-border-radius': 'var(--rvc-base-border-radius)',
10
+ '--rvc-toast-transition-duration': 'var(--rvc-base-transition-duration)',
11
+ '--rvc-toast-transition-timing-function': 'var(--rvc-base-transition-timing-function)',
12
+ '--rvc-toast-border-width': 'var(--rvc-base-border-width)',
13
+ '--rvc-toast-padding-x': theme('padding.6'),
14
+ '--rvc-toast-padding-y': theme('padding.6'),
15
+ '--rvc-toast-max-width': theme('maxWidth.xl'),
16
+ '--rvc-toast-min-width': theme('maxWidth.xl'),
17
+ '--rvc-toast-font-size': theme('fontSize.base.0'),
18
+ '--rvc-toast-gap': theme('gap[1.5]'),
19
+ '--rvc-toast-anchor-decoration': 'underline',
20
+ '--rvc-toast-icon-size': theme('width.6'),
21
+ '--rvc-toast-title-font-weight': theme('fontWeight.medium'),
22
+ '--rvc-toast-transition-property': theme('transitionProperty.colors'),
23
+ '--rvc-toast-offset': theme('width.6'),
24
+
25
+ // Default color variables
26
+ '--rvc-toast-bg-color': theme('colors.blue.50'),
27
+ '--rvc-toast-border-color': theme('colors.blue.200'),
28
+ '--rvc-toast-color': theme('colors.blue.700'),
29
+ '--rvc-toast-icon-color': theme('colors.blue.500'),
30
+ '--rvc-toast-title-color': theme('colors.blue.800'),
31
+ '--rvc-toast-close-bg-color': theme('colors.blue.200'),
32
+ '--rvc-toast-close-hover-bg-color': theme('colors.blue.300'),
33
+ '--rvc-toast-anchor-color': 'inherit',
34
+ '--rvc-toast-anchor-hover-color': theme('colors.blue.600'),
35
+ },
36
+
37
+ '.rvc-toast': {
38
+ gap: 'var(--rvc-toast-gap)',
39
+ paddingTop: 'var(--rvc-toast-padding-y)',
40
+ paddingBottom: 'var(--rvc-toast-padding-y)',
41
+ paddingLeft: 'var(--rvc-toast-padding-x)',
42
+ paddingRight: 'var(--rvc-toast-padding-x)',
43
+ borderRadius: 'var(--rvc-toast-border-radius)',
44
+ fontSize: 'var(--rvc-toast-font-size)',
45
+ backgroundColor: 'var(--rvc-toast-bg-color)',
46
+ color: 'var(--rvc-toast-color)',
47
+ maxWidth: 'var(--rvc-toast-max-width)',
48
+ minWidth: 'var(--rvc-toast-min-width)',
49
+ borderWidth: 'var(--rvc-toast-border-width)',
50
+ borderColor: 'var(--rvc-toast-border-color)',
51
+ filter: 'drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.05))',
52
+ display: 'flex',
53
+ position: 'fixed',
54
+ left: '50%',
55
+ transform: 'translateX(-50%)',
56
+ overflow: 'hidden',
57
+ zIndex: '99',
58
+ ...theme('components.toast'),
59
+
60
+ '&.rvc-toast-bottom': {
61
+ bottom: 'var(--rvc-toast-offset)',
62
+ ...theme('components.toast.bottom'),
63
+ },
64
+
65
+ '&.rvc-toast-top': {
66
+ top: 'var(--rvc-toast-offset)',
67
+ ...theme('components.toast.top'),
68
+ },
69
+
70
+ // Elements
71
+ a: {
72
+ textDecoration: 'var(--rvc-toast-anchor-decoration)',
73
+ transitionProperty: 'var(--rvc-toast-transition-property)',
74
+ transitionDuration: 'var(--rvc-toast-transition-duration)',
75
+ transitionTimingFunction: 'var(--rvc-toast-transition-timing-function)',
76
+ color: 'var(--rvc-toast-anchor-color)',
77
+ ...theme('components.toast.a'),
78
+
79
+ '&:hover': {
80
+ color: 'var(--rvc-toast-anchor-hover-color)',
81
+ ...theme('components.toast.a[&:hover]'),
82
+ },
83
+ },
84
+
85
+ 'ul,ol': {
86
+ listStylePosition: 'inside',
87
+ margin: 0,
88
+ paddingLeft: theme('padding.2'),
89
+ ...theme('components.toast[ul,ol]'),
90
+ },
91
+
92
+ ul: {
93
+ listStyleType: 'disc',
94
+ ...theme('components.toast.ul'),
95
+ },
96
+
97
+ ol: {
98
+ listStyleType: 'decimal',
99
+ ...theme('components.toast.ol'),
100
+ },
101
+
102
+ '.rvc-toast-close': {
103
+ backgroundColor: 'var(--rvc-toast-close-bg-color)',
104
+ color: 'var(--rvc-toast-icon-color)',
105
+ borderBottomLeftRadius: 'var(--rvc-toast-border-radius)',
106
+ transitionProperty: 'var(--rvc-toast-transition-property)',
107
+ transitionDuration: 'var(--rvc-toast-transition-duration)',
108
+ transitionTimingFunction: 'var(--rvc-toast-transition-timing-function)',
109
+ display: 'inline-flex',
110
+ justifyContent: 'center',
111
+ alignItems: 'center',
112
+ position: 'absolute',
113
+ top: '0',
114
+ right: '0',
115
+ padding: theme('padding[1.5]'),
116
+ ...theme('components.toast[.rvc-toast-close]'),
117
+
118
+ '&:hover': {
119
+ backgroundColor: 'var(--rvc-toast-close-hover-bg-color)',
120
+ color: 'var(--rvc-toast-icon-hover-color)',
121
+ ...theme('components.toast[.rvc-toast-close][&:hover]'),
122
+ },
123
+ },
124
+
125
+ '.rvc-toast-icon': {
126
+ width: 'var(--rvc-toast-icon-size)',
127
+ height: 'var(--rvc-toast-icon-size)',
128
+ color: 'var(--rvc-toast-icon-color)',
129
+ display: 'block',
130
+ flexShrink: '0',
131
+ ...theme('components.toast[.rvc-toast-icon]'),
132
+ },
133
+
134
+ '.rvc-toast-title': {
135
+ color: 'var(--rvc-toast-title-color)',
136
+ fontWeight: 'var(--rvc-toast-title-font-weight)',
137
+ display: 'block',
138
+ marginBottom: theme('margin.2'),
139
+ ...theme('components.toast[.rvc-toast-title]'),
140
+
141
+ '&:last-child': {
142
+ marginBottom: '0',
143
+ ...theme('components.toast[.rvc-toast-title][&:last-child]'),
144
+ },
145
+ },
146
+
147
+ // Color variants
148
+ '&.rvc-toast-info': {
149
+ ...theme('components.toast.info'),
150
+ },
151
+
152
+ '&.rvc-toast-warning': {
153
+ '--rvc-toast-bg-color': theme('colors.yellow.50'),
154
+ '--rvc-toast-border-color': theme('colors.yellow.200'),
155
+ '--rvc-toast-color': theme('colors.yellow.700'),
156
+ '--rvc-toast-icon-color': theme('colors.yellow.500'),
157
+ '--rvc-toast-title-color': theme('colors.yellow.800'),
158
+ '--rvc-toast-close-bg-color': theme('colors.yellow.200'),
159
+ '--rvc-toast-close-hover-bg-color': theme('colors.yellow.300'),
160
+ '--rvc-toast-anchor-hover-color': theme('colors.yellow.600'),
161
+ ...theme('components.toast.warning'),
162
+ },
163
+
164
+ '&.rvc-toast-success': {
165
+ '--rvc-toast-bg-color': theme('colors.green.50'),
166
+ '--rvc-toast-border-color': theme('colors.green.200'),
167
+ '--rvc-toast-color': theme('colors.green.700'),
168
+ '--rvc-toast-icon-color': theme('colors.green.500'),
169
+ '--rvc-toast-title-color': theme('colors.green.800'),
170
+ '--rvc-toast-close-bg-color': theme('colors.green.200'),
171
+ '--rvc-toast-close-hover-bg-color': theme('colors.green.300'),
172
+ '--rvc-toast-anchor-hover-color': theme('colors.green.600'),
173
+ ...theme('components.toast.success'),
174
+ },
175
+
176
+ '&.rvc-toast-danger': {
177
+ '--rvc-toast-bg-color': theme('colors.red.50'),
178
+ '--rvc-toast-border-color': theme('colors.red.200'),
179
+ '--rvc-toast-color': theme('colors.red.700'),
180
+ '--rvc-toast-icon-color': theme('colors.red.500'),
181
+ '--rvc-toast-title-color': theme('colors.red.800'),
182
+ '--rvc-toast-close-bg-color': theme('colors.red.200'),
183
+ '--rvc-toast-close-hover-bg-color': theme('colors.red.300'),
184
+ '--rvc-toast-anchor-hover-color': theme('colors.red.600'),
185
+ ...theme('components.toast.danger'),
186
+ },
187
+ },
188
+ });
@@ -10,10 +10,16 @@ import badge from './components/badge.js';
10
10
  import button from './components/button.js';
11
11
  import checkbox from './components/checkbox.js';
12
12
  import drawer from './components/drawer.js';
13
+ import dropdown from './components/dropdown.js';
14
+ import emptyState from './components/empty-state.js';
13
15
  import lightswitch from './components/lightswitch.js';
14
16
  import modal from './components/modal.js';
17
+ import pagination from './components/pagination.js';
18
+ import radio from './components/radio.js';
15
19
  import select from './components/select.js';
16
20
  import table from './components/table.js';
21
+ import tabs from './components/tabs.js';
22
+ import toast from './components/toast.js';
17
23
  import tooltip from './components/tooltip.js';
18
24
 
19
25
  /**
@@ -36,10 +42,16 @@ export default plugin.withOptions(
36
42
  button(theme),
37
43
  checkbox(theme),
38
44
  drawer(theme),
45
+ dropdown(theme),
46
+ emptyState(theme),
39
47
  lightswitch(theme),
48
+ pagination(theme),
40
49
  modal(theme),
50
+ radio(theme),
41
51
  select(theme),
42
52
  table(theme),
53
+ tabs(theme),
54
+ toast(theme),
43
55
  tooltip(theme),
44
56
  ], { respectPrefix: false });
45
57
  },
@@ -54,10 +66,15 @@ export default plugin.withOptions(
54
66
  'rvc-button',
55
67
  'rvc-checkbox',
56
68
  'rvc-drawer',
69
+ 'rvc-dropdown',
70
+ 'rvc-empty-state',
57
71
  'rvc-lightswitch-group',
58
72
  'rvc-modal',
73
+ 'rvc-pagination',
59
74
  'rvc-select',
60
75
  'rvc-table',
76
+ 'rvc-tabs',
77
+ 'rvc-toast',
61
78
  'rvc-tooltip',
62
79
  ],
63
80
  }),