Skip to content

Commit 0ca8b8d

Browse files
Merge pull request #2206 from matuzalemsteles/docs-time-picker
chore(next.clayui.com): add TimePicker document
2 parents e3faffe + 728ca67 commit 0ca8b8d

File tree

10 files changed

+295
-27
lines changed

10 files changed

+295
-27
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "Time Picker"
3+
description: "Time pickers let users select a time for a form."
4+
packageNpm: "@clayui/time-picker"
5+
packageVersion: "3.0.0-milestone.1"
6+
packageStatus: "Beta"
7+
---
8+
9+
import {TimePickerWithState} from '../../../src/components/clay/TimePicker';
10+
11+
<div class="nav-toc">
12+
13+
- [API](#api)
14+
15+
</div>
16+
17+
<TimePickerWithState />
18+
19+
## API
20+
21+
<div>
22+
[APITable "clay-time-picker/src/index.tsx"]
23+
</div>

next.clayui.com/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@clayui/radio-group": "^3.0.0-milestone.1",
3535
"@clayui/select": "^3.0.0-milestone.1",
3636
"@clayui/sticker": "^3.0.0-milestone.1",
37+
"@clayui/time-picker": "^3.0.0-milestone.1",
3738
"@mdx-js/mdx": "^1.0.20",
3839
"@mdx-js/react": "^1.0.20",
3940
"@mdx-js/tag": "^0.20.3",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* © 2019 Liferay, Inc. <https://liferay.com>
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
import ClayTimePicker from '@clayui/time-picker';
8+
import Editor from './Editor';
9+
import React, {useState} from 'react';
10+
11+
const spritemap = '/images/icons/icons.svg';
12+
13+
const timePickerCode = `const Component = () => {
14+
const [state, setState] = useState({
15+
hours: '--',
16+
minutes: '--',
17+
});
18+
19+
return (
20+
<ClayTimePicker
21+
spritemap={spritemap}
22+
onInputChange={setState}
23+
values={state}
24+
timezone="GMT+01:00"
25+
use12Hours
26+
/>
27+
);
28+
}
29+
30+
render(<Component />)`;
31+
32+
const TimePickerWithState = () => {
33+
const scope = {ClayTimePicker, spritemap, useState};
34+
return <Editor code={timePickerCode} scope={scope} />;
35+
};
36+
export {TimePickerWithState};

next.clayui.com/static/css/atlas.css

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10392,6 +10392,11 @@ label {
1039210392
box-shadow: 0 0 0 0.125rem #FFF, 0 0 0 0.25rem #80acff;
1039310393
color: #272833;
1039410394
outline: 0; }
10395+
.form-control.disabled {
10396+
background-color: #F1F2F5;
10397+
border-color: #F1F2F5;
10398+
color: #A7A9BC;
10399+
cursor: not-allowed; }
1039510400
.form-control[type="range"] {
1039610401
background-color: transparent;
1039710402
border-color: transparent; }
@@ -10510,6 +10515,11 @@ div.form-control-sm {
1051010515
padding: 0; }
1051110516
.form-control-inset:focus {
1051210517
outline: 0; }
10518+
.form-control-inset:disabled {
10519+
background-color: #F1F2F5;
10520+
border-color: #F1F2F5;
10521+
color: #A7A9BC;
10522+
cursor: not-allowed; }
1051310523

1051410524
.form-control[multiple],
1051510525
.form-control[size] {
@@ -11184,6 +11194,95 @@ label.custom-control-label {
1118411194
.custom-control-inline + .custom-control-inline {
1118511195
margin-left: 1rem; }
1118611196

11197+
.clay-time .btn {
11198+
align-items: center;
11199+
color: #6B6C7E;
11200+
display: inline-flex;
11201+
font-size: 0.75rem;
11202+
height: 1.5rem;
11203+
justify-content: center;
11204+
padding-bottom: 0;
11205+
padding-left: 0;
11206+
padding-right: 0;
11207+
padding-top: 0;
11208+
width: 1.5rem; }
11209+
.clay-time .btn:focus, .clay-time .btn.focus {
11210+
box-shadow: 0 0 0 1px #80ACFF; }
11211+
.clay-time .btn:not([disabled]):not(.disabled):active:focus, .clay-time .btn:not([disabled]):not(.disabled).active:focus,
11212+
.show > .clay-time .btn.dropdown-toggle:focus {
11213+
box-shadow: 0 0 0 1px #80ACFF; }
11214+
.clay-time .btn .lexicon-icon {
11215+
margin-top: 0; }
11216+
11217+
.clay-time .form-control {
11218+
align-items: center;
11219+
display: inline-flex;
11220+
flex-wrap: wrap;
11221+
padding-bottom: 0.125rem;
11222+
padding-top: 0.125rem; }
11223+
11224+
.clay-time .form-control-inset {
11225+
text-align: center;
11226+
width: 1.25rem; }
11227+
11228+
.clay-time .input-group-text {
11229+
background-color: transparent;
11230+
border-color: transparent;
11231+
padding-bottom: 0;
11232+
padding-left: 0;
11233+
padding-right: 0;
11234+
padding-top: 0; }
11235+
11236+
.clay-time .clay-time-ampm {
11237+
font-weight: 500;
11238+
text-transform: uppercase;
11239+
width: 1.5rem; }
11240+
11241+
.clay-time-divider {
11242+
margin-left: -3px;
11243+
margin-right: -3px; }
11244+
11245+
.clay-time-edit {
11246+
margin-right: auto;
11247+
padding-left: 0.5rem;
11248+
padding-right: 0.5rem; }
11249+
.clay-time-edit:first-child {
11250+
margin-left: -0.5rem; }
11251+
.clay-time-edit:last-child {
11252+
margin-right: -0.5rem; }
11253+
11254+
.clay-time-action-group {
11255+
align-items: center;
11256+
display: flex;
11257+
flex-wrap: wrap;
11258+
margin-left: -0.125rem;
11259+
margin-right: -0.125rem; }
11260+
11261+
.clay-time-action-group-item {
11262+
align-items: center;
11263+
display: flex;
11264+
margin-left: 0.125rem;
11265+
margin-right: 0.125rem; }
11266+
11267+
.clay-time-inner-spin {
11268+
border-color: #cdced9;
11269+
border-radius: 8px;
11270+
border-style: solid;
11271+
border-width: 1px; }
11272+
.clay-time-inner-spin .btn {
11273+
align-items: center;
11274+
border-radius: 8px;
11275+
border-width: 0;
11276+
display: inline-flex;
11277+
font-size: 8px;
11278+
height: auto;
11279+
justify-content: center;
11280+
padding-bottom: 2px;
11281+
padding-left: 2px;
11282+
padding-right: 2px;
11283+
padding-top: 2px;
11284+
width: auto; }
11285+
1118711286
.date-picker .input-group-text {
1118811287
background-color: transparent;
1118911288
border-color: transparent;
@@ -11380,8 +11479,8 @@ label.custom-control-label {
1138011479
word-wrap: break-word; }
1138111480

1138211481
.form-feedback-indicator {
11383-
margin-left: 0.3125rem;
11384-
margin-right: 0.3125rem; }
11482+
margin-left: 0;
11483+
margin-right: 0; }
1138511484
.form-feedback-indicator:first-child {
1138611485
margin-left: 0; }
1138711486

@@ -14824,6 +14923,9 @@ a.collapse-icon {
1482414923
@media (max-width: 1279.98px) {
1482514924
.management-bar.navbar-expand-xl.navbar-collapse-absolute .navbar-collapse {
1482614925
border-color: transparent; } }
14926+
.management-bar.navbar-nowrap .navbar-text {
14927+
white-space: normal;
14928+
word-wrap: break-word; }
1482714929

1482814930
.management-bar-light {
1482914931
background-color: #FFF;

next.clayui.com/static/css/atlas.css.map

Lines changed: 19 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.clayui.com/static/css/base.css

Lines changed: 94 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.clayui.com/static/css/base.css.map

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.clayui.com/static/css/bootstrap.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.clayui.com/static/css/bootstrap.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/clay-time-picker/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const ClayTimePicker: React.FunctionComponent<IProps> = ({
134134
minutes: DEFAULT_VALUE,
135135
},
136136
onInputChange = () => {},
137-
}) => {
137+
}: IProps) => {
138138
const useConfig: Config = config[use12Hours ? 'use12Hours' : 'use24Hours'];
139139
const [actionVisible, setActionVisible] = useState(false);
140140
const [isFocused, setIsFocused] = useState();

0 commit comments

Comments
 (0)