@teja-app/ui 0.0.3 → 0.0.4

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.
@@ -15,7 +15,7 @@ import type { SelectProps } from './Select.types';
15
15
  * />
16
16
  * ```
17
17
  */
18
- export declare function Select({ options, value, onChange, placeholder, label, error, helperText, disabled, required, fullWidth, className, isLoading, loadingText, }: SelectProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function Select({ options, value, onChange, placeholder, label, error, helperText, disabled, required, fullWidth, className, isLoading, loadingText, placement, }: SelectProps): import("react/jsx-runtime").JSX.Element;
19
19
  export declare namespace Select {
20
20
  var displayName: string;
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAyB,EACzB,KAAK,EACL,KAAK,EACL,UAAU,EACV,QAAgB,EAChB,QAAgB,EAChB,SAAiB,EACjB,SAAS,EACT,SAAiB,EACjB,WAA0B,GAC3B,EAAE,WAAW,2CAqIb;yBAnJe,MAAM"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAyB,EACzB,KAAK,EACL,KAAK,EACL,UAAU,EACV,QAAgB,EAChB,QAAgB,EAChB,SAAiB,EACjB,SAAS,EACT,SAAiB,EACjB,WAA0B,EAC1B,SAAoB,GACrB,EAAE,WAAW,2CA0Ib;yBAzJe,MAAM"}
@@ -6,6 +6,7 @@ export interface SelectOption {
6
6
  /** Whether the option is disabled */
7
7
  disabled?: boolean;
8
8
  }
9
+ export type SelectPlacement = 'bottom' | 'top';
9
10
  export interface SelectProps {
10
11
  /** Array of options to display */
11
12
  options: SelectOption[];
@@ -33,5 +34,7 @@ export interface SelectProps {
33
34
  isLoading?: boolean;
34
35
  /** Text to show while loading (default: "Loading...") */
35
36
  loadingText?: string;
37
+ /** Placement of the dropdown (default: "bottom") */
38
+ placement?: SelectPlacement;
36
39
  }
37
40
  //# sourceMappingURL=Select.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B"}
@@ -1,3 +1,3 @@
1
1
  export { Select } from './Select';
2
- export type { SelectProps, SelectOption } from './Select.types';
2
+ export type { SelectProps, SelectOption, SelectPlacement } from './Select.types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.cjs CHANGED
@@ -7240,7 +7240,8 @@ function Select({
7240
7240
  fullWidth = false,
7241
7241
  className,
7242
7242
  isLoading = false,
7243
- loadingText = "Loading..."
7243
+ loadingText = "Loading...",
7244
+ placement = "bottom"
7244
7245
  }) {
7245
7246
  const selectedOption = options.find((opt) => opt.value === value);
7246
7247
  const hasError = !!error2;
@@ -7314,43 +7315,52 @@ function Select({
7314
7315
  leave: "transition ease-in duration-100",
7315
7316
  leaveFrom: "opacity-100",
7316
7317
  leaveTo: "opacity-0",
7317
- children: /* @__PURE__ */ jsxRuntime.jsx(Bt, { className: "absolute z-dropdown mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700", children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
7318
- It,
7318
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7319
+ Bt,
7319
7320
  {
7320
- disabled: option.disabled,
7321
- value: option.value,
7322
- className: ({ active, selected }) => utils_index.cn(
7323
- "relative cursor-pointer select-none py-2.5 pl-10 pr-4",
7324
- // Light mode
7325
- active ? "bg-gold-50 text-primary-900" : "text-primary-900",
7326
- // Dark mode
7327
- active ? "dark:bg-primary-700 dark:text-primary-100" : "dark:text-primary-200",
7328
- option.disabled && "cursor-not-allowed opacity-50",
7329
- selected && "font-medium"
7321
+ className: utils_index.cn(
7322
+ "absolute z-dropdown max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-primary-800 dark:ring-primary-700",
7323
+ placement === "top" ? "bottom-full mb-1" : "top-full mt-1"
7330
7324
  ),
7331
- children: ({ selected }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7332
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: option.label }),
7333
- selected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-gold-600 dark:text-gold-400", children: /* @__PURE__ */ jsxRuntime.jsx(
7334
- "svg",
7335
- {
7336
- className: "h-5 w-5",
7337
- fill: "currentColor",
7338
- viewBox: "0 0 20 20",
7339
- "aria-hidden": "true",
7340
- children: /* @__PURE__ */ jsxRuntime.jsx(
7341
- "path",
7325
+ children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
7326
+ It,
7327
+ {
7328
+ disabled: option.disabled,
7329
+ value: option.value,
7330
+ className: ({ active, selected }) => utils_index.cn(
7331
+ "relative cursor-pointer select-none py-2.5 pl-10 pr-4",
7332
+ // Light mode
7333
+ active ? "bg-gold-50 text-primary-900" : "text-primary-900",
7334
+ // Dark mode
7335
+ active ? "dark:bg-primary-700 dark:text-primary-100" : "dark:text-primary-200",
7336
+ option.disabled && "cursor-not-allowed opacity-50",
7337
+ selected && "font-medium"
7338
+ ),
7339
+ children: ({ selected }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7340
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: option.label }),
7341
+ selected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-gold-600 dark:text-gold-400", children: /* @__PURE__ */ jsxRuntime.jsx(
7342
+ "svg",
7342
7343
  {
7343
- clipRule: "evenodd",
7344
- d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
7345
- fillRule: "evenodd"
7344
+ className: "h-5 w-5",
7345
+ fill: "currentColor",
7346
+ viewBox: "0 0 20 20",
7347
+ "aria-hidden": "true",
7348
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7349
+ "path",
7350
+ {
7351
+ clipRule: "evenodd",
7352
+ d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
7353
+ fillRule: "evenodd"
7354
+ }
7355
+ )
7346
7356
  }
7347
- )
7348
- }
7349
- ) })
7350
- ] })
7351
- },
7352
- option.value
7353
- )) })
7357
+ ) })
7358
+ ] })
7359
+ },
7360
+ option.value
7361
+ ))
7362
+ }
7363
+ )
7354
7364
  }
7355
7365
  )
7356
7366
  ] }) }),