rip-lang 3.13.92 → 3.13.94

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +3 -3
  3. package/bin/rip +11 -1
  4. package/docs/AGENTS.md +43 -0
  5. package/docs/RIP-LANG.md +3 -3
  6. package/docs/RIP-TYPES.md +72 -91
  7. package/docs/charts.html +15 -15
  8. package/docs/dist/rip.js +142 -38
  9. package/docs/dist/rip.min.js +174 -174
  10. package/docs/dist/rip.min.js.br +0 -0
  11. package/docs/index.html +2 -2
  12. package/package.json +1 -1
  13. package/src/AGENTS.md +456 -0
  14. package/src/lexer.js +1 -2
  15. package/src/typecheck.js +188 -6
  16. package/src/types.js +63 -38
  17. package/src/ui.rip +65 -0
  18. package/docs/ui/accordion.rip +0 -113
  19. package/docs/ui/alert-dialog.rip +0 -96
  20. package/docs/ui/autocomplete.rip +0 -141
  21. package/docs/ui/avatar.rip +0 -37
  22. package/docs/ui/badge.rip +0 -15
  23. package/docs/ui/breadcrumb.rip +0 -46
  24. package/docs/ui/button-group.rip +0 -26
  25. package/docs/ui/button.rip +0 -23
  26. package/docs/ui/card.rip +0 -25
  27. package/docs/ui/carousel.rip +0 -110
  28. package/docs/ui/checkbox-group.rip +0 -65
  29. package/docs/ui/checkbox.rip +0 -33
  30. package/docs/ui/collapsible.rip +0 -50
  31. package/docs/ui/combobox.rip +0 -155
  32. package/docs/ui/context-menu.rip +0 -105
  33. package/docs/ui/date-picker.rip +0 -214
  34. package/docs/ui/dialog.rip +0 -107
  35. package/docs/ui/drawer.rip +0 -79
  36. package/docs/ui/editable-value.rip +0 -80
  37. package/docs/ui/field.rip +0 -53
  38. package/docs/ui/fieldset.rip +0 -22
  39. package/docs/ui/form.rip +0 -39
  40. package/docs/ui/grid.rip +0 -901
  41. package/docs/ui/hljs-rip.js +0 -209
  42. package/docs/ui/index.css +0 -1772
  43. package/docs/ui/index.html +0 -2433
  44. package/docs/ui/input-group.rip +0 -28
  45. package/docs/ui/input.rip +0 -36
  46. package/docs/ui/label.rip +0 -16
  47. package/docs/ui/menu.rip +0 -162
  48. package/docs/ui/menubar.rip +0 -155
  49. package/docs/ui/meter.rip +0 -36
  50. package/docs/ui/multi-select.rip +0 -158
  51. package/docs/ui/native-select.rip +0 -32
  52. package/docs/ui/nav-menu.rip +0 -129
  53. package/docs/ui/number-field.rip +0 -162
  54. package/docs/ui/otp-field.rip +0 -89
  55. package/docs/ui/pagination.rip +0 -123
  56. package/docs/ui/popover.rip +0 -143
  57. package/docs/ui/preview-card.rip +0 -73
  58. package/docs/ui/progress.rip +0 -25
  59. package/docs/ui/radio-group.rip +0 -67
  60. package/docs/ui/resizable.rip +0 -123
  61. package/docs/ui/scroll-area.rip +0 -145
  62. package/docs/ui/select.rip +0 -184
  63. package/docs/ui/separator.rip +0 -17
  64. package/docs/ui/skeleton.rip +0 -22
  65. package/docs/ui/slider.rip +0 -165
  66. package/docs/ui/spinner.rip +0 -17
  67. package/docs/ui/table.rip +0 -27
  68. package/docs/ui/tabs.rip +0 -124
  69. package/docs/ui/textarea.rip +0 -48
  70. package/docs/ui/toast.rip +0 -87
  71. package/docs/ui/toggle-group.rip +0 -78
  72. package/docs/ui/toggle.rip +0 -24
  73. package/docs/ui/toolbar.rip +0 -46
  74. package/docs/ui/tooltip.rip +0 -115
@@ -1,80 +0,0 @@
1
- # EditableValue — accessible headless inline editable value
2
- #
3
- # Displays a value with an edit trigger. Clicking opens a popover form.
4
- # Emits 'save' on submit. Ships zero CSS.
5
- #
6
- # Usage:
7
- # EditableValue @save: handleSave
8
- # span $display: true
9
- # "John Doe"
10
- # div $editor: true
11
- # input type: "text", value: name, @input: (e) => name = e.target.value
12
-
13
- export EditableValue = component
14
- @disabled := false
15
-
16
- editing := false
17
- saving := false
18
-
19
- _onEdit: ->
20
- return if @disabled
21
- editing = true
22
- requestAnimationFrame => @_position()
23
-
24
- _onSave: ->
25
- return if saving
26
- saving = true
27
- @emit 'save'
28
-
29
- _onCancel: ->
30
- editing = false
31
- saving = false
32
-
33
- close: ->
34
- editing = false
35
- saving = false
36
-
37
- setSaving: (val) -> saving = val
38
-
39
- _position: ->
40
- display = @_root?.querySelector('[data-display]')
41
- editor = @_root?.querySelector('[data-editor]')
42
- return unless display and editor
43
- @_root.style.position = 'relative'
44
- dr = display.getBoundingClientRect()
45
- cr = @_root.getBoundingClientRect()
46
- editor.style.position = 'absolute'
47
- editor.style.left = "0px"
48
- editor.style.top = "#{dr.bottom - cr.top + 4}px"
49
- editor.style.zIndex = '50'
50
- editor.querySelector('input, textarea, select')?.focus()
51
-
52
- ~>
53
- display = @_root?.querySelector('[data-display]')
54
- editor = @_root?.querySelector('[data-editor]')
55
- return unless display and editor
56
- editor.hidden = not editing
57
- if editing
58
- editor.setAttribute 'data-open', ''
59
- onDown = (e) =>
60
- unless @_root?.contains(e.target)
61
- @_onCancel()
62
- document.addEventListener 'mousedown', onDown
63
- return -> document.removeEventListener 'mousedown', onDown
64
- else
65
- editor.removeAttribute 'data-open'
66
-
67
- onKeydown: (e) ->
68
- if e.key is 'Escape' and editing
69
- e.preventDefault()
70
- @_onCancel()
71
- if e.key is 'Enter' and editing
72
- e.preventDefault()
73
- @_onSave()
74
-
75
- render
76
- div ref: "_root", $editing: editing?!, $disabled: @disabled?!, $saving: saving?!
77
- slot
78
- unless editing
79
- button $edit-trigger: true, aria-label: "Edit", @click: @_onEdit
80
- "✎"
package/docs/ui/field.rip DELETED
@@ -1,53 +0,0 @@
1
- # Field — accessible headless form field wrapper
2
- #
3
- # Associates a label, description, and error message with a form control.
4
- # Generates linked IDs for aria-labelledby/describedby/errormessage.
5
- # Ships zero CSS.
6
- #
7
- # Usage:
8
- # Field label: "Email", error: errors.email
9
- # Input value <=> email, type: "email"
10
-
11
- export Field = component
12
- @label := ''
13
- @description := ''
14
- @error := ''
15
- @disabled := false
16
- @required := false
17
-
18
- _id =! "fld-#{Math.random().toString(36).slice(2, 8)}"
19
-
20
- mounted: ->
21
- ctrl = @_root?.querySelector('input, select, textarea, button, [role]')
22
- if ctrl
23
- ctrl.setAttribute 'aria-labelledby', "#{_id}-label" if @label
24
- ctrl.setAttribute 'aria-describedby', "#{_id}-desc" if @description
25
- ctrl.setAttribute 'aria-errormessage', "#{_id}-err" if @error
26
- ctrl.setAttribute 'aria-invalid', true if @error
27
- ctrl.setAttribute 'aria-required', true if @required
28
-
29
- ~>
30
- ctrl = @_root?.querySelector('input, select, textarea, button, [role]')
31
- return unless ctrl
32
- if @error
33
- ctrl.setAttribute 'aria-invalid', true
34
- ctrl.setAttribute 'aria-errormessage', "#{_id}-err"
35
- else
36
- ctrl.removeAttribute 'aria-invalid'
37
- ctrl.removeAttribute 'aria-errormessage'
38
-
39
- render
40
- div $disabled: @disabled?!, $invalid: @error?!
41
- if @label
42
- label id: "#{_id}-label", $label: true
43
- @label
44
- if @required
45
- span $required: true, aria-hidden: "true"
46
- " *"
47
- slot
48
- if @description and not @error
49
- div id: "#{_id}-desc", $description: true
50
- @description
51
- if @error
52
- div id: "#{_id}-err", role: "alert", $error: true
53
- @error
@@ -1,22 +0,0 @@
1
- # Fieldset — accessible headless fieldset with legend
2
- #
3
- # Groups related fields with an optional legend. Disables all children
4
- # when @disabled is set. Ships zero CSS.
5
- #
6
- # Usage:
7
- # Fieldset legend: "Shipping Address"
8
- # Field label: "Street"
9
- # Input value <=> street
10
- # Field label: "City"
11
- # Input value <=> city
12
-
13
- export Fieldset = component
14
- @legend := ''
15
- @disabled := false
16
-
17
- render
18
- fieldset disabled: @disabled, $disabled: @disabled?!
19
- if @legend
20
- legend $legend: true
21
- @legend
22
- slot
package/docs/ui/form.rip DELETED
@@ -1,39 +0,0 @@
1
- # Form — accessible headless form with validation and submission
2
- #
3
- # Wraps native <form> with submit handling, validation state, and
4
- # loading indicator support. Prevents default submission and emits
5
- # a 'submit' event. Ships zero CSS.
6
- #
7
- # Usage:
8
- # Form @submit: handleSubmit
9
- # Field label: "Name"
10
- # Input value <=> name
11
- # Button
12
- # "Submit"
13
-
14
- export Form = component
15
- @disabled := false
16
-
17
- submitting := false
18
- submitted := false
19
- errors := {}
20
-
21
- _onSubmit: (e) ->
22
- e.preventDefault()
23
- return if @disabled or submitting
24
- submitting = true
25
- submitted = true
26
- @emit 'submit', { form: e.target }
27
-
28
- setErrors: (errs) ->
29
- errors = errs or {}
30
-
31
- setSubmitting: (val) ->
32
- submitting = val
33
-
34
- render
35
- form @submit: @_onSubmit, novalidate: true
36
- $disabled: @disabled?!
37
- $submitting: submitting?!
38
- $submitted: submitted?!
39
- slot