Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add timepicker component #299

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7c87efd
custom components
maxxyouu Nov 17, 2023
61655a6
Restore export modal tab order between opens
zvonimirfras Nov 17, 2023
180fa74
Centralize linting rules in root (#291)
Akshat55 Nov 17, 2023
11e53cd
Support {{children}} in custom components
zvonimirfras Nov 23, 2023
9c2984b
Fix export template not working when items empty
zvonimirfras Nov 30, 2023
debbadf
fix: add workflow to release package (#292)
Akshat55 Dec 1, 2023
e080e1d
fix: remove nx set sha action (#293)
Akshat55 Dec 1, 2023
ea419ca
fix: add release config (#294)
Akshat55 Dec 1, 2023
6eeac0a
fix: add permission for id-token (#295)
Akshat55 Dec 1, 2023
8728221
fix: add repository url to packages (#296)
Akshat55 Dec 1, 2023
4a72a08
Add instructions to set up a new project w/ player
zvonimirfras Dec 2, 2023
d7523d3
Fix export error when custom collections undefined
zvonimirfras Dec 4, 2023
6fc2a14
Fix export error when custom collections undefined
zvonimirfras Dec 4, 2023
5200b0c
draft
maxxyouu Jan 24, 2024
300f3bd
draft
maxxyouu Jan 24, 2024
5ff39dd
svg timepicker
maxxyouu Jan 24, 2024
69a994f
timpicker
maxxyouu Jan 25, 2024
9d30222
conflict
maxxyouu Feb 1, 2024
83e7732
progress
maxxyouu Feb 15, 2024
1860d51
double quote to singlel quote
maxxyouu Feb 15, 2024
68087b2
double quote to singlel quote
maxxyouu Feb 15, 2024
f915cd8
slots
maxxyouu Feb 15, 2024
f32c890
build error
maxxyouu Feb 15, 2024
314db02
delete custom compo
maxxyouu Feb 22, 2024
d738613
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Feb 22, 2024
ad8bd29
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Feb 22, 2024
c8a653e
fix
maxxyouu Feb 22, 2024
4b67bee
Merge branch 'timepicker' of https://github.com/maxxyouu/carbon-ui-bu…
maxxyouu Feb 22, 2024
99e7581
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Feb 22, 2024
22df52c
fix
maxxyouu Feb 22, 2024
94aaf53
Merge branch 'timepicker' of https://github.com/maxxyouu/carbon-ui-bu…
maxxyouu Feb 22, 2024
056f1ad
label
maxxyouu Feb 22, 2024
ba39e73
s[ace
maxxyouu Feb 22, 2024
dd82d28
Merge branch 'main' into timepicker
Akshat55 Feb 29, 2024
04b0170
export fix
Mar 1, 2024
b7c03c5
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Mar 6, 2024
0e744d1
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Mar 6, 2024
7196d40
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Mar 6, 2024
593bf51
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Mar 6, 2024
0d8150d
pr revision
Mar 6, 2024
52be878
make am/pm and timezone optional
Mar 22, 2024
bb9d0df
make am/pm and timezone optional
Mar 22, 2024
3010c06
done
Mar 27, 2024
446c530
fix export
Apr 25, 2024
26dc9c2
fix action
Apr 25, 2024
c2d1736
Merge branch 'main' of https://github.com/IBM/carbon-ui-builder into …
May 3, 2024
86864e5
lint
May 3, 2024
666b1bb
chore: lint fix
Akshat55 May 10, 2024
54bcf0a
chore: lint exports
Akshat55 May 10, 2024
56c4a16
fix: remove redundant attribute from interface
Akshat55 May 10, 2024
286b536
fix: correct export conditions
Akshat55 May 10, 2024
3000eb1
fix: add missing events in export
Akshat55 May 16, 2024
da19cbd
fixed angular export
May 29, 2024
528347f
angular export
May 29, 2024
8793f16
resolve conflict
May 29, 2024
9bf08e3
angular export fix
May 29, 2024
cb7d011
fix react export import section
May 29, 2024
d906675
Merge branch 'main' into timepicker
Akshat55 May 29, 2024
b0608e3
Update player/react/src/lib/components/ui-time-picker.tsx
maxxyouu Jul 22, 2024
3378c01
Update player/react/src/lib/components/ui-time-picker.tsx
maxxyouu Jul 22, 2024
6bf50b8
Update sdk/react/src/lib/fragment-components/a-time-picker.tsx
maxxyouu Jul 22, 2024
50e59e1
revision
Jul 22, 2024
fe4c0fe
revision
Jul 22, 2024
d605326
revision
Jul 22, 2024
0d89669
style
Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions player/react/src/lib/components/ui-time-picker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { TimePickerSelect } from '@carbon/react';
import { SelectItem } from '@carbon/react';
import { TimePicker } from '@carbon/react';
import React from 'react';

export interface TimePickerState {
id: string | number;
codeContext?: {
name: string;
};
type: string;
placeholder: string;
disabled?: boolean;
invalid?: boolean;
invalidText?: string;
light?: boolean;
size?: string;
value?: string;
label?: string;
items: [];
}

export const UITimePicker = ({ state }: {
state: TimePickerState;
setState: (state: any) => void;
setGlobalState: (state: any) => void;
}) => {
if (state.type !== 'time-picker') {
// eslint-disable-next-line react/jsx-no-useless-fragment
return <></>;
}
return <TimePicker
id="time-picker"
light={state.light}
disabled={state.disabled}
invalid={state.invalid}
invalidText={state.invalidText}
placeholder={state.placeholder}
size={state.size}
labelText={state.label}>
<TimePickerSelect labelText="time-picker-1" id="time-picker-select-1">
<SelectItem value="AM" text="AM" />
<SelectItem value="PM" text="PM" />
</TimePickerSelect>
<TimePickerSelect labelText="time-picker-2" id="time-picker-select-2" >
{
state.items.map((step: any, index: number) => <SelectItem
value={step.value}
text={step.text}
key={index}
/>)
}
</TimePickerSelect>
</TimePicker>;
maxxyouu marked this conversation as resolved.
Show resolved Hide resolved
};
4 changes: 4 additions & 0 deletions player/react/src/lib/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { UITextAreaInput } from './components/ui-text-area';
import { UITextInput } from './components/ui-text-input';
import { UITile } from './components/ui-tile';
import { UITileFold } from './components/ui-tile-fold';
import { UITimePicker } from './components/ui-time-picker';
import { UIToggle } from './components/ui-toggle';
import { kebabCase } from 'lodash';

Expand Down Expand Up @@ -282,6 +283,9 @@ export const renderComponents = (
case 'text-input':
return <UITextInput key={state.id} state={state} sendSignal={sendSignal} setState={setState} setGlobalState={setGlobalState} />;

case 'time-picker':
return <UITimePicker key={state.id} state={state} setState={setState} setGlobalState={setGlobalState} />;

case 'overflow-menu':
return <UIOverflowMenu key={state.id} state={state} sendSignal={sendSignal} setState={setState} setGlobalState={setGlobalState} />;

Expand Down
7 changes: 7 additions & 0 deletions sdk/react/src/lib/assets/component-icons/time-picker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading