@bgord/ui 0.4.0 → 0.4.1

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.
@@ -8,7 +8,7 @@ type UseExitActionReturnType = {
8
8
  visible: boolean;
9
9
  trigger: (event: React.MouseEvent) => void;
10
10
  attach: {
11
- "data-exit": UseExitActionAnimationType;
11
+ "data-animation": UseExitActionAnimationType;
12
12
  onAnimationEnd: (event: React.AnimationEvent) => void;
13
13
  } | undefined;
14
14
  };
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ function useExitAction(options) {
21
21
  options.actionFn();
22
22
  setPhase("gone" /* gone */);
23
23
  };
24
- const attach = phase === "exiting" ? { "data-exit": options.animation, onAnimationEnd } : undefined;
24
+ const attach = phase === "exiting" ? { "data-animation": options.animation, onAnimationEnd } : undefined;
25
25
  return { visible: phase !== "gone", attach, trigger };
26
26
  }
27
27
  // src/hooks/use-field.ts
@@ -176,6 +176,12 @@ function Colorful(color) {
176
176
  };
177
177
  return { ...options, style };
178
178
  }
179
+ // src/services/etag.ts
180
+ class ETag {
181
+ static fromRevision(revision) {
182
+ return { "if-match": String(revision) };
183
+ }
184
+ }
179
185
  // src/services/fields.ts
180
186
  class Fields {
181
187
  static allUnchanged(fields) {
@@ -303,6 +309,12 @@ function usePluralize() {
303
309
  const language = useLanguage();
304
310
  return (options) => pluralize({ ...options, language });
305
311
  }
312
+ // src/services/weak-etag.ts
313
+ class WeakETag {
314
+ static fromRevision(revision) {
315
+ return { "if-match": `W/${revision}` };
316
+ }
317
+ }
306
318
  export {
307
319
  useTranslations,
308
320
  useToggle,
@@ -314,12 +326,14 @@ export {
314
326
  useExitAction,
315
327
  pluralize,
316
328
  extractUseToggle,
329
+ WeakETag,
317
330
  TranslationsContext,
318
331
  Rhythm,
319
332
  LocalFields,
320
333
  Form,
321
334
  Fields,
322
335
  Field,
336
+ ETag,
323
337
  Colorful,
324
338
  Button
325
339
  };
@@ -0,0 +1,6 @@
1
+ export type ETagValueType = string;
2
+ export declare class ETag {
3
+ static fromRevision(revision: number): {
4
+ "if-match": string;
5
+ };
6
+ }
@@ -1,7 +1,9 @@
1
1
  export * from "./colorful";
2
+ export * from "./etag";
2
3
  export * from "./field";
3
4
  export * from "./fields";
4
5
  export * from "./form";
5
6
  export * from "./pluralize";
6
7
  export * from "./rhythm";
7
8
  export * from "./translations";
9
+ export * from "./weak-etag";
@@ -0,0 +1,6 @@
1
+ export type WeakETagValueType = string;
2
+ export declare class WeakETag {
3
+ static fromRevision(revision: number): {
4
+ "if-match": string;
5
+ };
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/ui",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -36,7 +36,7 @@
36
36
  "@biomejs/biome": "2.0.6",
37
37
  "@commitlint/cli": "19.8.1",
38
38
  "@commitlint/config-conventional": "19.8.1",
39
- "cspell": "9.1.3",
39
+ "cspell": "9.1.5",
40
40
  "knip": "5.61.3",
41
41
  "lefthook": "1.12.2",
42
42
  "only-allow": "1.2.1",
package/readme.md ADDED
@@ -0,0 +1,45 @@
1
+ # bgord-ui
2
+
3
+ ## Configuration:
4
+
5
+ Clone the repository
6
+
7
+ ```
8
+ git clone git@github.com:bgord/journal.git --recurse-submodules
9
+ ```
10
+
11
+ Install packages
12
+
13
+ ```
14
+ bun i
15
+ ```
16
+
17
+ Run the tests
18
+
19
+ ```
20
+ ./bgord-scripts/test-run.sh
21
+ ```
22
+
23
+ ## Files:
24
+
25
+ ```
26
+ src/
27
+ ├── components
28
+ │   ├── button.tsx
29
+ ├── hooks
30
+ │   ├── use-exit-action.ts
31
+ │   ├── use-field.ts
32
+ │   ├── use-hover.ts
33
+ │   └── use-toggle.ts
34
+ └── services
35
+ ├── colorful.ts
36
+ ├── etag.ts
37
+ ├── field.ts
38
+ ├── fields.ts
39
+ ├── form.ts
40
+ ├── pluralize.ts
41
+ ├── rhythm.ts
42
+ ├── translations.tsx
43
+ └── weak-etag.ts
44
+ ```
45
+
package/README.md DELETED
@@ -1,15 +0,0 @@
1
- # bgord-ui
2
-
3
- To install dependencies:
4
-
5
- ```bash
6
- bun install
7
- ```
8
-
9
- To run:
10
-
11
- ```bash
12
- bun run index.ts
13
- ```
14
-
15
- This project was created using `bun init` in bun v1.2.17. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.