@noya-app/noya-designsystem 0.0.8 → 0.0.9

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/dist/index.mjs CHANGED
@@ -2008,14 +2008,9 @@ var DividerVertical = memo11(function DividerVertical2(props) {
2008
2008
  import React22, { forwardRef as forwardRef8, memo as memo14 } from "react";
2009
2009
  import styled18 from "styled-components";
2010
2010
 
2011
- // ../noya-file-format/dist/index.mjs
2012
- var __defProp2 = Object.defineProperty;
2013
- var __export2 = (target, all) => {
2014
- for (var name in all)
2015
- __defProp2(target, name, { get: all[name], enumerable: true });
2016
- };
2011
+ // ../noya-file-format/src/types.ts
2017
2012
  var types_exports = {};
2018
- __export2(types_exports, {
2013
+ __export(types_exports, {
2019
2014
  AnimationType: () => AnimationType,
2020
2015
  BlendMode: () => BlendMode,
2021
2016
  BlurType: () => BlurType,
@@ -5374,6 +5369,42 @@ var ArrayController = memo27(function ArrayController2({
5374
5369
  ))))
5375
5370
  ) : indexes.map(renderRow)), expanded && renderExpandedContent?.());
5376
5371
  });
5372
+
5373
+ // src/components/DimensionInput.tsx
5374
+ import { round } from "@noya-app/noya-utils";
5375
+ import React40, { memo as memo28, useCallback as useCallback18 } from "react";
5376
+ function getNewValue(value, mode, delta) {
5377
+ return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
5378
+ }
5379
+ var DimensionInput = memo28(function DimensionInput2({
5380
+ id,
5381
+ value,
5382
+ onSetValue,
5383
+ label,
5384
+ size: size2,
5385
+ placeholder = "multi",
5386
+ disabled,
5387
+ trigger = "submit"
5388
+ }) {
5389
+ const handleNudgeValue = useCallback18(
5390
+ (value2) => onSetValue(value2, "adjust"),
5391
+ [onSetValue]
5392
+ );
5393
+ const handleSetValue = useCallback18(
5394
+ (value2) => onSetValue(value2, "replace"),
5395
+ [onSetValue]
5396
+ );
5397
+ return /* @__PURE__ */ React40.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React40.createElement(
5398
+ InputField.NumberInput,
5399
+ {
5400
+ value: value === void 0 ? value : round(value, 2),
5401
+ placeholder: value === void 0 ? placeholder : void 0,
5402
+ onNudge: handleNudgeValue,
5403
+ disabled,
5404
+ ...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
5405
+ }
5406
+ ), label && /* @__PURE__ */ React40.createElement(InputField.Label, null, label));
5407
+ });
5377
5408
  export {
5378
5409
  ActivityIndicator,
5379
5410
  ArrayController,
@@ -5389,6 +5420,7 @@ export {
5389
5420
  DesignSystemConfigurationProvider,
5390
5421
  Dialog,
5391
5422
  DialogProvider,
5423
+ DimensionInput,
5392
5424
  Divider,
5393
5425
  DividerVertical,
5394
5426
  DropdownMenu,
@@ -5441,6 +5473,7 @@ export {
5441
5473
  fuzzyScore,
5442
5474
  fuzzyTokenize,
5443
5475
  getGradientBackground,
5476
+ getNewValue,
5444
5477
  isLeftButtonClicked,
5445
5478
  isRightButtonClicked,
5446
5479
  light_exports as lightTheme,