elseware-ui 3.0.13 → 3.0.15

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.
@@ -1,30 +1,30 @@
1
- import * as React from 'react';
2
- import { B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps } from './resolveGlobalConfigs-TVdFbK-t.mjs';
3
- export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, l as CheckboxColumns, m as CheckboxOption, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-TVdFbK-t.mjs';
1
+ import * as react from 'react';
2
+ import { B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps } from './resolveGlobalConfigs-ClQlBbvH.mjs';
3
+ export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, l as CheckboxColumns, m as CheckboxOption, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-ClQlBbvH.mjs';
4
4
  import { FormikValues } from 'formik';
5
5
 
6
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<never>>;
6
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<never>>;
7
7
 
8
- declare function Checkbox(checkboxProps: CheckboxProps): React.JSX.Element;
8
+ declare function Checkbox(checkboxProps: CheckboxProps): react.JSX.Element;
9
9
 
10
- declare function DateSelector(dateSelectorProps: DateSelectorProps): React.JSX.Element;
10
+ declare function DateSelector(dateSelectorProps: DateSelectorProps): react.JSX.Element;
11
11
 
12
- declare function Form<Values extends FormikValues = FormikValues>({ initialValues, validationSchema, enableReinitialize, children, className, contentClassName, onSubmit, onChange, onDirtyChange, }: FormProps<Values>): React.JSX.Element;
12
+ declare function Form<Values extends FormikValues = FormikValues>({ initialValues, validationSchema, enableReinitialize, children, className, contentClassName, onSubmit, onChange, onDirtyChange, }: FormProps<Values>): react.JSX.Element;
13
13
 
14
- declare function FormResponse({ text, variant, shape, size, className, textClassName, }: FormResponseProps): React.JSX.Element | null;
14
+ declare function FormResponse({ text, variant, shape, size, className, textClassName, }: FormResponseProps): react.JSX.Element | null;
15
15
 
16
- declare function Input(inputProps: InputProps): React.JSX.Element;
16
+ declare function Input(inputProps: InputProps): react.JSX.Element;
17
17
 
18
- declare function InputFile(inputFileProps: InputFileProps): React.JSX.Element;
18
+ declare function InputFile(inputFileProps: InputFileProps): react.JSX.Element;
19
19
 
20
- declare function InputLabel({ text, children, className, floating, errored, disabled, animatedValue, }: InputLabelProps): React.JSX.Element;
20
+ declare function InputLabel({ text, children, className, floating, errored, disabled, animatedValue, }: InputLabelProps): react.JSX.Element;
21
21
 
22
- declare function InputResponse({ name, visibility, variant, className, message, }: InputResponseProps): React.JSX.Element | null;
22
+ declare function InputResponse({ name, visibility, variant, className, message, }: InputResponseProps): react.JSX.Element | null;
23
23
 
24
- declare function Select(selectProps: SelectProps): React.JSX.Element;
24
+ declare function Select(selectProps: SelectProps): react.JSX.Element;
25
25
 
26
- declare function Tags(tagsProps: TagsProps): React.JSX.Element;
26
+ declare function Tags(tagsProps: TagsProps): react.JSX.Element;
27
27
 
28
- declare function TextArea(textAreaProps: TextAreaProps): React.JSX.Element;
28
+ declare function TextArea(textAreaProps: TextAreaProps): react.JSX.Element;
29
29
 
30
30
  export { Button, ButtonProps, Checkbox, CheckboxProps, DateSelector, DateSelectorProps, Form, FormProps, FormResponse, FormResponseProps, Input, InputFile, InputFileProps, InputLabel, InputLabelProps, InputProps, InputResponse, InputResponseProps, Select, SelectProps, Tags, TagsProps, TextArea, TextAreaProps };
@@ -1,30 +1,30 @@
1
- import * as React from 'react';
2
- import { B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps } from './resolveGlobalConfigs-TVdFbK-t.js';
3
- export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, l as CheckboxColumns, m as CheckboxOption, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-TVdFbK-t.js';
1
+ import * as react from 'react';
2
+ import { B as ButtonProps, C as CheckboxProps, D as DateSelectorProps, F as FormProps, a as FormResponseProps, I as InputProps, b as InputFileProps, c as InputLabelProps, d as InputResponseProps, S as SelectProps, T as TagsProps, e as TextAreaProps } from './resolveGlobalConfigs-ClQlBbvH.js';
3
+ export { f as BaseDateSelectorProps, g as BaseSelectProps, h as BaseTagsProps, i as BaseTextAreaProps, j as ButtonIcon, k as ButtonMode, l as CheckboxColumns, m as CheckboxOption, E as EUIComponentDefaults, n as EUIConfigs, o as EUIProvider, p as EUIRoute, q as FormChangeMeta, r as FormChildren, s as InputFilePicker, t as InputFileValue, N as NativeInputFileValue, u as SelectOption, v as SelectOptionValue, w as resolveWithGlobal, x as useEUIConfig } from './resolveGlobalConfigs-ClQlBbvH.js';
4
4
  import { FormikValues } from 'formik';
5
5
 
6
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<never>>;
6
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<never>>;
7
7
 
8
- declare function Checkbox(checkboxProps: CheckboxProps): React.JSX.Element;
8
+ declare function Checkbox(checkboxProps: CheckboxProps): react.JSX.Element;
9
9
 
10
- declare function DateSelector(dateSelectorProps: DateSelectorProps): React.JSX.Element;
10
+ declare function DateSelector(dateSelectorProps: DateSelectorProps): react.JSX.Element;
11
11
 
12
- declare function Form<Values extends FormikValues = FormikValues>({ initialValues, validationSchema, enableReinitialize, children, className, contentClassName, onSubmit, onChange, onDirtyChange, }: FormProps<Values>): React.JSX.Element;
12
+ declare function Form<Values extends FormikValues = FormikValues>({ initialValues, validationSchema, enableReinitialize, children, className, contentClassName, onSubmit, onChange, onDirtyChange, }: FormProps<Values>): react.JSX.Element;
13
13
 
14
- declare function FormResponse({ text, variant, shape, size, className, textClassName, }: FormResponseProps): React.JSX.Element | null;
14
+ declare function FormResponse({ text, variant, shape, size, className, textClassName, }: FormResponseProps): react.JSX.Element | null;
15
15
 
16
- declare function Input(inputProps: InputProps): React.JSX.Element;
16
+ declare function Input(inputProps: InputProps): react.JSX.Element;
17
17
 
18
- declare function InputFile(inputFileProps: InputFileProps): React.JSX.Element;
18
+ declare function InputFile(inputFileProps: InputFileProps): react.JSX.Element;
19
19
 
20
- declare function InputLabel({ text, children, className, floating, errored, disabled, animatedValue, }: InputLabelProps): React.JSX.Element;
20
+ declare function InputLabel({ text, children, className, floating, errored, disabled, animatedValue, }: InputLabelProps): react.JSX.Element;
21
21
 
22
- declare function InputResponse({ name, visibility, variant, className, message, }: InputResponseProps): React.JSX.Element | null;
22
+ declare function InputResponse({ name, visibility, variant, className, message, }: InputResponseProps): react.JSX.Element | null;
23
23
 
24
- declare function Select(selectProps: SelectProps): React.JSX.Element;
24
+ declare function Select(selectProps: SelectProps): react.JSX.Element;
25
25
 
26
- declare function Tags(tagsProps: TagsProps): React.JSX.Element;
26
+ declare function Tags(tagsProps: TagsProps): react.JSX.Element;
27
27
 
28
- declare function TextArea(textAreaProps: TextAreaProps): React.JSX.Element;
28
+ declare function TextArea(textAreaProps: TextAreaProps): react.JSX.Element;
29
29
 
30
30
  export { Button, ButtonProps, Checkbox, CheckboxProps, DateSelector, DateSelectorProps, Form, FormProps, FormResponse, FormResponseProps, Input, InputFile, InputFileProps, InputLabel, InputLabelProps, InputProps, InputResponse, InputResponseProps, Select, SelectProps, Tags, TagsProps, TextArea, TextAreaProps };
@@ -217,6 +217,7 @@ function useButton(props) {
217
217
  const {
218
218
  // Consumed by the shared model
219
219
  icon,
220
+ iconPosition = "leading",
220
221
  text,
221
222
  children,
222
223
  loading = false,
@@ -244,7 +245,19 @@ function useButton(props) {
244
245
  onMouseMove: _onMouseMove,
245
246
  ...rootRest
246
247
  } = props;
247
- const { shape: resolvedShape, size: resolvedSize, variant: resolvedVariant, appearance: resolvedAppearance } = useResolvedButtonConfig({ compact, mode, variant, appearance, shape, size });
248
+ const {
249
+ shape: resolvedShape,
250
+ size: resolvedSize,
251
+ variant: resolvedVariant,
252
+ appearance: resolvedAppearance
253
+ } = useResolvedButtonConfig({
254
+ compact,
255
+ mode,
256
+ variant,
257
+ appearance,
258
+ shape,
259
+ size
260
+ });
248
261
  const tokens = buttonSizeTokens[resolvedSize];
249
262
  const variantClassName = resolveButtonVariantStyles({
250
263
  appearance: resolvedAppearance,
@@ -264,6 +277,7 @@ function useButton(props) {
264
277
  loading,
265
278
  iconSize: tokens.icon,
266
279
  icon: resolvedIcon,
280
+ iconPosition,
267
281
  label,
268
282
  hasTextLabel: typeof label === "string" || typeof label === "number",
269
283
  variantClassName,
@@ -290,6 +304,38 @@ var Button = react.forwardRef(
290
304
  testID
291
305
  } = props;
292
306
  const model = useButton(props);
307
+ const trailing = model.iconPosition === "trailing";
308
+ const iconSlot = model.loading || model.icon ? /* @__PURE__ */ jsxRuntime.jsx(
309
+ reactNative.View,
310
+ {
311
+ className: cn(
312
+ "shrink-0 items-center justify-center",
313
+ model.tokens.slot
314
+ ),
315
+ children: model.loading ? /* @__PURE__ */ jsxRuntime.jsx(
316
+ reactNative.ActivityIndicator,
317
+ {
318
+ className: model.labelColorClassName,
319
+ size: "small"
320
+ }
321
+ ) : model.icon
322
+ }
323
+ ) : null;
324
+ const labelNode = model.hasTextLabel ? /* @__PURE__ */ jsxRuntime.jsx(
325
+ reactNative.Text,
326
+ {
327
+ className: cn(
328
+ "font-bold",
329
+ model.tokens.text,
330
+ model.tokens.leading,
331
+ model.labelColorClassName,
332
+ labelClassName
333
+ ),
334
+ numberOfLines: 1,
335
+ style: nativeLabelBaseStyle,
336
+ children: model.label
337
+ }
338
+ ) : model.label;
293
339
  return /* @__PURE__ */ jsxRuntime.jsx(
294
340
  reactNative.Pressable,
295
341
  {
@@ -297,7 +343,10 @@ var Button = react.forwardRef(
297
343
  ref,
298
344
  accessibilityLabel,
299
345
  accessibilityRole,
300
- accessibilityState: { disabled: model.isBusy, selected: model.selected },
346
+ accessibilityState: {
347
+ disabled: model.isBusy,
348
+ selected: model.selected
349
+ },
301
350
  testID,
302
351
  disabled: model.isBusy,
303
352
  onPress: model.onPress,
@@ -321,37 +370,8 @@ var Button = react.forwardRef(
321
370
  contentClassName
322
371
  ),
323
372
  children: [
324
- (model.loading || model.icon) && /* @__PURE__ */ jsxRuntime.jsx(
325
- reactNative.View,
326
- {
327
- className: cn(
328
- "shrink-0 items-center justify-center",
329
- model.tokens.slot
330
- ),
331
- children: model.loading ? /* @__PURE__ */ jsxRuntime.jsx(
332
- reactNative.ActivityIndicator,
333
- {
334
- className: model.labelColorClassName,
335
- size: "small"
336
- }
337
- ) : model.icon
338
- }
339
- ),
340
- model.hasTextLabel ? /* @__PURE__ */ jsxRuntime.jsx(
341
- reactNative.Text,
342
- {
343
- className: cn(
344
- "font-bold",
345
- model.tokens.text,
346
- model.tokens.leading,
347
- model.labelColorClassName,
348
- labelClassName
349
- ),
350
- numberOfLines: 1,
351
- style: nativeLabelBaseStyle,
352
- children: model.label
353
- }
354
- ) : model.label
373
+ trailing ? labelNode : iconSlot,
374
+ trailing ? iconSlot : labelNode
355
375
  ]
356
376
  }
357
377
  )