Skip to content

Commit 72090d6

Browse files
Merge pull request #841 from buildo/expand-datefield-config
Allow config of internal padding and range separator size in DateField
2 parents 52cd4af + cf13931 commit 72090d6

File tree

12 files changed

+28
-2
lines changed

12 files changed

+28
-2
lines changed

ci/tasks/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ outputs:
1414

1515
params:
1616
NODE_OPTIONS: --max-old-space-size=4096
17+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
1718

1819
run:
1920
dir: bento

ci/tasks/chromatic.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ inputs:
1212
params:
1313
CHROMATIC_PROJECT_TOKEN: ((chromatic-project-token))
1414
CHROMATIC_OPTIONS:
15+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
1516

1617
run:
1718
dir: bento

ci/tasks/circular-deps.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image_resource:
99
inputs:
1010
- name: bento
1111

12+
params:
13+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
14+
1215
run:
1316
dir: bento
1417
path: ash

ci/tasks/eslint.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image_resource:
99
inputs:
1010
- name: bento
1111

12+
params:
13+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
14+
1215
run:
1316
dir: bento
1417
path: ash

ci/tasks/install.yml

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ outputs:
1515
caches:
1616
- path: bento/.pnpm-store
1717

18+
params:
19+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
20+
1821
run:
1922
dir: bento
2023
path: ash

ci/tasks/prettier.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image_resource:
99
inputs:
1010
- name: bento
1111

12+
params:
13+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
14+
1215
run:
1316
dir: bento
1417
path: ash

ci/tasks/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ params:
1717
NPM_TOKEN: ((npm_token))
1818
SSH_PRIVATE_KEY: ((private-key))
1919
GITHUB_TOKEN: ((github-token))
20+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
2021

2122
run:
2223
path: ci/tasks/release.sh

ci/tasks/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ inputs:
1111

1212
params:
1313
CI: true
14+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
1415

1516
run:
1617
dir: bento

ci/tasks/typecheck.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image_resource:
99
inputs:
1010
- name: bento
1111

12+
params:
13+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
14+
1215
run:
1316
dir: bento
1417
path: ash

packages/bento-design-system/src/DateField/Config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { Children } from "../util/Children";
88
export type DateFieldConfig = {
99
radius: BorderRadiusConfig;
1010
padding: NonNullable<BentoSprinkles["padding"]>;
11+
internalPadding: NonNullable<BentoSprinkles["padding"]>;
1112
elevation: "none" | "small" | "medium" | "large";
13+
rangeSeparatorSize: IconProps["size"];
1214
monthYearLabelSize: LabelProps["size"];
1315
dayOfWeekLabelSize: LabelProps["size"];
1416
previousMonthIcon: (props: IconProps) => Children;

packages/bento-design-system/src/DateField/Input.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function DateField({ fieldProps }: { fieldProps: AriaDateFieldOptions<CalendarDa
8282

8383
export function Input(props: Props) {
8484
const config = useBentoConfig().input;
85+
const dateFieldConfig = useBentoConfig().dateField;
8586

8687
const { observe: rightAccessoryRef, width: rightAccessoryWidth } = useDimensions({
8788
// This is needed to include the padding in the width
@@ -146,10 +147,12 @@ export function Input(props: Props) {
146147
{props.type === "single" ? (
147148
<DateField fieldProps={props.fieldProps} />
148149
) : (
149-
<Columns space={16}>
150+
<Columns space={dateFieldConfig.internalPadding} alignY="stretch">
150151
<DateField fieldProps={props.fieldProps.start} />
151152
<Column width="content">
152-
<IconMinus size={24} />
153+
<Box display="flex" height="full" alignItems="center">
154+
<IconMinus size={dateFieldConfig.rangeSeparatorSize} />
155+
</Box>
153156
</Column>
154157
<DateField fieldProps={props.fieldProps.end} />
155158
</Columns>

packages/bento-design-system/src/util/defaultConfigs.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ export const tooltip: TooltipConfig = {
677677
export const dateField: DateFieldConfig = {
678678
radius: 24,
679679
padding: 24,
680+
internalPadding: 16,
680681
elevation: "medium",
682+
rangeSeparatorSize: 24,
681683
monthYearLabelSize: "large",
682684
dayOfWeekLabelSize: "large",
683685
previousMonthIcon: IconChevronLeft,

0 commit comments

Comments
 (0)