@infonomic/uikit 5.29.0 → 5.31.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/README.md CHANGED
@@ -52,11 +52,12 @@ And then in your application in a global.css or other root CSS file...
52
52
 
53
53
  ```css
54
54
  /**
55
- * Core uikit styles including var system for breakpoints,
56
- * colors, scales, utils etc., which can be optionally
55
+ * Optional reset and core styles including var system for
56
+ * breakpoints, colors, scales, utils etc., which can be
57
57
  * integrated with Tailwind (colors, breakpoints etc.) via
58
58
  * Tailwind theme configuration.
59
59
  */
60
+ @import '@infonomic/uikit/reset.css';
60
61
  @import '@infonomic/uikit/styles.css';
61
62
 
62
63
  /**
@@ -98,33 +99,6 @@ Here's an example Tailwind CSS integration. Note that we have our own reset, and
98
99
 
99
100
  @custom-variant dark (&:is(.dark *));
100
101
 
101
- /*
102
- Set the utility class in Tailwind to match our own, as for now
103
- at least, we add the 'container' class attribute to our container
104
- component - which conflicts with Tailwind's own container utility.
105
- */
106
- @utility container {
107
- width: 100%;
108
- padding: 0 16px;
109
- margin: 0 auto;
110
- max-width: 960px;
111
-
112
- /* Large */
113
- @media (min-width: 1050px) {
114
- max-width: 1024px;
115
- }
116
-
117
- /* X-Large */
118
- @media (min-width: 1230px) {
119
- max-width: 1190px;
120
- }
121
-
122
- /* 2X-Large */
123
- @media (min-width: 1500px) {
124
- max-width: 1400px;
125
- }
126
- }
127
-
128
102
  @theme {
129
103
  --breakpoint-*: initial;
130
104
  --breakpoint-sm: 640px;
@@ -73,7 +73,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
73
73
  e.stopPropagation();
74
74
  setIsOpen(true);
75
75
  },
76
- value: date ? `${format(date, 'PP HH:mm')}` : '',
76
+ value: date ? format(date, 'datetime' === mode ? 'PP HH:mm' : 'PP') : '',
77
77
  placeHolder: placeHolderText,
78
78
  helpText: helpText,
79
79
  disabled: false,
@@ -199,7 +199,7 @@ function DatePicker({ id, name, label, required, initialValue, mode = 'datetime'
199
199
  children: [
200
200
  /*#__PURE__*/ jsx("div", {
201
201
  className: datepicker_module["content-status"],
202
- children: date ? `${format(date, 'PPPp')}` : 'No date selected'
202
+ children: date ? format(date, 'datetime' === mode ? 'PPPp' : 'PPP') : 'No date selected'
203
203
  }),
204
204
  /*#__PURE__*/ jsxs("div", {
205
205
  className: datepicker_module["content-actions"],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@infonomic/uikit",
3
3
  "private": false,
4
4
  "license": "MIT",
5
- "version": "5.29.0",
5
+ "version": "5.31.0",
6
6
  "type": "module",
7
7
  "description": "Infonomic UI kit is a collection of reusable UI components and utilities for React and Astro.",
8
8
  "keywords": [
@@ -13,13 +13,30 @@ export const Default = (): React.JSX.Element => {
13
13
 
14
14
  return (
15
15
  <div style={{ maxWidth: '270px', margin: '2rem auto' }}>
16
- <DatePicker
17
- onDateChange={handleDateChange}
18
- id="published_on"
19
- name="published_on"
20
- variant="outlined"
21
- helpText="Select published on date."
22
- />
16
+ <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '1.5rem' }}>
17
+ <span>Date and Time</span>
18
+ <DatePicker
19
+ onDateChange={handleDateChange}
20
+ id="published_on"
21
+ name="published_on"
22
+ yearsInPast={70}
23
+ variant="outlined"
24
+ helpText="Select published on date."
25
+ />
26
+ </div>
27
+
28
+ <div style={{ display: 'flex', flexDirection: 'column', marginBottom: '1.5rem' }}>
29
+ <span>Date</span>
30
+ <DatePicker
31
+ onDateChange={handleDateChange}
32
+ mode="date"
33
+ id="published_on"
34
+ name="published_on"
35
+ variant="outlined"
36
+ yearsInPast={70}
37
+ helpText="Select published on date."
38
+ />
39
+ </div>
23
40
  </div>
24
41
  )
25
42
  }
@@ -156,7 +156,7 @@ export function DatePicker({
156
156
  e.stopPropagation()
157
157
  setIsOpen(true)
158
158
  }}
159
- value={date ? `${format(date, 'PP HH:mm')}` : ''}
159
+ value={date ? format(date, mode === 'datetime' ? 'PP HH:mm' : 'PP') : ''}
160
160
  placeHolder={placeHolderText}
161
161
  helpText={helpText}
162
162
  disabled={false}
@@ -272,7 +272,7 @@ export function DatePicker({
272
272
  </div>
273
273
  <div className={styles['status-and-actions']}>
274
274
  <div className={styles['content-status']}>
275
- {date ? `${format(date, 'PPPp')}` : 'No date selected'}
275
+ {date ? format(date, mode === 'datetime' ? 'PPPp' : 'PPP') : 'No date selected'}
276
276
  </div>
277
277
  <div className={styles['content-actions']}>
278
278
  <div>