paris 0.17.7 → 0.17.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # paris
2
2
 
3
+ ## 0.17.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 0ca30b7: fix(drawer): make bottom panel spacer padding conditional on bottomPanelPadding prop
8
+ fix(accordionselect): add padding to check icon for better tap target
9
+ feat(combobox): add customValueOption override for independent styling
10
+
3
11
  ## 0.17.7
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "paris",
3
3
  "author": "Sanil Chawla <sanil@slingshot.fm> (https://sanil.co)",
4
4
  "description": "Paris is Slingshot's React design system. It's a collection of reusable components, design tokens, and guidelines that help us build consistent, accessible, and performant user interfaces.",
5
- "version": "0.17.7",
5
+ "version": "0.17.8",
6
6
  "homepage": "https://paris.slingshot.fm",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -94,6 +94,10 @@
94
94
  background: transparent;
95
95
  }
96
96
  }
97
+
98
+ .check {
99
+ padding: 4px;
100
+ }
97
101
  }
98
102
 
99
103
  .optionContent {
@@ -136,7 +136,7 @@ export const AccordionSelect: FC<AccordionSelectProps> = ({
136
136
 
137
137
  useEffect(() => {
138
138
  if (!closeOnClickOutside || !open) {
139
- return () => {};
139
+ return () => { };
140
140
  }
141
141
 
142
142
  const handleClickOutside = (e: MouseEvent) => {
@@ -253,7 +253,7 @@ export const AccordionSelect: FC<AccordionSelectProps> = ({
253
253
  )}
254
254
  </div>
255
255
  {isOptionSelected && (
256
- <Icon icon={Check} size={13} />
256
+ <Icon icon={Check} size={13} className={styles.check} />
257
257
  )}
258
258
  </button>
259
259
  );
@@ -164,6 +164,47 @@ export const AllowCustomValue: Story = {
164
164
  },
165
165
  };
166
166
 
167
+ export const CustomValueWithDivider: Story = {
168
+ args: {
169
+ ...ComboboxArgs,
170
+ allowCustomValue: true,
171
+ customValueString: 'Add "%v"',
172
+ },
173
+ render: function Render(args) {
174
+ const [selected, setSelected] = useState<Option | null>(null);
175
+ const [inputValue, setInputValue] = useState<string>('');
176
+ return createElement(
177
+ 'div',
178
+ {
179
+ style: { minHeight: '200px' },
180
+ },
181
+ createElement(Combobox<{ name: string }>, {
182
+ ...args,
183
+ value:
184
+ selected?.id === null
185
+ ? {
186
+ id: null,
187
+ node: inputValue,
188
+ metadata: {
189
+ name: inputValue,
190
+ },
191
+ }
192
+ : (selected as Option<{ name: string }> | null),
193
+ options: (args.options as Option<{ name: string }>[]).filter((o) => ((o.metadata?.name as string) || '')
194
+ .toLowerCase()
195
+ .includes(inputValue.toLowerCase())),
196
+ onChange: (e) => setSelected(e),
197
+ onInputChange: (e) => setInputValue(e),
198
+ overrides: {
199
+ customValueOption: {
200
+ style: { borderBottom: '5px solid var(--pte-new-colors-borderMedium)' },
201
+ },
202
+ },
203
+ }),
204
+ );
205
+ },
206
+ };
207
+
167
208
  export const HideOptionsInitially: Story = {
168
209
  args: ComboboxArgs,
169
210
  render: function Render(args) {
@@ -113,6 +113,7 @@ export type ComboboxProps<T extends Record<string, any>> = {
113
113
  input?: ComponentPropsWithoutRef<'input'>;
114
114
  optionsContainer?: ComponentPropsWithoutRef<'ul'>;
115
115
  option?: ComponentPropsWithoutRef<'li'>;
116
+ customValueOption?: ComponentPropsWithoutRef<'li'>;
116
117
  label?: TextProps<'label'>;
117
118
  description?: TextProps<'p'>;
118
119
  startEnhancerContainer?: ComponentPropsWithoutRef<'div'>;
@@ -249,11 +250,6 @@ export function Combobox<T extends Record<string, any> = Record<string, any>>({
249
250
  });
250
251
  }
251
252
  }}
252
- onBlur={(e) => {
253
- setQuery('');
254
- if (onInputChange) onInputChange('');
255
- if (overrides?.input?.onBlur) overrides.input.onBlur(e);
256
- }}
257
253
  aria-disabled={disabled}
258
254
  data-status={disabled ? 'disabled' : (status || 'default')}
259
255
  className={clsx(
@@ -324,10 +320,10 @@ export function Combobox<T extends Record<string, any> = Record<string, any>>({
324
320
  value={query}
325
321
  data-selected={false}
326
322
  className={clsx(
327
- overrides?.option?.className,
323
+ overrides?.customValueOption?.className,
328
324
  styles.option,
329
325
  )}
330
- {...overrides?.option}
326
+ {...overrides?.customValueOption}
331
327
  >
332
328
  <Text as="span" kind="paragraphSmall">
333
329
  {customValueString.replace('%v', query)}
@@ -423,6 +423,11 @@ $panelAnimationDelay: var(--pte-animations-duration-fast);
423
423
 
424
424
  .bottomPanelSpacer {
425
425
  padding: 20px;
426
+
427
+ &.noPadding {
428
+ padding: 0;
429
+ }
430
+
426
431
  opacity: 0;
427
432
  pointer-events: none;
428
433
  }
@@ -150,7 +150,7 @@ export type DrawerProps<T extends string[] | readonly string[] = string[]> = {
150
150
  */
151
151
  export const Drawer = <T extends string[] | readonly string[] = string[]>({
152
152
  isOpen = false,
153
- onClose = () => {},
153
+ onClose = () => { },
154
154
  title,
155
155
  hideTitle = false,
156
156
  hideCloseButton = false,
@@ -383,7 +383,7 @@ export const Drawer = <T extends string[] | readonly string[] = string[]>({
383
383
  </div>
384
384
  {bottomPanel && (
385
385
  <>
386
- <div tabIndex={-1} aria-hidden="true" className={clsx(styles.bottomPanelSpacer, overrides?.bottomPanelSpacer?.className)}>
386
+ <div tabIndex={-1} aria-hidden="true" className={clsx(styles.bottomPanelSpacer, { [styles.noPadding]: !bottomPanelPadding }, overrides?.bottomPanelSpacer?.className)}>
387
387
  {bottomPanel}
388
388
  </div>
389
389
  <div className={clsx(styles.bottomPanel, overrides?.bottomPanel?.className)}>