@soul-refiner/design-system 0.2.90 → 0.2.92
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.
|
@@ -3,9 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { MONTHS, WEEKDAYS } from '../../../common';
|
|
5
5
|
import { Button, P } from '../..';
|
|
6
|
-
import { ChevronLeft, ChevronRight } from '../../../icons';
|
|
6
|
+
import { ChevronLeft, ChevronRight, Calendar as CalendarIcon, } from '../../../icons';
|
|
7
7
|
import { buildCalendar, zeroPad } from '../../../utils';
|
|
8
|
-
import { Icons } from 'index';
|
|
9
8
|
export const CalendarInput = ({ selectedDate, onSelect: parentOnSelect, }) => {
|
|
10
9
|
const today = new Date();
|
|
11
10
|
today.setHours(0);
|
|
@@ -71,7 +70,7 @@ export const CalendarInput = ({ selectedDate, onSelect: parentOnSelect, }) => {
|
|
|
71
70
|
return (React.createElement(Wrapper, { onBlurCapture: handleBlur, ref: pickerRef, tabIndex: 0 },
|
|
72
71
|
React.createElement(InputWrapper, null,
|
|
73
72
|
React.createElement(Input, { value: `${month} / ${day} / ${year}`, onFocus: handleShow, style: { letterSpacing: '1px', fontSize: '16px' }, readOnly: true }),
|
|
74
|
-
React.createElement(
|
|
73
|
+
React.createElement(CalendarIcon, null)),
|
|
75
74
|
show && (React.createElement(DateSelector, null,
|
|
76
75
|
React.createElement(InnerWrapper, null,
|
|
77
76
|
React.createElement("div", null,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { Dropdown } from '
|
|
3
|
-
import { Icons } from 'index';
|
|
2
|
+
import { Dropdown } from '../../actions/dropdown';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import styled from 'styled-components';
|
|
5
|
+
import { Clock } from '../../../icons';
|
|
6
6
|
export const Time = ({ selectedTime, setTime, selectedPeriod, setPeriod, }) => {
|
|
7
7
|
const hours = React.useMemo(() => {
|
|
8
8
|
const hours = [];
|
|
@@ -19,7 +19,7 @@ export const Time = ({ selectedTime, setTime, selectedPeriod, setPeriod, }) => {
|
|
|
19
19
|
label: hour,
|
|
20
20
|
})), containerSx: "height: 440px;", trigger: React.createElement(InputWrapper, null,
|
|
21
21
|
React.createElement(Input, { readOnly: true, value: `${selectedTime} ${selectedPeriod}` }),
|
|
22
|
-
React.createElement(
|
|
22
|
+
React.createElement(Clock, null)), additionalOptions: [
|
|
23
23
|
{
|
|
24
24
|
label: 'AM',
|
|
25
25
|
value: 'AM',
|
|
@@ -16,6 +16,10 @@ declare const InnerNav: {
|
|
|
16
16
|
({ href, label, sx }: InnerNavBackButtonProps): React.JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
|
+
Header: {
|
|
20
|
+
({ children }: InnerNavHeaderProps): React.JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
19
23
|
Drawer: {
|
|
20
24
|
({ children, label }: InnerNavDrawerProps): React.JSX.Element;
|
|
21
25
|
displayName: string;
|
|
@@ -74,6 +78,10 @@ export interface InnerNavBackButtonProps {
|
|
|
74
78
|
label: React.ReactNode;
|
|
75
79
|
sx?: string;
|
|
76
80
|
}
|
|
81
|
+
/*************************************************************************************************************************
|
|
82
|
+
* Header
|
|
83
|
+
*/
|
|
84
|
+
export type InnerNavHeaderProps = React.PropsWithChildren;
|
|
77
85
|
/*************************************************************************************************************************
|
|
78
86
|
* Create Button
|
|
79
87
|
*/
|
|
@@ -4,6 +4,7 @@ import { Button } from '../../../components/actions/button';
|
|
|
4
4
|
import { Drawer } from '../../../components/surfaces/drawer';
|
|
5
5
|
import { ChevronDown, ChevronLeft, ChevronUp, Plus } from '../../../icons';
|
|
6
6
|
const INNER_NAV_CHILD_TYPES = [
|
|
7
|
+
'Header',
|
|
7
8
|
'Item',
|
|
8
9
|
'Dropdown',
|
|
9
10
|
'BackButton',
|
|
@@ -15,6 +16,7 @@ const INNER_NAV_CHILD_TYPES = [
|
|
|
15
16
|
*/
|
|
16
17
|
const InnerNav = ({ children }) => {
|
|
17
18
|
const elementsByType = {
|
|
19
|
+
Header: [],
|
|
18
20
|
Item: [],
|
|
19
21
|
Dropdown: [],
|
|
20
22
|
BackButton: [],
|
|
@@ -25,8 +27,8 @@ const InnerNav = ({ children }) => {
|
|
|
25
27
|
for (const child of _children) {
|
|
26
28
|
const isValidChild = React.isValidElement(child);
|
|
27
29
|
const isInnerNavChild = isValidChild &&
|
|
28
|
-
INNER_NAV_CHILD_TYPES.includes(child?.type?.displayName
|
|
29
|
-
if (
|
|
30
|
+
INNER_NAV_CHILD_TYPES.includes(child?.type?.displayName?.replace('InnerNav.', ''));
|
|
31
|
+
if (isInnerNavChild) {
|
|
30
32
|
const type = child?.type?.displayName.replace('InnerNav.', '');
|
|
31
33
|
elementsByType[type].push(child);
|
|
32
34
|
}
|
|
@@ -35,6 +37,7 @@ const InnerNav = ({ children }) => {
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
return (React.createElement(NavWrapper, { "aria-label": "side-navigation" },
|
|
40
|
+
React.createElement("div", null, elementsByType['Header']),
|
|
38
41
|
React.createElement("div", null, elementsByType['BackButton']),
|
|
39
42
|
React.createElement("div", null, elementsByType['Drawer']),
|
|
40
43
|
React.createElement("div", null, elementsByType['Item']),
|
|
@@ -137,6 +140,12 @@ const BackButton = styled.a `
|
|
|
137
140
|
`;
|
|
138
141
|
InnerNav.BackButton = InnerNavBackButton;
|
|
139
142
|
InnerNavBackButton.displayName = 'InnerNav.BackButton';
|
|
143
|
+
const InnerNavHeader = ({ children }) => {
|
|
144
|
+
return React.createElement(HeaderWrapper, null, children);
|
|
145
|
+
};
|
|
146
|
+
const HeaderWrapper = styled.div ``;
|
|
147
|
+
InnerNav.Header = InnerNavHeader;
|
|
148
|
+
InnerNavHeader.displayName = 'InnerNav.Header';
|
|
140
149
|
const InnerNavDrawer = ({ children, label }) => {
|
|
141
150
|
return (React.createElement(Drawer, null,
|
|
142
151
|
React.createElement(Drawer.Trigger, null,
|